diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bc746a53440e0b4dbf0accf53e934e54df9c7c75..615872734687120463fe0cd7b292223f6f3d50b3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,3 +1,17 @@ +# 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. + # stages of the cicd pipeline stages: - dependencies @@ -20,7 +34,10 @@ include: - local: '/src/opticalattackmitigator/.gitlab-ci.yml' - local: '/src/opticalcentralizedattackdetector/.gitlab-ci.yml' - local: '/src/automation/.gitlab-ci.yml' - - local: '/src/webui/.gitlab-ci.yml' - - local: '/src/l3_distributedattackdetector/.gitlab-ci.yml' - - local: '/src/l3_centralizedattackdetector/.gitlab-ci.yml' - - local: '/src/l3_attackmitigator/.gitlab-ci.yml' + - local: '/src/policy/.gitlab-ci.yml' + #- local: '/src/webui/.gitlab-ci.yml' + #- local: '/src/l3_distributedattackdetector/.gitlab-ci.yml' + #- local: '/src/l3_centralizedattackdetector/.gitlab-ci.yml' + #- local: '/src/l3_attackmitigator/.gitlab-ci.yml' + #- local: '/src/slice/.gitlab-ci.yml' + #- local: '/src/interdomain/.gitlab-ci.yml' diff --git a/deploy_in_kubernetes.sh b/deploy_in_kubernetes.sh index 0da87dbe5dc92d785b2a1b3aedda85288231b03f..a1b4551dd939e7b1a727307cc177d379e6938182 100755 --- a/deploy_in_kubernetes.sh +++ b/deploy_in_kubernetes.sh @@ -131,9 +131,12 @@ for COMPONENT in $COMPONENTS; do printf "\n" done -echo "Configuring DataStores and Dashboards..." -./configure_dashboards.sh -printf "\n\n" + +if [[ "$COMPONENTS" == *"webui"* ]]; then + echo "Configuring WebUI DataStores and Dashboards..." + ./configure_dashboards.sh + printf "\n\n" +fi echo "Reporting Deployment..." kubectl --namespace $K8S_NAMESPACE get all diff --git a/manifests/interdomainservice.yaml b/manifests/interdomainservice.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ca30da0101659f801440af343e42851146d17bda --- /dev/null +++ b/manifests/interdomainservice.yaml @@ -0,0 +1,64 @@ +# 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: interdomainservice +spec: + selector: + matchLabels: + app: interdomainservice + template: + metadata: + labels: + app: interdomainservice + spec: + terminationGracePeriodSeconds: 5 + containers: + - name: server + image: registry.gitlab.com/teraflow-h2020/controller/interdomain:latest + imagePullPolicy: Always + ports: + - containerPort: 10010 + env: + - name: LOG_LEVEL + value: "DEBUG" + readinessProbe: + exec: + command: ["/bin/grpc_health_probe", "-addr=:10010"] + livenessProbe: + exec: + command: ["/bin/grpc_health_probe", "-addr=:10010"] + resources: + requests: + cpu: 250m + memory: 512Mi + limits: + cpu: 700m + memory: 1024Mi +--- +apiVersion: v1 +kind: Service +metadata: + name: interdomainservice +spec: + type: ClusterIP + selector: + app: interdomainservice + ports: + - name: grpc + protocol: TCP + port: 10010 + targetPort: 10010 diff --git a/manifests/sliceservice.yaml b/manifests/sliceservice.yaml new file mode 100644 index 0000000000000000000000000000000000000000..eeed3776c10958751b74fc81b52ab79806153b18 --- /dev/null +++ b/manifests/sliceservice.yaml @@ -0,0 +1,64 @@ +# 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: sliceservice +spec: + selector: + matchLabels: + app: sliceservice + template: + metadata: + labels: + app: sliceservice + spec: + terminationGracePeriodSeconds: 5 + containers: + - name: server + image: registry.gitlab.com/teraflow-h2020/controller/slice:latest + imagePullPolicy: Always + ports: + - containerPort: 4040 + env: + - name: LOG_LEVEL + value: "DEBUG" + readinessProbe: + exec: + command: ["/bin/grpc_health_probe", "-addr=:4040"] + livenessProbe: + exec: + command: ["/bin/grpc_health_probe", "-addr=:4040"] + resources: + requests: + cpu: 250m + memory: 512Mi + limits: + cpu: 700m + memory: 1024Mi +--- +apiVersion: v1 +kind: Service +metadata: + name: sliceservice +spec: + type: ClusterIP + selector: + app: sliceservice + ports: + - name: grpc + protocol: TCP + port: 4040 + targetPort: 4040 diff --git a/manifests/webuiservice.yaml b/manifests/webuiservice.yaml index be7ad73d7ca92c7deabbb0a312d8f4b3889af28a..8c7c3773cbc9b89e5f6fb7800928f19a42adf7f0 100644 --- a/manifests/webuiservice.yaml +++ b/manifests/webuiservice.yaml @@ -71,14 +71,14 @@ spec: path: /robots.txt port: 3000 scheme: HTTP - initialDelaySeconds: 5 - periodSeconds: 5 + initialDelaySeconds: 10 + periodSeconds: 30 successThreshold: 1 timeoutSeconds: 2 livenessProbe: failureThreshold: 3 - initialDelaySeconds: 5 - periodSeconds: 5 + initialDelaySeconds: 30 + periodSeconds: 10 successThreshold: 1 tcpSocket: port: 3000 diff --git a/oeccpsc22 b/oeccpsc22 new file mode 120000 index 0000000000000000000000000000000000000000..4f55befad3e8730c8b7eb1a4cf2fbc7600d1878b --- /dev/null +++ b/oeccpsc22 @@ -0,0 +1 @@ +src/tests/oeccpsc22/ \ No newline at end of file diff --git a/proto/context.proto b/proto/context.proto index 057f44c9b0207651495597fcbf345c1ca1f521ca..bc0bfa0c6d41c6eb3474f69c05f87cc456269c66 100644 --- a/proto/context.proto +++ b/proto/context.proto @@ -53,6 +53,13 @@ service ContextService { rpc RemoveService (ServiceId ) returns ( Empty ) {} rpc GetServiceEvents (Empty ) returns (stream ServiceEvent ) {} + rpc ListSliceIds (ContextId ) returns ( SliceIdList ) {} + rpc ListSlices (ContextId ) returns ( SliceList ) {} + rpc GetSlice (SliceId ) returns ( Slice ) {} + rpc SetSlice (Slice ) returns ( SliceId ) {} + rpc RemoveSlice (SliceId ) returns ( Empty ) {} + rpc GetSliceEvents (Empty ) returns (stream SliceEvent ) {} + rpc ListConnectionIds (ServiceId ) returns ( ConnectionIdList) {} rpc ListConnections (ServiceId ) returns ( ConnectionList ) {} rpc GetConnection (ConnectionId) returns ( Connection ) {} @@ -253,6 +260,45 @@ message ServiceEvent { ServiceId service_id = 2; } +// ----- Slice --------------------------------------------------------------------------------------------------------- +message SliceId { + ContextId context_id = 1; + Uuid slice_uuid = 2; +} + +message Slice { + SliceId slice_id = 1; + repeated EndPointId slice_endpoint_ids = 2; + repeated Constraint slice_constraints = 3; + repeated ServiceId slice_service_ids = 4; + repeated SliceId slice_subslice_ids = 5; + SliceStatus slice_status = 6; +} + +enum SliceStatusEnum { + SLICESTATUS_UNDEFINED = 0; + SLICESTATUS_PLANNED = 1; + SLICESTATUS_INIT = 2; + SLICESTATUS_ACTIVE = 3; + SLICESTATUS_DEINIT = 4; +} + +message SliceStatus { + SliceStatusEnum slice_status = 1; +} + +message SliceIdList { + repeated SliceId slice_ids = 1; +} + +message SliceList { + repeated Slice slices = 1; +} + +message SliceEvent { + Event event = 1; + SliceId slice_id = 2; +} // ----- Connection ---------------------------------------------------------------------------------------------------- message ConnectionId { diff --git a/proto/dlt.proto b/proto/dlt.proto index 29a0db198313533393a8f87a1fc328c9335e0a0a..44fb9478fc49d612edfb7c801d79056c28104344 100644 --- a/proto/dlt.proto +++ b/proto/dlt.proto @@ -12,72 +12,86 @@ // See the License for the specific language governing permissions and // limitations under the License. -//Example of topology syntax = "proto3"; package dlt; import "context.proto"; service DltService { - rpc RecordToDlt ( DltRecord ) returns ( RecordStatus ) {} - rpc GetFromDlt ( DltRecordId ) returns ( DltRecord ) {} - rpc SubscribeToDlt ( DltRecordSubscription ) returns ( stream DltRecord ) {} - rpc GetDltStatus ( context.Empty ) returns ( DltStatus ) {} + rpc RecordToDlt (DltRecord ) returns ( DltRecordStatus ) {} + rpc GetFromDlt (DltRecordId ) returns ( DltRecord ) {} + rpc SubscribeToDlt(DltRecordSubscription ) returns (stream DltRecordEvent ) {} + rpc GetDltStatus (context.TeraFlowController) returns ( DltPeerStatus ) {} // NEC is checkig if it is possible + rpc GetDltPeers (context.Empty ) returns ( DltPeerStatusList) {} // NEC is checkig if it is possible } -message DltRecordSubscription { - DltRecordType type = 1; - DltRecordOperation operation = 2; +enum DltRecordTypeEnum { + DLTRECORDTYPE_UNDEFINED = 0; + DLTRECORDTYPE_CONTEXT = 1; + DLTRECORDTYPE_TOPOLOGY = 2; + DLTRECORDTYPE_DEVICE = 3; + DLTRECORDTYPE_LINK = 4; + DLTRECORDTYPE_SERVICE = 5; + DLTRECORDTYPE_SLICE = 6; } -enum DltRecordType { - UNKNOWN = 0; - SERVICE = 1; - DEVICE = 2; - SLICE = 3; +enum DltRecordOperationEnum { + DLTRECORDOPERATION_UNDEFINED = 0; + DLTRECORDOPERATION_ADD = 1; + DLTRECORDOPERATION_UPDATE = 2; + DLTRECORDOPERATION_DELETE = 3; } -enum DltRecordOperation { - ADD = 0; - UPDATE = 1; - DELETE = 2; +enum DltRecordStatusEnum { + DLTRECORDSTATUS_UNDEFINED = 0; + DLTRECORDSTATUS_SUCCEEDED = 1; + DLTRECORDSTATUS_FAILED = 2; } -message DltRecord { - DltRecordId id = 1; - DltRecordType type = 2; - DltRecordOperation operation = 3; - string json = 4; +enum DltStatusEnum { + DLTSTATUS_UNDEFINED = 0; + DLTSTATUS_NOTAVAILABLE = 1; + DLTSTATUS_INITIALIZED = 2; + DLTSTATUS_AVAILABLE = 3; + DLTSTATUS_DEINIT = 4; } message DltRecordId { - context.Uuid id = 1; + context.Uuid domain_uuid = 1; // unique identifier of domain owning the record + DltRecordTypeEnum type = 2; // type of record + context.Uuid record_uuid = 3; // unique identifier of the record within the domain context_uuid/topology_uuid } -message RecordStatus { - DltRecordId id = 1; - DltRecordStatusEnum status = 2; +message DltRecord { + DltRecordId record_id = 1; // record identifier + DltRecordOperationEnum operation = 2; // operation to be performed over the record + string data_json = 3; // record content: JSON-encoded record content } -enum DltRecordStatusEnum { - REQUESTED = 0; - STORED = 1; - DISABLED = 2; +message DltRecordSubscription { + // retrieved events have to match ALL conditions. + // i.e., type in types requested, AND operation in operations requested + // TODO: consider adding a more sophisticated filtering + repeated DltRecordTypeEnum type = 1; // selected event types, empty=all + repeated DltRecordOperationEnum operation = 2; // selected event operations, empty=all } - -message DltStatus { - context.TeraFlowController ctl = 1; - DltStatusEnum status = 2; +message DltRecordEvent { + context.Event event = 1; // common event data (timestamp & event_type) + DltRecordId record_id = 2; // record identifier associated with this event } -enum DltStatusEnum { - NOT_AVAILABLE = 0; - INITIALIZED = 1; - AVAILABLE = 2; - DEINIT = 3; +message DltRecordStatus { + DltRecordId record_id = 1; // identifier of the associated record + DltRecordStatusEnum status = 2; // status of the record + string error_message = 3; // error message in case of failure, empty otherwise } +message DltPeerStatus { + context.TeraFlowController controller = 1; // Identifier of the TeraFlow controller instance + DltStatusEnum status = 2; // Status of the TeraFlow controller instance +} - - +message DltPeerStatusList { + repeated DltPeerStatus peers = 1; // List of peers and their status +} diff --git a/proto/interdomain.proto b/proto/interdomain.proto index 7088586e27bad7cd241f0ca17353e621144073e9..735d4c1cd3ec92de41a0a0a1bc91de6acc846cd9 100644 --- a/proto/interdomain.proto +++ b/proto/interdomain.proto @@ -12,23 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -//Example of topology syntax = "proto3"; package interdomain; import "context.proto"; -import "slice.proto"; service InterdomainService { - rpc Authenticate (context.TeraFlowController) returns (context.AuthenticationResult) {} - rpc LookUpSlice(slice.TransportSlice) returns (slice.SliceId) {} //Slice component or from interdomain component - rpc OrderSliceFromCatalog(slice.TransportSlice) returns (slice.SliceStatus) {} - rpc CreateSliceAndAddToCatalog(slice.TransportSlice) returns (slice.SliceStatus) {} + rpc Authenticate (context.TeraFlowController) returns (context.AuthenticationResult) {} + 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 ) {} } - - - - - - - diff --git a/proto/policy-action.proto b/proto/policy-action.proto new file mode 100644 index 0000000000000000000000000000000000000000..374b5975129353219902e270a521496e914b1625 --- /dev/null +++ b/proto/policy-action.proto @@ -0,0 +1,29 @@ +// 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 policy; + +// Action +message PolicyRuleAction { + PolicyRuleActionEnum action = 1; + repeated string parameters = 2; +} + +enum PolicyRuleActionEnum { + POLICYRULE_ACTION_NO_ACTION = 0; + POLICYRULE_ACTION_SET_DEVICE_STATUS = 1; + POLICYRULE_ACTION_ADD_SERVICE_CONFIGRULE = 2; + POLICYRULE_ACTION_ADD_SERVICE_CONSTRAINT = 3; +} diff --git a/proto/policy-condition.proto b/proto/policy-condition.proto new file mode 100644 index 0000000000000000000000000000000000000000..7cd6576678872df07a2da6a3706349f004b3a8a1 --- /dev/null +++ b/proto/policy-condition.proto @@ -0,0 +1,43 @@ +// 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 policy; + +import "monitoring.proto"; + +// Condition +message PolicyRuleCondition { + monitoring.KpiId kpiId = 1; + NumericalOperator numericalOperator = 2; + monitoring.KpiValue kpiValue = 3; +} + +// Operator to be used when comparing Kpis with condition values +enum NumericalOperator { + POLICYRULE_CONDITION_NUMERICAL_UNDEFINED = 0; // Kpi numerical operator undefined + POLICYRULE_CONDITION_NUMERICAL_EQUAL = 1; // Kpi is equal with value + POLICYRULE_CONDITION_NUMERICAL_NOT_EQUAL = 2; // Kpi is not equal with value + POLICYRULE_CONDITION_NUMERICAL_LESS_THAN = 3; // Kpi is less than value + POLICYRULE_CONDITION_NUMERICAL_LESS_THAN_EQUAL = 4; // Kpi is less than or equal with value + POLICYRULE_CONDITION_NUMERICAL_GREATER_THAN = 5; // Kpi is greater than value + POLICYRULE_CONDITION_NUMERICAL_GREATER_THAN_EQUAL = 6; // Kpi is less than or equal with value +} + +// Operator to be used when evaluating each condition +enum BooleanOperator { + POLICYRULE_CONDITION_BOOLEAN_UNDEFINED = 0; // Boolean operator undefined + POLICYRULE_CONDITION_BOOLEAN_AND = 1; // Boolean AND operator + POLICYRULE_CONDITION_BOOLEAN_OR = 2; // Boolean OR operator +} \ No newline at end of file diff --git a/proto/policy.proto b/proto/policy.proto index 447eda2e19188a39a1980181d3018a25ed9f83c7..9e67b776464b8d29023cc702341320b94e338714 100644 --- a/proto/policy.proto +++ b/proto/policy.proto @@ -16,25 +16,32 @@ syntax = "proto3"; package policy; import "context.proto"; +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 { @@ -42,58 +49,51 @@ message PolicyRuleId { } message PolicyRuleState { - context.Uuid policyRuleId = 1; - RuleState policyRuleState = 2; -} - -message PolicyRuleVariable { - string policyRuleVariable = 1; + RuleState policyRuleState = 1; } -message PolicyRuleValue { - string policyRuleValue = 1; -} +// Basic policy rule attributes +message PolicyRuleBasic { + PolicyRuleId policyRuleId = 1; + optional PolicyRuleState policyRuleState = 2; + uint32 priority = 3; -// 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; + // 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 } -// Condition -message PolicyRuleCondition { - PolicyRuleVariable polRuleConditionVar = 1; - PolicyRuleValue polRuleConditionVal = 2; -} +// Service-oriented policy rule +message PolicyRuleService { + // Basic policy rule attributes + PolicyRuleBasic policyRuleBasic = 1; -// Action -message PolicyRuleAction { - PolicyRuleVariable polRuleActionVar = 1; - PolicyRuleValue polRuleActionVal = 2; + // 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) } -// 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 { +// Device-oriented policy rule +message PolicyRuleDevice { // Basic policy rule attributes - PolicyRuleId policyRuleId = 1; - PolicyRuleType policyRuleType = 2; - uint32 PolicyRulePriority = 3; + PolicyRuleBasic policyRuleBasic = 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 + // Affected device(s) + repeated context.DeviceId deviceList = 2; +} + +// A list of policy rule IDs +message PolicyRuleIdList { + repeated PolicyRuleId policyRuleIdList = 1; +} - // Affected services and devices - repeated context.ServiceId serviceList = 7; - repeated context.DeviceId deviceList = 8; +// A list of service-oriented policy rules +message PolicyRuleServiceList { + repeated PolicyRuleService policyRuleServiceList = 1; } -// A list of policy rules -message PolicyRuleList { - repeated PolicyRule policyRuleList = 1; +// A list of device-oriented policy rules +message PolicyRuleDeviceList { + repeated PolicyRuleDevice policyRuleDeviceList = 1; } diff --git a/proto/slice.proto b/proto/slice.proto index 73e945a40aa2e23d1780045600df2e3c794333f8..9c518c9da05f850f209dc8a3f8d945fff4aced2b 100644 --- a/proto/slice.proto +++ b/proto/slice.proto @@ -12,43 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -//Example of topology syntax = "proto3"; package slice; import "context.proto"; service SliceService { - 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 context.ServiceId services = 4; - repeated SliceId subSlicesId = 5; - SliceStatus status = 6; -} - -message SliceId { - context.ContextId contextId = 1; - context.Uuid slice_id = 2; -} - -message SliceStatus { - slice.SliceId slice_id = 1; - SliceStatusEnum status = 2; -} - -enum SliceStatusEnum { - PLANNED = 0; - INIT = 1; - ACTIVE = 2; - DEINIT = 3; + rpc CreateSlice(context.Slice ) returns (context.SliceId) {} + rpc UpdateSlice(context.Slice ) returns (context.SliceId) {} + rpc DeleteSlice(context.SliceId) returns (context.Empty ) {} } diff --git a/scripts/report_coverage_slice.sh b/scripts/report_coverage_slice.sh new file mode 100755 index 0000000000000000000000000000000000000000..f9b17e8bd162500e2be77a871f7f2976f923ca68 --- /dev/null +++ b/scripts/report_coverage_slice.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# 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. + + +./report_coverage_all.sh | grep --color -E -i "^slice/.*$|$" diff --git a/scripts/run_tests_locally-device-all.sh b/scripts/run_tests_locally-device-all.sh new file mode 100755 index 0000000000000000000000000000000000000000..2cf8faaf50355a3cc5f3a0206498ed4dacb48523 --- /dev/null +++ b/scripts/run_tests_locally-device-all.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# 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. + + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc + +# Run unitary tests and analyze coverage of code at same time + +# Useful flags for pytest: +#-o log_cli=true -o log_file=device.log -o log_file_level=DEBUG + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + device/tests/test_unitary_emulated.py + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + device/tests/test_unitary_openconfig.py + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + device/tests/test_unitary_tapi.py + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + device/tests/test_unitary_p4.py + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + device/tests/test_unitary_microwave.py diff --git a/scripts/run_tests_in_kubernetes.sh b/scripts/run_tests_locally-device-emulated.sh similarity index 61% rename from scripts/run_tests_in_kubernetes.sh rename to scripts/run_tests_locally-device-emulated.sh index fc0e1425731bf333a88eca6b65a3fc12122c7768..ab4f77adaf9c0549551c91d944c1c6db77a8b9cb 100755 --- a/scripts/run_tests_in_kubernetes.sh +++ b/scripts/run_tests_locally-device-emulated.sh @@ -14,11 +14,15 @@ # limitations under the License. -IMAGE_NAME='integration_tester' -IMAGE_TAG='latest' -CI_REGISTRY_IMAGE='registry.gitlab.com/teraflow-h2020/controller' +PROJECTDIR=`pwd` -kubectl delete pod $(echo $IMAGE_NAME | sed -r 's/[^a-zA-Z0-9\.\-]/-/g') --wait=true --ignore-not-found=true -kubectl get all -kubectl run $(echo $IMAGE_NAME | sed -r 's/[^a-zA-Z0-9\.\-]/-/g') --image "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" --restart=Never --rm -i -kubectl get all +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc + +# Run unitary tests and analyze coverage of code at same time + +# Useful flags for pytest: +#-o log_cli=true -o log_file=device.log -o log_file_level=DEBUG + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + device/tests/test_unitary_emulated.py diff --git a/scripts/run_tests_locally-device-microwave.sh b/scripts/run_tests_locally-device-microwave.sh new file mode 100755 index 0000000000000000000000000000000000000000..e03630c9f63c65cae91464b76cc3ddc447835f42 --- /dev/null +++ b/scripts/run_tests_locally-device-microwave.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# 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. + + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc + +# Run unitary tests and analyze coverage of code at same time + +# Useful flags for pytest: +#-o log_cli=true -o log_file=device.log -o log_file_level=DEBUG + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + device/tests/test_unitary_microwave.py diff --git a/scripts/run_tests_locally-device-openconfig.sh b/scripts/run_tests_locally-device-openconfig.sh new file mode 100755 index 0000000000000000000000000000000000000000..83d4a0545a3386395ead97f40d45c034350c73b9 --- /dev/null +++ b/scripts/run_tests_locally-device-openconfig.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# 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. + + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc + +# Run unitary tests and analyze coverage of code at same time + +# Useful flags for pytest: +#-o log_cli=true -o log_file=device.log -o log_file_level=DEBUG + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + device/tests/test_unitary_openconfig.py diff --git a/scripts/run_tests_locally-device-p4.sh b/scripts/run_tests_locally-device-p4.sh new file mode 100755 index 0000000000000000000000000000000000000000..36b381a3cd9214603456828b41e6d70b8c6c908d --- /dev/null +++ b/scripts/run_tests_locally-device-p4.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# 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. + + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc + +# Run unitary tests and analyze coverage of code at same time + +# Useful flags for pytest: +#-o log_cli=true -o log_file=device.log -o log_file_level=DEBUG + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + device/tests/test_unitary_p4.py diff --git a/scripts/run_tests_locally-device-tapi.sh b/scripts/run_tests_locally-device-tapi.sh new file mode 100755 index 0000000000000000000000000000000000000000..a281466b677f256b2ce9fe7770bf2b052ef59126 --- /dev/null +++ b/scripts/run_tests_locally-device-tapi.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# 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. + + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc + +# Run unitary tests and analyze coverage of code at same time + +# Useful flags for pytest: +#-o log_cli=true -o log_file=device.log -o log_file_level=DEBUG + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + device/tests/test_unitary_tapi.py diff --git a/scripts/run_tests_locally-slice.sh b/scripts/run_tests_locally-slice.sh new file mode 100755 index 0000000000000000000000000000000000000000..adad39b5b2de2f4de0f2451e89a20732d1ecda2c --- /dev/null +++ b/scripts/run_tests_locally-slice.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# 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. + + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc + +# Run unitary tests and analyze coverage of code at same time + +# Useful flags for pytest: +#-o log_cli=true -o log_file=service.log -o log_file_level=DEBUG + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + slice/tests/test_unitary.py diff --git a/scripts/run_tests_locally.sh b/scripts/run_tests_locally.sh index 1655d875e4f3cbb5922b773094422d32dff1ee2e..4a95fd8be7ac83ff0b5ec5a3db47c0cf4fae06f4 100755 --- a/scripts/run_tests_locally.sh +++ b/scripts/run_tests_locally.sh @@ -63,7 +63,7 @@ coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ context/tests/test_unitary.py coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ - device/tests/test_unitary.py + device/tests/test_unitary_emulated.py coverage run --rcfile=$RCFILE --append -m pytest -s --log-level=INFO --verbose \ l3_centralizedattackdetector/tests/test_unitary.py @@ -94,3 +94,6 @@ coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ monitoring/tests/test_unitary.py + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + slice/tests/test_unitary.py diff --git a/src/automation/.gitlab-ci.yml b/src/automation/.gitlab-ci.yml index 76cd4ea0d07496af864275cd63c5fbd8f94b7659..87d141d5bef56c8d3fbd5bb5a0a961ac12598dd6 100644 --- a/src/automation/.gitlab-ci.yml +++ b/src/automation/.gitlab-ci.yml @@ -69,7 +69,6 @@ unit_test automation: coverage: '/JaCoCo Coverage Total: ([0-9]{1,3})%/' artifacts: reports: - cobertura: ${REPORTS_PATH}/cobertura.xml junit: - ${REPORTS_PATH}/surefire-reports/TEST-*.xml rules: diff --git a/src/automation/src/main/java/eu/teraflow/automation/AutomationConfiguration.java b/src/automation/src/main/java/eu/teraflow/automation/AutomationConfiguration.java index 55f5cce25e8a03a1a5c0da567f16bd858c668d0f..91b6e159d26c86afaf0412af0406657a9c72f8d5 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/AutomationConfiguration.java +++ b/src/automation/src/main/java/eu/teraflow/automation/AutomationConfiguration.java @@ -1,18 +1,18 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.automation; diff --git a/src/automation/src/main/java/eu/teraflow/automation/AutomationGateway.java b/src/automation/src/main/java/eu/teraflow/automation/AutomationGateway.java index 1533643d14cb0d78ababe57242a4f01a50c3b0b8..2d8194c6902037b09cf1f707dc8ff9c264e2f2c5 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/AutomationGateway.java +++ b/src/automation/src/main/java/eu/teraflow/automation/AutomationGateway.java @@ -1,18 +1,18 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.automation; diff --git a/src/automation/src/main/java/eu/teraflow/automation/AutomationGatewayImpl.java b/src/automation/src/main/java/eu/teraflow/automation/AutomationGatewayImpl.java index 7f403459a2ff28809046a292c7c64d413c066243..7a68965bf96a2c827219f761f19ba752dd534ffc 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/AutomationGatewayImpl.java +++ b/src/automation/src/main/java/eu/teraflow/automation/AutomationGatewayImpl.java @@ -1,18 +1,18 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.automation; @@ -56,7 +56,7 @@ public class AutomationGatewayImpl implements AutomationGateway { return automationService .addDevice(deviceId) .onItem() - .transform( device -> transformToDeviceRoleState(device, devRoleId)); + .transform(device -> transformToDeviceRoleState(device, devRoleId)); } @Override @@ -84,8 +84,9 @@ public class AutomationGatewayImpl implements AutomationGateway { return Uni.createFrom().item(() -> Automation.DeviceDeletionResult.newBuilder().build()); } - // TODO When `DeviceRoleState` domain object will be created, move this method to Serializer class and create related tests - private Automation.DeviceRoleState transformToDeviceRoleState(Device device, String devRoleId){ + // TODO When `DeviceRoleState` domain object will be created, move this method to Serializer class + // and create related tests + private Automation.DeviceRoleState transformToDeviceRoleState(Device device, String devRoleId) { final var deviceRoleId = new DeviceRoleId(devRoleId, device.getDeviceId()); final var serializeDeviceRoleId = serializer.serialize(deviceRoleId); @@ -95,4 +96,4 @@ public class AutomationGatewayImpl implements AutomationGateway { .setDevRoleState(Automation.ZtpDeviceState.ZTP_DEV_STATE_CREATED) .build(); } -} \ No newline at end of file +} diff --git a/src/automation/src/main/java/eu/teraflow/automation/AutomationService.java b/src/automation/src/main/java/eu/teraflow/automation/AutomationService.java index 38d7420ed3ba865ae141843c9ba41a6a345e8f31..9e8927d583ce34cb8bfa0eaa7ba5561981b8dac7 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/AutomationService.java +++ b/src/automation/src/main/java/eu/teraflow/automation/AutomationService.java @@ -1,18 +1,18 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.automation; diff --git a/src/automation/src/main/java/eu/teraflow/automation/AutomationServiceImpl.java b/src/automation/src/main/java/eu/teraflow/automation/AutomationServiceImpl.java index 433dffbc727f685fb0d8f80ae0c2e4dc559bae87..3db0d647ebc5c2341337bcb5d91484af8684dfe6 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/AutomationServiceImpl.java +++ b/src/automation/src/main/java/eu/teraflow/automation/AutomationServiceImpl.java @@ -1,18 +1,18 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.automation; diff --git a/src/automation/src/main/java/eu/teraflow/automation/ContextSubscriber.java b/src/automation/src/main/java/eu/teraflow/automation/ContextSubscriber.java index cb80a6428fbab7ca69952eb5ead760ae815e99c6..c27a2a844350ce3aeb56c594c82ce4543b7e4d94 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/ContextSubscriber.java +++ b/src/automation/src/main/java/eu/teraflow/automation/ContextSubscriber.java @@ -1,18 +1,18 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.automation; diff --git a/src/automation/src/main/java/eu/teraflow/automation/Serializer.java b/src/automation/src/main/java/eu/teraflow/automation/Serializer.java index 1cabde5bf714b4427e4abb5551b39f30b5474a79..78f251439979fff73112e7a77af507d25b9b2dca 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/Serializer.java +++ b/src/automation/src/main/java/eu/teraflow/automation/Serializer.java @@ -1,18 +1,18 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.automation; diff --git a/src/automation/src/main/java/eu/teraflow/automation/SimpleLivenessCheck.java b/src/automation/src/main/java/eu/teraflow/automation/SimpleLivenessCheck.java index 056b844d5e702db37cf51cce7f86a9e387fa9c12..7c3a2ccb5409d8df5ea95d3cd02eda8d97d74496 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/SimpleLivenessCheck.java +++ b/src/automation/src/main/java/eu/teraflow/automation/SimpleLivenessCheck.java @@ -1,18 +1,18 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.automation; diff --git a/src/automation/src/main/java/eu/teraflow/automation/SimpleReadinessCheck.java b/src/automation/src/main/java/eu/teraflow/automation/SimpleReadinessCheck.java index ef1b4c4efceeeb042adf50f0b20a688c5e1004da..c863a6c285b4abbe9002a0d33c2648d0b1017b45 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/SimpleReadinessCheck.java +++ b/src/automation/src/main/java/eu/teraflow/automation/SimpleReadinessCheck.java @@ -1,18 +1,18 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.automation; diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/ContextGateway.java b/src/automation/src/main/java/eu/teraflow/automation/context/ContextGateway.java index 83bcc1afddeeeea8545b64f06d4157457d951e84..3bae4161d61d7c94f639b3953324981dca2a1b3d 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/ContextGateway.java +++ b/src/automation/src/main/java/eu/teraflow/automation/context/ContextGateway.java @@ -1,18 +1,18 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.automation.context; diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/ContextGatewayImpl.java b/src/automation/src/main/java/eu/teraflow/automation/context/ContextGatewayImpl.java index 1b11d09a4ce26c3c98af65aa4d5a13f45c049bb7..7bec6413818342f955abcaa2497f8c174951e8dd 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/ContextGatewayImpl.java +++ b/src/automation/src/main/java/eu/teraflow/automation/context/ContextGatewayImpl.java @@ -1,36 +1,34 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.automation.context; import context.ContextOuterClass; import context.MutinyContextServiceGrpc.MutinyContextServiceStub; import eu.teraflow.automation.Serializer; -import eu.teraflow.automation.device.model.*; import eu.teraflow.automation.device.model.Device; +import eu.teraflow.automation.device.model.DeviceEvent; import io.quarkus.grpc.GrpcClient; import io.smallrye.mutiny.Multi; import io.smallrye.mutiny.Uni; import javax.enterprise.context.ApplicationScoped; import javax.inject.Inject; -import org.jboss.logging.Logger; @ApplicationScoped public class ContextGatewayImpl implements ContextGateway { - private static final Logger LOGGER = Logger.getLogger(ContextGatewayImpl.class); @GrpcClient("context") MutinyContextServiceStub streamingDelegateContext; diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/ContextService.java b/src/automation/src/main/java/eu/teraflow/automation/context/ContextService.java index 8b690782aec7ca1ebf23af4c2d91946330314be6..c3e01a1258c0bf99827fd81f0c2e9c087498d803 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/ContextService.java +++ b/src/automation/src/main/java/eu/teraflow/automation/context/ContextService.java @@ -1,18 +1,18 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.automation.context; diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/ContextServiceImpl.java b/src/automation/src/main/java/eu/teraflow/automation/context/ContextServiceImpl.java index 38a938833628cceb5d67c3f51daa06e93fa464d4..10d16bdf9e8eec3434899ef1454762619afdc805 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/ContextServiceImpl.java +++ b/src/automation/src/main/java/eu/teraflow/automation/context/ContextServiceImpl.java @@ -1,18 +1,18 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.automation.context; diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/Event.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/Event.java index 974d8dc93ae83c7fccff234753edb3e9fa0ae05b..2b4a4bab6730e5ba18749eb62cecde8811797e87 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/model/Event.java +++ b/src/automation/src/main/java/eu/teraflow/automation/context/model/Event.java @@ -1,18 +1,18 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.automation.context.model; diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/EventTypeEnum.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/EventTypeEnum.java index 4c723b29838ef8d4f2bddbfeba8ae4deda67a60a..38c2cd3f08eed5140e20983b5614428b5f6218c0 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/model/EventTypeEnum.java +++ b/src/automation/src/main/java/eu/teraflow/automation/context/model/EventTypeEnum.java @@ -1,18 +1,18 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.automation.context.model; diff --git a/src/automation/src/main/java/eu/teraflow/automation/device/DeviceGateway.java b/src/automation/src/main/java/eu/teraflow/automation/device/DeviceGateway.java index 6a285c14cfc6f55e1809a6523603396701612872..41a7d18f5a858b2d4c04fbaa1ce3577f3966e4b8 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/device/DeviceGateway.java +++ b/src/automation/src/main/java/eu/teraflow/automation/device/DeviceGateway.java @@ -1,18 +1,18 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.automation.device; diff --git a/src/automation/src/main/java/eu/teraflow/automation/device/DeviceGatewayImpl.java b/src/automation/src/main/java/eu/teraflow/automation/device/DeviceGatewayImpl.java index e10bd5ee04c6252d0b5af065ff6f60fcbe9f67e8..00270e478c233bbc2cc8ae7924838c835aac013e 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/device/DeviceGatewayImpl.java +++ b/src/automation/src/main/java/eu/teraflow/automation/device/DeviceGatewayImpl.java @@ -1,22 +1,21 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.automation.device; -import context.ContextOuterClass; import device.DeviceService; import eu.teraflow.automation.Serializer; import eu.teraflow.automation.device.model.Device; @@ -25,11 +24,9 @@ import io.quarkus.grpc.GrpcClient; import io.smallrye.mutiny.Uni; import javax.enterprise.context.ApplicationScoped; import javax.inject.Inject; -import org.jboss.logging.Logger; @ApplicationScoped public class DeviceGatewayImpl implements DeviceGateway { - private static final Logger LOGGER = Logger.getLogger(DeviceGatewayImpl.class); @GrpcClient("device") DeviceService deviceDelegate; diff --git a/src/automation/src/main/java/eu/teraflow/automation/device/DeviceService.java b/src/automation/src/main/java/eu/teraflow/automation/device/DeviceService.java index 1d982bbd5d6e8c01211b4c607232777711e88192..0be0688b50c75184a16766dfc6cda16ad41bf3b6 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/device/DeviceService.java +++ b/src/automation/src/main/java/eu/teraflow/automation/device/DeviceService.java @@ -1,18 +1,18 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.automation.device; diff --git a/src/automation/src/main/java/eu/teraflow/automation/device/DeviceServiceImpl.java b/src/automation/src/main/java/eu/teraflow/automation/device/DeviceServiceImpl.java index 992c9e07a4daa6620ed92d5aacf1edd5c4f5127c..f58c03ee784f215fb7e64ebba2f26a5d8c203f3f 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/device/DeviceServiceImpl.java +++ b/src/automation/src/main/java/eu/teraflow/automation/device/DeviceServiceImpl.java @@ -1,18 +1,18 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.automation.device; diff --git a/src/automation/src/main/java/eu/teraflow/automation/device/model/ConfigActionEnum.java b/src/automation/src/main/java/eu/teraflow/automation/device/model/ConfigActionEnum.java index 103703c22a522035710c4aa214074229d7edb56c..bbe8d5916975d8541000c9df748fe1a79c3037f6 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/device/model/ConfigActionEnum.java +++ b/src/automation/src/main/java/eu/teraflow/automation/device/model/ConfigActionEnum.java @@ -1,18 +1,18 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.automation.device.model; diff --git a/src/automation/src/main/java/eu/teraflow/automation/device/model/ConfigRule.java b/src/automation/src/main/java/eu/teraflow/automation/device/model/ConfigRule.java index b419984b77ea122051fcee3eff9531de484b35aa..d307463d135a95ba65939f6b550bd0f2d9de9dac 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/device/model/ConfigRule.java +++ b/src/automation/src/main/java/eu/teraflow/automation/device/model/ConfigRule.java @@ -1,18 +1,18 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.automation.device.model; diff --git a/src/automation/src/main/java/eu/teraflow/automation/device/model/Device.java b/src/automation/src/main/java/eu/teraflow/automation/device/model/Device.java index 1cd0f9c324f378e2ecc73d5a24ccdaf093b69268..b5dbae62627ca6c9f9dedbeffb6f72fdce0fb74e 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/device/model/Device.java +++ b/src/automation/src/main/java/eu/teraflow/automation/device/model/Device.java @@ -1,18 +1,18 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.automation.device.model; diff --git a/src/automation/src/main/java/eu/teraflow/automation/device/model/DeviceConfig.java b/src/automation/src/main/java/eu/teraflow/automation/device/model/DeviceConfig.java index 68248136a34d4c0a0b6c519c4eeec54596f6c962..6365b0ed9eeb1a5ebb0596c060e32e49d2f14e2f 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/device/model/DeviceConfig.java +++ b/src/automation/src/main/java/eu/teraflow/automation/device/model/DeviceConfig.java @@ -1,18 +1,18 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.automation.device.model; diff --git a/src/automation/src/main/java/eu/teraflow/automation/device/model/DeviceEvent.java b/src/automation/src/main/java/eu/teraflow/automation/device/model/DeviceEvent.java index 6589e224e5dac191435d915b50d410ff40ae1afb..5a021276c751813fa0fc1b0497ce514d5d4d5e72 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/device/model/DeviceEvent.java +++ b/src/automation/src/main/java/eu/teraflow/automation/device/model/DeviceEvent.java @@ -1,18 +1,18 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.automation.device.model; diff --git a/src/automation/src/main/java/eu/teraflow/automation/device/model/DeviceOperationalStatus.java b/src/automation/src/main/java/eu/teraflow/automation/device/model/DeviceOperationalStatus.java index 397c5276c108924c14c58d5213044f264576a9db..163b34704e6629a0df70e4801ad1f4e665bafc19 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/device/model/DeviceOperationalStatus.java +++ b/src/automation/src/main/java/eu/teraflow/automation/device/model/DeviceOperationalStatus.java @@ -1,18 +1,18 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.automation.device.model; diff --git a/src/automation/src/main/java/eu/teraflow/automation/model/DeviceRole.java b/src/automation/src/main/java/eu/teraflow/automation/model/DeviceRole.java index fb538fee298e6cc3ec521f474a14a7252c03bc4f..6dffcd1c0300672a3e23fc0ee8372b77b1bb55b7 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/model/DeviceRole.java +++ b/src/automation/src/main/java/eu/teraflow/automation/model/DeviceRole.java @@ -1,18 +1,18 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.automation.model; diff --git a/src/automation/src/main/java/eu/teraflow/automation/model/DeviceRoleId.java b/src/automation/src/main/java/eu/teraflow/automation/model/DeviceRoleId.java index d0b7e6a2ae1e7795f90ae8fc00c8488dedab7567..b11f42ad054a3446370e123e37c7c13b025711f3 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/model/DeviceRoleId.java +++ b/src/automation/src/main/java/eu/teraflow/automation/model/DeviceRoleId.java @@ -1,18 +1,18 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.automation.model; diff --git a/src/automation/src/main/java/eu/teraflow/automation/model/DeviceRoleType.java b/src/automation/src/main/java/eu/teraflow/automation/model/DeviceRoleType.java index e92c88c4ac3e46eb0e53e5bae0a361299f547992..8d55e0cb4e231fcc5378ee4304fe5b19c525548c 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/model/DeviceRoleType.java +++ b/src/automation/src/main/java/eu/teraflow/automation/model/DeviceRoleType.java @@ -1,18 +1,18 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.automation.model; diff --git a/src/automation/src/main/java/eu/teraflow/automation/model/DeviceState.java b/src/automation/src/main/java/eu/teraflow/automation/model/DeviceState.java index 53a6b2712930f698987ce3c6a60277605fb604a1..48bc37ef7797562c48eed16091ea35cdb06eacd6 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/model/DeviceState.java +++ b/src/automation/src/main/java/eu/teraflow/automation/model/DeviceState.java @@ -1,18 +1,18 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.automation.model; diff --git a/src/automation/src/main/resources/application.yml b/src/automation/src/main/resources/application.yml index 24280803e81ecb90933a7ccd531a754b034cabb7..d61f3daa6542aacfba13ce62e33f1ff3b2c2bb72 100644 --- a/src/automation/src/main/resources/application.yml +++ b/src/automation/src/main/resources/application.yml @@ -19,7 +19,7 @@ quarkus: path: teraflow-automation-banner.txt grpc: server: - port: 9999 + port: 5050 enable-reflection-service: true clients: context: @@ -54,8 +54,8 @@ quarkus: host-port: 8080 container-port: 8080 grpc-server: - host-port: 9999 - container-port: 9999 + host-port: 5050 + container-port: 5050 env: vars: context-service-host: "contextservice" diff --git a/src/automation/src/test/java/eu/teraflow/automation/AutomationFunctionalServiceTest.java b/src/automation/src/test/java/eu/teraflow/automation/AutomationFunctionalServiceTest.java index f584a86ca72885df1249ea6d956384b50e129268..276a74742f80d4fcf54649241f0432635f40ee4a 100644 --- a/src/automation/src/test/java/eu/teraflow/automation/AutomationFunctionalServiceTest.java +++ b/src/automation/src/test/java/eu/teraflow/automation/AutomationFunctionalServiceTest.java @@ -1,18 +1,18 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.automation; @@ -22,8 +22,11 @@ import automation.Automation; import context.ContextOuterClass; import eu.teraflow.automation.context.ContextGateway; import eu.teraflow.automation.device.DeviceGateway; -import eu.teraflow.automation.device.model.*; +import eu.teraflow.automation.device.model.ConfigActionEnum; +import eu.teraflow.automation.device.model.ConfigRule; import eu.teraflow.automation.device.model.Device; +import eu.teraflow.automation.device.model.DeviceConfig; +import eu.teraflow.automation.device.model.DeviceOperationalStatus; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.junit.mockito.InjectMock; import io.smallrye.mutiny.Uni; @@ -37,7 +40,7 @@ import org.junit.jupiter.api.Test; import org.mockito.Mockito; @QuarkusTest -public class AutomationFunctionalServiceTest { +class AutomationFunctionalServiceTest { private static final Logger LOGGER = Logger.getLogger(AutomationFunctionalServiceTest.class); @Inject AutomationService automationService; @@ -97,8 +100,7 @@ public class AutomationFunctionalServiceTest { deviceConfig -> { LOGGER.infof("Received response %s", deviceConfig); - assertThat(deviceConfig.getDeviceOperationalStatus().toString()) - .isEqualTo(device.getDeviceOperationalStatus().toString()); + assertThat(deviceConfig).hasToString(device.getDeviceOperationalStatus().toString()); assertThat(deviceConfig.getDeviceConfig().toString()).isNotNull(); @@ -163,8 +165,7 @@ public class AutomationFunctionalServiceTest { deviceConfig -> { LOGGER.infof("Received response %s", deviceConfig); - assertThat(deviceConfig.getDeviceOperationalStatus().toString()) - .isEqualTo(device.getDeviceOperationalStatus().toString()); + assertThat(deviceConfig).hasToString(device.getDeviceOperationalStatus().toString()); assertThat(deviceConfig.getDeviceConfig().toString()).isNotNull(); diff --git a/src/automation/src/test/java/eu/teraflow/automation/AutomationServiceTest.java b/src/automation/src/test/java/eu/teraflow/automation/AutomationServiceTest.java index 56c2743216d7204da4f4b4bd64b6281accb5e604..b1178e2dd458c64e27bd1b9948f6c04a46a957cf 100644 --- a/src/automation/src/test/java/eu/teraflow/automation/AutomationServiceTest.java +++ b/src/automation/src/test/java/eu/teraflow/automation/AutomationServiceTest.java @@ -1,18 +1,18 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.automation; @@ -20,13 +20,15 @@ import static org.assertj.core.api.Assertions.assertThat; import automation.Automation; import automation.AutomationService; -import context.ContextOuterClass; -import eu.teraflow.automation.model.DeviceRole; -import eu.teraflow.automation.model.DeviceRoleId; import eu.teraflow.automation.context.ContextGateway; import eu.teraflow.automation.device.DeviceGateway; -import eu.teraflow.automation.device.model.*; +import eu.teraflow.automation.device.model.ConfigActionEnum; +import eu.teraflow.automation.device.model.ConfigRule; import eu.teraflow.automation.device.model.Device; +import eu.teraflow.automation.device.model.DeviceConfig; +import eu.teraflow.automation.device.model.DeviceOperationalStatus; +import eu.teraflow.automation.model.DeviceRole; +import eu.teraflow.automation.model.DeviceRoleId; import eu.teraflow.automation.model.DeviceRoleType; import io.quarkus.grpc.GrpcClient; import io.quarkus.test.junit.QuarkusTest; diff --git a/src/automation/src/test/java/eu/teraflow/automation/ContextSubscriberTest.java b/src/automation/src/test/java/eu/teraflow/automation/ContextSubscriberTest.java new file mode 100644 index 0000000000000000000000000000000000000000..6039de58ec8f991f5ccbe0bcfd21871ee1e4c432 --- /dev/null +++ b/src/automation/src/test/java/eu/teraflow/automation/ContextSubscriberTest.java @@ -0,0 +1,199 @@ +package eu.teraflow.automation; + +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; + +import automation.Automation; +import context.ContextOuterClass; +import eu.teraflow.automation.context.ContextGateway; +import eu.teraflow.automation.context.model.Event; +import eu.teraflow.automation.context.model.EventTypeEnum; +import eu.teraflow.automation.device.model.DeviceEvent; +import io.quarkus.runtime.StartupEvent; +import io.quarkus.test.junit.QuarkusTest; +import io.quarkus.test.junit.mockito.InjectMock; +import io.smallrye.mutiny.Multi; +import java.util.UUID; +import javax.inject.Inject; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; + +@QuarkusTest +class ContextSubscriberTest { + + private static final String UUID_FOR_DEVICE_ROLE_ID = + UUID.fromString("0f14d0ab-9608-7862-a9e4-5ed26688389b").toString(); + private static final String UUID_FOR_DEVICE_ID = + UUID.fromString("9f14d0ab-9608-7862-a9e4-5ed26688389c").toString(); + + @Inject ContextSubscriber contextSubscriber; + + @InjectMock ContextGateway contextGateway; + + @InjectMock AutomationService automationService; + + @InjectMock AutomationConfiguration automationConfiguration; + + @Test + void shouldCallAddDeviceUponCreateEvent() { + final var uuidForDeviceRoleId = + ContextOuterClass.Uuid.newBuilder().setUuid(UUID_FOR_DEVICE_ROLE_ID).build(); + + final var uuidForDeviceId = + ContextOuterClass.Uuid.newBuilder().setUuid(UUID_FOR_DEVICE_ID).build(); + + final var outDeviceId = + ContextOuterClass.DeviceId.newBuilder().setDeviceUuid(uuidForDeviceId).build(); + + final var outDeviceRoleId = + Automation.DeviceRoleId.newBuilder() + .setDevRoleId(uuidForDeviceRoleId) + .setDevId(outDeviceId) + .build(); + + String deviceId = outDeviceRoleId.getDevId().toString(); + + Event event = new Event(3.4, EventTypeEnum.CREATE); + DeviceEvent deviceEvent = new DeviceEvent(deviceId, event); + final var deviceEventsMulti = Multi.createFrom().item(deviceEvent); + + Mockito.when(contextGateway.getDeviceEvents()).thenReturn(deviceEventsMulti); + + contextSubscriber.listenForDeviceEvents(); + + verify(automationService, times(1)).addDevice(deviceId); + } + + @Test + void shouldNotCallAddDeviceUponUpdateEvent() { + final var uuidForDeviceRoleId = + ContextOuterClass.Uuid.newBuilder().setUuid(UUID_FOR_DEVICE_ROLE_ID).build(); + + final var uuidForDeviceId = + ContextOuterClass.Uuid.newBuilder().setUuid(UUID_FOR_DEVICE_ID).build(); + + final var outDeviceId = + ContextOuterClass.DeviceId.newBuilder().setDeviceUuid(uuidForDeviceId).build(); + + final var outDeviceRoleId = + Automation.DeviceRoleId.newBuilder() + .setDevRoleId(uuidForDeviceRoleId) + .setDevId(outDeviceId) + .build(); + + String deviceId = outDeviceRoleId.getDevId().toString(); + + Event event = new Event(3.4, EventTypeEnum.UPDATE); + DeviceEvent deviceEvent = new DeviceEvent(deviceId, event); + final var deviceEventsMulti = Multi.createFrom().item(deviceEvent); + + Mockito.when(contextGateway.getDeviceEvents()).thenReturn(deviceEventsMulti); + + contextSubscriber.listenForDeviceEvents(); + + verify(automationService, times(0)).addDevice(deviceId); + } + + @Test + void shouldNotCallAddDeviceUponRemoveEvent() { + final var uuidForDeviceRoleId = + ContextOuterClass.Uuid.newBuilder().setUuid(UUID_FOR_DEVICE_ROLE_ID).build(); + + final var uuidForDeviceId = + ContextOuterClass.Uuid.newBuilder().setUuid(UUID_FOR_DEVICE_ID).build(); + + final var outDeviceId = + ContextOuterClass.DeviceId.newBuilder().setDeviceUuid(uuidForDeviceId).build(); + + final var outDeviceRoleId = + Automation.DeviceRoleId.newBuilder() + .setDevRoleId(uuidForDeviceRoleId) + .setDevId(outDeviceId) + .build(); + + String deviceId = outDeviceRoleId.getDevId().toString(); + + Event event = new Event(3.4, EventTypeEnum.REMOVE); + DeviceEvent deviceEvent = new DeviceEvent(deviceId, event); + final var deviceEventsMulti = Multi.createFrom().item(deviceEvent); + + Mockito.when(contextGateway.getDeviceEvents()).thenReturn(deviceEventsMulti); + + contextSubscriber.listenForDeviceEvents(); + + verify(automationService, times(0)).addDevice(deviceId); + } + + @Test + void shouldNotCallAddDeviceUponNullEvent() { + final var uuidForDeviceRoleId = + ContextOuterClass.Uuid.newBuilder().setUuid(UUID_FOR_DEVICE_ROLE_ID).build(); + + final var uuidForDeviceId = + ContextOuterClass.Uuid.newBuilder().setUuid(UUID_FOR_DEVICE_ID).build(); + + final var outDeviceId = + ContextOuterClass.DeviceId.newBuilder().setDeviceUuid(uuidForDeviceId).build(); + + final var outDeviceRoleId = + Automation.DeviceRoleId.newBuilder() + .setDevRoleId(uuidForDeviceRoleId) + .setDevId(outDeviceId) + .build(); + + String deviceId = outDeviceRoleId.getDevId().toString(); + + DeviceEvent deviceEvent = new DeviceEvent(deviceId, null); + final var deviceEventsMulti = Multi.createFrom().item(deviceEvent); + + Mockito.when(contextGateway.getDeviceEvents()).thenReturn(deviceEventsMulti); + + contextSubscriber.listenForDeviceEvents(); + + verify(automationService, times(0)).addDevice(deviceId); + } + + @Test + void shouldCallListenForDeviceEventsUponStart() { + final var uuidForDeviceRoleId = + ContextOuterClass.Uuid.newBuilder().setUuid(UUID_FOR_DEVICE_ROLE_ID).build(); + + final var uuidForDeviceId = + ContextOuterClass.Uuid.newBuilder().setUuid(UUID_FOR_DEVICE_ID).build(); + + final var outDeviceId = + ContextOuterClass.DeviceId.newBuilder().setDeviceUuid(uuidForDeviceId).build(); + + final var outDeviceRoleId = + Automation.DeviceRoleId.newBuilder() + .setDevRoleId(uuidForDeviceRoleId) + .setDevId(outDeviceId) + .build(); + + String deviceId = outDeviceRoleId.getDevId().toString(); + + Event event = new Event(3.4, EventTypeEnum.CREATE); + DeviceEvent deviceEvent = new DeviceEvent(deviceId, event); + final var deviceEventsMulti = Multi.createFrom().item(deviceEvent); + + Mockito.when(contextGateway.getDeviceEvents()).thenReturn(deviceEventsMulti); + Mockito.when(automationConfiguration.shouldSubscribeToContextComponent()).thenReturn(true); + + StartupEvent y = new StartupEvent(); + contextSubscriber.onStart(y); + + verify(contextGateway, times(1)).getDeviceEvents(); + verify(automationService, times(1)).addDevice(deviceId); + } + + @Test + void shouldNotCallListenForDeviceEventsUponStart() { + final var automationConfiguration = Mockito.mock(AutomationConfiguration.class); + Mockito.when(automationConfiguration.shouldSubscribeToContextComponent()).thenReturn(false); + + StartupEvent y = new StartupEvent(); + contextSubscriber.onStart(y); + + verify(contextGateway, times(0)).getDeviceEvents(); + } +} diff --git a/src/automation/src/test/java/eu/teraflow/automation/MockAutomationConfiguration.java b/src/automation/src/test/java/eu/teraflow/automation/MockAutomationConfiguration.java new file mode 100644 index 0000000000000000000000000000000000000000..24c0433e0ed5fb5e3d20ff762f640406d8bf9f1b --- /dev/null +++ b/src/automation/src/test/java/eu/teraflow/automation/MockAutomationConfiguration.java @@ -0,0 +1,18 @@ +package eu.teraflow.automation; + +import io.smallrye.config.SmallRyeConfig; +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; +import javax.ws.rs.Produces; +import org.eclipse.microprofile.config.Config; + +public class MockAutomationConfiguration { + @Inject Config config; + + @Produces + @ApplicationScoped + @io.quarkus.test.Mock + AutomationConfiguration automationConfiguration() { + return config.unwrap(SmallRyeConfig.class).getConfigMapping(AutomationConfiguration.class); + } +} diff --git a/src/automation/src/test/java/eu/teraflow/automation/SerializerTest.java b/src/automation/src/test/java/eu/teraflow/automation/SerializerTest.java index 4d4a57da7286997c1194ccc5d711ab9999d39567..ff74148548e4f0b024a8a6835ee63a2e77d66a55 100644 --- a/src/automation/src/test/java/eu/teraflow/automation/SerializerTest.java +++ b/src/automation/src/test/java/eu/teraflow/automation/SerializerTest.java @@ -1,18 +1,18 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.automation; @@ -53,7 +53,8 @@ class SerializerTest { final var expectedDeviceId = "expectedDeviceId"; final var deviceIdUuid = serializer.serializeUuid(expectedDeviceId); - final var deviceId = ContextOuterClass.DeviceId.newBuilder().setDeviceUuid(deviceIdUuid).build(); + final var deviceId = + ContextOuterClass.DeviceId.newBuilder().setDeviceUuid(deviceIdUuid).build(); final var serializedDeviceId = serializer.serializeDeviceId(expectedDeviceId); @@ -65,7 +66,8 @@ class SerializerTest { final var expectedDeviceId = "expectedDeviceId"; final var serializedDeviceIdUuid = serializer.serializeUuid("expectedDeviceId"); - final var serializedDeviceId = DeviceId.newBuilder().setDeviceUuid(serializedDeviceIdUuid).build(); + final var serializedDeviceId = + DeviceId.newBuilder().setDeviceUuid(serializedDeviceIdUuid).build(); final var deviceId = serializer.deserialize(serializedDeviceId); @@ -80,7 +82,10 @@ class SerializerTest { final var deviceRoleId = new DeviceRoleId(expectedDevRoleId, expectedDeviceId); final var serializedDeviceRoleIdUuid = serializer.serializeUuid(expectedDevRoleId); final var serializedDeviceRoleDeviceIdUuid = serializer.serializeUuid(expectedDeviceId); - final var serializedDeviceRoleDeviceId = ContextOuterClass.DeviceId.newBuilder().setDeviceUuid(serializedDeviceRoleDeviceIdUuid).build(); + final var serializedDeviceRoleDeviceId = + ContextOuterClass.DeviceId.newBuilder() + .setDeviceUuid(serializedDeviceRoleDeviceIdUuid) + .build(); final var expectedDeviceRoleId = Automation.DeviceRoleId.newBuilder() @@ -88,8 +93,7 @@ class SerializerTest { .setDevId(serializedDeviceRoleDeviceId) .build(); - final var serializedDevRoleId = - serializer.serialize(deviceRoleId); + final var serializedDevRoleId = serializer.serialize(deviceRoleId); assertThat(serializedDevRoleId).usingRecursiveComparison().isEqualTo(expectedDeviceRoleId); } @@ -142,19 +146,21 @@ class SerializerTest { final var serializedDeviceRoleDevRoleIdUuid = serializer.serializeUuid(expectedDevRoleId); final var serializedDeviceRoleDeviceId = serializer.serializeDeviceId(expectedDeviceId); - final var expectedDeviceRoleId = Automation.DeviceRoleId.newBuilder() - .setDevRoleId(serializedDeviceRoleDevRoleIdUuid) - .setDevId(serializedDeviceRoleDeviceId) - .build(); + final var expectedDeviceRoleId = + Automation.DeviceRoleId.newBuilder() + .setDevRoleId(serializedDeviceRoleDevRoleIdUuid) + .setDevId(serializedDeviceRoleDeviceId) + .build(); final var expectedDeviceRoleType = Automation.DeviceRoleType.PIPELINE_CONF; - final var expectedDeviceRole = Automation.DeviceRole.newBuilder() - .setDevRoleId(expectedDeviceRoleId) - .setDevRoleType(expectedDeviceRoleType) - .build(); + final var expectedDeviceRole = + Automation.DeviceRole.newBuilder() + .setDevRoleId(expectedDeviceRoleId) + .setDevRoleType(expectedDeviceRoleType) + .build(); - final var deviceRoleId = new DeviceRoleId(expectedDevRoleId,expectedDeviceId); + final var deviceRoleId = new DeviceRoleId(expectedDevRoleId, expectedDeviceId); final var deviceRoleType = DeviceRoleType.PIPELINE_CONF; final var deviceRole = new DeviceRole(deviceRoleId, deviceRoleType); diff --git a/src/automation/target/generated-sources/grpc/context/ContextOuterClass.java b/src/automation/target/generated-sources/grpc/context/ContextOuterClass.java index 168ddf78b3a0233f3157e984fb7d925783bcd3b0..ee807d7a7c69256b7a4c99c5139fafe076898918 100644 --- a/src/automation/target/generated-sources/grpc/context/ContextOuterClass.java +++ b/src/automation/target/generated-sources/grpc/context/ContextOuterClass.java @@ -661,6 +661,141 @@ public final class ContextOuterClass { // @@protoc_insertion_point(enum_scope:context.ServiceStatusEnum) } + /** + * Protobuf enum {@code context.SliceStatusEnum} + */ + public enum SliceStatusEnum + implements com.google.protobuf.ProtocolMessageEnum { + /** + * <code>SLICESTATUS_UNDEFINED = 0;</code> + */ + SLICESTATUS_UNDEFINED(0), + /** + * <code>SLICESTATUS_PLANNED = 1;</code> + */ + SLICESTATUS_PLANNED(1), + /** + * <code>SLICESTATUS_INIT = 2;</code> + */ + SLICESTATUS_INIT(2), + /** + * <code>SLICESTATUS_ACTIVE = 3;</code> + */ + SLICESTATUS_ACTIVE(3), + /** + * <code>SLICESTATUS_DEINIT = 4;</code> + */ + SLICESTATUS_DEINIT(4), + UNRECOGNIZED(-1), + ; + + /** + * <code>SLICESTATUS_UNDEFINED = 0;</code> + */ + public static final int SLICESTATUS_UNDEFINED_VALUE = 0; + /** + * <code>SLICESTATUS_PLANNED = 1;</code> + */ + public static final int SLICESTATUS_PLANNED_VALUE = 1; + /** + * <code>SLICESTATUS_INIT = 2;</code> + */ + public static final int SLICESTATUS_INIT_VALUE = 2; + /** + * <code>SLICESTATUS_ACTIVE = 3;</code> + */ + public static final int SLICESTATUS_ACTIVE_VALUE = 3; + /** + * <code>SLICESTATUS_DEINIT = 4;</code> + */ + public static final int SLICESTATUS_DEINIT_VALUE = 4; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SliceStatusEnum valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static SliceStatusEnum forNumber(int value) { + switch (value) { + case 0: return SLICESTATUS_UNDEFINED; + case 1: return SLICESTATUS_PLANNED; + case 2: return SLICESTATUS_INIT; + case 3: return SLICESTATUS_ACTIVE; + case 4: return SLICESTATUS_DEINIT; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap<SliceStatusEnum> + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + SliceStatusEnum> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap<SliceStatusEnum>() { + public SliceStatusEnum findValueByNumber(int number) { + return SliceStatusEnum.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return context.ContextOuterClass.getDescriptor().getEnumTypes().get(5); + } + + private static final SliceStatusEnum[] VALUES = values(); + + public static SliceStatusEnum valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private SliceStatusEnum(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:context.SliceStatusEnum) + } + /** * <pre> * ----- Configuration ------------------------------------------------------------------------------------------------- @@ -756,7 +891,7 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return context.ContextOuterClass.getDescriptor().getEnumTypes().get(5); + return context.ContextOuterClass.getDescriptor().getEnumTypes().get(6); } private static final ConfigActionEnum[] VALUES = values(); @@ -27653,49 +27788,64 @@ public final class ContextOuterClass { } - public interface ConnectionIdOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.ConnectionId) + public interface SliceIdOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.SliceId) com.google.protobuf.MessageOrBuilder { /** - * <code>.context.Uuid connection_uuid = 1;</code> - * @return Whether the connectionUuid field is set. + * <code>.context.ContextId context_id = 1;</code> + * @return Whether the contextId field is set. */ - boolean hasConnectionUuid(); + boolean hasContextId(); /** - * <code>.context.Uuid connection_uuid = 1;</code> - * @return The connectionUuid. + * <code>.context.ContextId context_id = 1;</code> + * @return The contextId. */ - context.ContextOuterClass.Uuid getConnectionUuid(); + context.ContextOuterClass.ContextId getContextId(); /** - * <code>.context.Uuid connection_uuid = 1;</code> + * <code>.context.ContextId context_id = 1;</code> */ - context.ContextOuterClass.UuidOrBuilder getConnectionUuidOrBuilder(); + context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder(); + + /** + * <code>.context.Uuid slice_uuid = 2;</code> + * @return Whether the sliceUuid field is set. + */ + boolean hasSliceUuid(); + /** + * <code>.context.Uuid slice_uuid = 2;</code> + * @return The sliceUuid. + */ + context.ContextOuterClass.Uuid getSliceUuid(); + /** + * <code>.context.Uuid slice_uuid = 2;</code> + */ + context.ContextOuterClass.UuidOrBuilder getSliceUuidOrBuilder(); } /** * <pre> - * ----- Connection ---------------------------------------------------------------------------------------------------- + * ----- Slice --------------------------------------------------------------------------------------------------------- * </pre> * - * Protobuf type {@code context.ConnectionId} + * Protobuf type {@code context.SliceId} */ - public static final class ConnectionId extends + public static final class SliceId extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.ConnectionId) - ConnectionIdOrBuilder { + // @@protoc_insertion_point(message_implements:context.SliceId) + SliceIdOrBuilder { private static final long serialVersionUID = 0L; - // Use ConnectionId.newBuilder() to construct. - private ConnectionId(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + // Use SliceId.newBuilder() to construct. + private SliceId(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } - private ConnectionId() { + private SliceId() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new ConnectionId(); + return new SliceId(); } @java.lang.Override @@ -27703,7 +27853,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private ConnectionId( + private SliceId( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -27722,14 +27872,27 @@ public final class ContextOuterClass { done = true; break; case 10: { + context.ContextOuterClass.ContextId.Builder subBuilder = null; + if (contextId_ != null) { + subBuilder = contextId_.toBuilder(); + } + contextId_ = input.readMessage(context.ContextOuterClass.ContextId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(contextId_); + contextId_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { context.ContextOuterClass.Uuid.Builder subBuilder = null; - if (connectionUuid_ != null) { - subBuilder = connectionUuid_.toBuilder(); + if (sliceUuid_ != null) { + subBuilder = sliceUuid_.toBuilder(); } - connectionUuid_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); + sliceUuid_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); if (subBuilder != null) { - subBuilder.mergeFrom(connectionUuid_); - connectionUuid_ = subBuilder.buildPartial(); + subBuilder.mergeFrom(sliceUuid_); + sliceUuid_ = subBuilder.buildPartial(); } break; @@ -27755,41 +27918,67 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ConnectionId_descriptor; + return context.ContextOuterClass.internal_static_context_SliceId_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ConnectionId_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_SliceId_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ConnectionId.class, context.ContextOuterClass.ConnectionId.Builder.class); + context.ContextOuterClass.SliceId.class, context.ContextOuterClass.SliceId.Builder.class); } - public static final int CONNECTION_UUID_FIELD_NUMBER = 1; - private context.ContextOuterClass.Uuid connectionUuid_; + public static final int CONTEXT_ID_FIELD_NUMBER = 1; + private context.ContextOuterClass.ContextId contextId_; /** - * <code>.context.Uuid connection_uuid = 1;</code> - * @return Whether the connectionUuid field is set. + * <code>.context.ContextId context_id = 1;</code> + * @return Whether the contextId field is set. */ @java.lang.Override - public boolean hasConnectionUuid() { - return connectionUuid_ != null; + public boolean hasContextId() { + return contextId_ != null; } /** - * <code>.context.Uuid connection_uuid = 1;</code> - * @return The connectionUuid. + * <code>.context.ContextId context_id = 1;</code> + * @return The contextId. */ @java.lang.Override - public context.ContextOuterClass.Uuid getConnectionUuid() { - return connectionUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : connectionUuid_; + public context.ContextOuterClass.ContextId getContextId() { + return contextId_ == null ? context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; } /** - * <code>.context.Uuid connection_uuid = 1;</code> + * <code>.context.ContextId context_id = 1;</code> */ @java.lang.Override - public context.ContextOuterClass.UuidOrBuilder getConnectionUuidOrBuilder() { - return getConnectionUuid(); + public context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder() { + return getContextId(); + } + + public static final int SLICE_UUID_FIELD_NUMBER = 2; + private context.ContextOuterClass.Uuid sliceUuid_; + /** + * <code>.context.Uuid slice_uuid = 2;</code> + * @return Whether the sliceUuid field is set. + */ + @java.lang.Override + public boolean hasSliceUuid() { + return sliceUuid_ != null; + } + /** + * <code>.context.Uuid slice_uuid = 2;</code> + * @return The sliceUuid. + */ + @java.lang.Override + public context.ContextOuterClass.Uuid getSliceUuid() { + return sliceUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : sliceUuid_; + } + /** + * <code>.context.Uuid slice_uuid = 2;</code> + */ + @java.lang.Override + public context.ContextOuterClass.UuidOrBuilder getSliceUuidOrBuilder() { + return getSliceUuid(); } private byte memoizedIsInitialized = -1; @@ -27806,8 +27995,11 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (connectionUuid_ != null) { - output.writeMessage(1, getConnectionUuid()); + if (contextId_ != null) { + output.writeMessage(1, getContextId()); + } + if (sliceUuid_ != null) { + output.writeMessage(2, getSliceUuid()); } unknownFields.writeTo(output); } @@ -27818,9 +28010,13 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - if (connectionUuid_ != null) { + if (contextId_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getConnectionUuid()); + .computeMessageSize(1, getContextId()); + } + if (sliceUuid_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getSliceUuid()); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -27832,15 +28028,20 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.ConnectionId)) { + if (!(obj instanceof context.ContextOuterClass.SliceId)) { return super.equals(obj); } - context.ContextOuterClass.ConnectionId other = (context.ContextOuterClass.ConnectionId) obj; + context.ContextOuterClass.SliceId other = (context.ContextOuterClass.SliceId) obj; - if (hasConnectionUuid() != other.hasConnectionUuid()) return false; - if (hasConnectionUuid()) { - if (!getConnectionUuid() - .equals(other.getConnectionUuid())) return false; + if (hasContextId() != other.hasContextId()) return false; + if (hasContextId()) { + if (!getContextId() + .equals(other.getContextId())) return false; + } + if (hasSliceUuid() != other.hasSliceUuid()) return false; + if (hasSliceUuid()) { + if (!getSliceUuid() + .equals(other.getSliceUuid())) return false; } if (!unknownFields.equals(other.unknownFields)) return false; return true; @@ -27853,78 +28054,82 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasConnectionUuid()) { - hash = (37 * hash) + CONNECTION_UUID_FIELD_NUMBER; - hash = (53 * hash) + getConnectionUuid().hashCode(); + if (hasContextId()) { + hash = (37 * hash) + CONTEXT_ID_FIELD_NUMBER; + hash = (53 * hash) + getContextId().hashCode(); + } + if (hasSliceUuid()) { + hash = (37 * hash) + SLICE_UUID_FIELD_NUMBER; + hash = (53 * hash) + getSliceUuid().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.ConnectionId parseFrom( + public static context.ContextOuterClass.SliceId parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ConnectionId parseFrom( + public static context.ContextOuterClass.SliceId parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ConnectionId parseFrom( + public static context.ContextOuterClass.SliceId parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ConnectionId parseFrom( + public static context.ContextOuterClass.SliceId parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ConnectionId parseFrom(byte[] data) + public static context.ContextOuterClass.SliceId parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ConnectionId parseFrom( + public static context.ContextOuterClass.SliceId parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ConnectionId parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.SliceId parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ConnectionId parseFrom( + public static context.ContextOuterClass.SliceId parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } - public static context.ContextOuterClass.ConnectionId parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.SliceId parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.ConnectionId parseDelimitedFrom( + public static context.ContextOuterClass.SliceId parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static context.ContextOuterClass.ConnectionId parseFrom( + public static context.ContextOuterClass.SliceId parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ConnectionId parseFrom( + public static context.ContextOuterClass.SliceId parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -27937,7 +28142,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.ConnectionId prototype) { + public static Builder newBuilder(context.ContextOuterClass.SliceId prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -27954,29 +28159,29 @@ public final class ContextOuterClass { } /** * <pre> - * ----- Connection ---------------------------------------------------------------------------------------------------- + * ----- Slice --------------------------------------------------------------------------------------------------------- * </pre> * - * Protobuf type {@code context.ConnectionId} + * Protobuf type {@code context.SliceId} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements - // @@protoc_insertion_point(builder_implements:context.ConnectionId) - context.ContextOuterClass.ConnectionIdOrBuilder { + // @@protoc_insertion_point(builder_implements:context.SliceId) + context.ContextOuterClass.SliceIdOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ConnectionId_descriptor; + return context.ContextOuterClass.internal_static_context_SliceId_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ConnectionId_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_SliceId_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ConnectionId.class, context.ContextOuterClass.ConnectionId.Builder.class); + context.ContextOuterClass.SliceId.class, context.ContextOuterClass.SliceId.Builder.class); } - // Construct using context.ContextOuterClass.ConnectionId.newBuilder() + // Construct using context.ContextOuterClass.SliceId.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -27994,11 +28199,17 @@ public final class ContextOuterClass { @java.lang.Override public Builder clear() { super.clear(); - if (connectionUuidBuilder_ == null) { - connectionUuid_ = null; + if (contextIdBuilder_ == null) { + contextId_ = null; } else { - connectionUuid_ = null; - connectionUuidBuilder_ = null; + contextId_ = null; + contextIdBuilder_ = null; + } + if (sliceUuidBuilder_ == null) { + sliceUuid_ = null; + } else { + sliceUuid_ = null; + sliceUuidBuilder_ = null; } return this; } @@ -28006,17 +28217,17 @@ public final class ContextOuterClass { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_ConnectionId_descriptor; + return context.ContextOuterClass.internal_static_context_SliceId_descriptor; } @java.lang.Override - public context.ContextOuterClass.ConnectionId getDefaultInstanceForType() { - return context.ContextOuterClass.ConnectionId.getDefaultInstance(); + public context.ContextOuterClass.SliceId getDefaultInstanceForType() { + return context.ContextOuterClass.SliceId.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.ConnectionId build() { - context.ContextOuterClass.ConnectionId result = buildPartial(); + public context.ContextOuterClass.SliceId build() { + context.ContextOuterClass.SliceId result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -28024,12 +28235,6018 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.ConnectionId buildPartial() { - context.ContextOuterClass.ConnectionId result = new context.ContextOuterClass.ConnectionId(this); - if (connectionUuidBuilder_ == null) { - result.connectionUuid_ = connectionUuid_; + public context.ContextOuterClass.SliceId buildPartial() { + context.ContextOuterClass.SliceId result = new context.ContextOuterClass.SliceId(this); + if (contextIdBuilder_ == null) { + result.contextId_ = contextId_; } else { - result.connectionUuid_ = connectionUuidBuilder_.build(); + result.contextId_ = contextIdBuilder_.build(); + } + if (sliceUuidBuilder_ == null) { + result.sliceUuid_ = sliceUuid_; + } else { + result.sliceUuid_ = sliceUuidBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof context.ContextOuterClass.SliceId) { + return mergeFrom((context.ContextOuterClass.SliceId)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.SliceId other) { + if (other == context.ContextOuterClass.SliceId.getDefaultInstance()) return this; + if (other.hasContextId()) { + mergeContextId(other.getContextId()); + } + if (other.hasSliceUuid()) { + mergeSliceUuid(other.getSliceUuid()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + context.ContextOuterClass.SliceId parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.SliceId) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private context.ContextOuterClass.ContextId contextId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> contextIdBuilder_; + /** + * <code>.context.ContextId context_id = 1;</code> + * @return Whether the contextId field is set. + */ + public boolean hasContextId() { + return contextIdBuilder_ != null || contextId_ != null; + } + /** + * <code>.context.ContextId context_id = 1;</code> + * @return The contextId. + */ + public context.ContextOuterClass.ContextId getContextId() { + if (contextIdBuilder_ == null) { + return contextId_ == null ? context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + } else { + return contextIdBuilder_.getMessage(); + } + } + /** + * <code>.context.ContextId context_id = 1;</code> + */ + public Builder setContextId(context.ContextOuterClass.ContextId value) { + if (contextIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + contextId_ = value; + onChanged(); + } else { + contextIdBuilder_.setMessage(value); + } + + return this; + } + /** + * <code>.context.ContextId context_id = 1;</code> + */ + public Builder setContextId( + context.ContextOuterClass.ContextId.Builder builderForValue) { + if (contextIdBuilder_ == null) { + contextId_ = builderForValue.build(); + onChanged(); + } else { + contextIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * <code>.context.ContextId context_id = 1;</code> + */ + public Builder mergeContextId(context.ContextOuterClass.ContextId value) { + if (contextIdBuilder_ == null) { + if (contextId_ != null) { + contextId_ = + context.ContextOuterClass.ContextId.newBuilder(contextId_).mergeFrom(value).buildPartial(); + } else { + contextId_ = value; + } + onChanged(); + } else { + contextIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * <code>.context.ContextId context_id = 1;</code> + */ + public Builder clearContextId() { + if (contextIdBuilder_ == null) { + contextId_ = null; + onChanged(); + } else { + contextId_ = null; + contextIdBuilder_ = null; + } + + return this; + } + /** + * <code>.context.ContextId context_id = 1;</code> + */ + public context.ContextOuterClass.ContextId.Builder getContextIdBuilder() { + + onChanged(); + return getContextIdFieldBuilder().getBuilder(); + } + /** + * <code>.context.ContextId context_id = 1;</code> + */ + public context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder() { + if (contextIdBuilder_ != null) { + return contextIdBuilder_.getMessageOrBuilder(); + } else { + return contextId_ == null ? + context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + } + } + /** + * <code>.context.ContextId context_id = 1;</code> + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> + getContextIdFieldBuilder() { + if (contextIdBuilder_ == null) { + contextIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder>( + getContextId(), + getParentForChildren(), + isClean()); + contextId_ = null; + } + return contextIdBuilder_; + } + + private context.ContextOuterClass.Uuid sliceUuid_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> sliceUuidBuilder_; + /** + * <code>.context.Uuid slice_uuid = 2;</code> + * @return Whether the sliceUuid field is set. + */ + public boolean hasSliceUuid() { + return sliceUuidBuilder_ != null || sliceUuid_ != null; + } + /** + * <code>.context.Uuid slice_uuid = 2;</code> + * @return The sliceUuid. + */ + public context.ContextOuterClass.Uuid getSliceUuid() { + if (sliceUuidBuilder_ == null) { + return sliceUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : sliceUuid_; + } else { + return sliceUuidBuilder_.getMessage(); + } + } + /** + * <code>.context.Uuid slice_uuid = 2;</code> + */ + public Builder setSliceUuid(context.ContextOuterClass.Uuid value) { + if (sliceUuidBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sliceUuid_ = value; + onChanged(); + } else { + sliceUuidBuilder_.setMessage(value); + } + + return this; + } + /** + * <code>.context.Uuid slice_uuid = 2;</code> + */ + public Builder setSliceUuid( + context.ContextOuterClass.Uuid.Builder builderForValue) { + if (sliceUuidBuilder_ == null) { + sliceUuid_ = builderForValue.build(); + onChanged(); + } else { + sliceUuidBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * <code>.context.Uuid slice_uuid = 2;</code> + */ + public Builder mergeSliceUuid(context.ContextOuterClass.Uuid value) { + if (sliceUuidBuilder_ == null) { + if (sliceUuid_ != null) { + sliceUuid_ = + context.ContextOuterClass.Uuid.newBuilder(sliceUuid_).mergeFrom(value).buildPartial(); + } else { + sliceUuid_ = value; + } + onChanged(); + } else { + sliceUuidBuilder_.mergeFrom(value); + } + + return this; + } + /** + * <code>.context.Uuid slice_uuid = 2;</code> + */ + public Builder clearSliceUuid() { + if (sliceUuidBuilder_ == null) { + sliceUuid_ = null; + onChanged(); + } else { + sliceUuid_ = null; + sliceUuidBuilder_ = null; + } + + return this; + } + /** + * <code>.context.Uuid slice_uuid = 2;</code> + */ + public context.ContextOuterClass.Uuid.Builder getSliceUuidBuilder() { + + onChanged(); + return getSliceUuidFieldBuilder().getBuilder(); + } + /** + * <code>.context.Uuid slice_uuid = 2;</code> + */ + public context.ContextOuterClass.UuidOrBuilder getSliceUuidOrBuilder() { + if (sliceUuidBuilder_ != null) { + return sliceUuidBuilder_.getMessageOrBuilder(); + } else { + return sliceUuid_ == null ? + context.ContextOuterClass.Uuid.getDefaultInstance() : sliceUuid_; + } + } + /** + * <code>.context.Uuid slice_uuid = 2;</code> + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> + getSliceUuidFieldBuilder() { + if (sliceUuidBuilder_ == null) { + sliceUuidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( + getSliceUuid(), + getParentForChildren(), + isClean()); + sliceUuid_ = null; + } + return sliceUuidBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:context.SliceId) + } + + // @@protoc_insertion_point(class_scope:context.SliceId) + private static final context.ContextOuterClass.SliceId DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.SliceId(); + } + + public static context.ContextOuterClass.SliceId getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<SliceId> + PARSER = new com.google.protobuf.AbstractParser<SliceId>() { + @java.lang.Override + public SliceId parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SliceId(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<SliceId> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<SliceId> getParserForType() { + return PARSER; + } + + @java.lang.Override + public context.ContextOuterClass.SliceId getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SliceOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.Slice) + com.google.protobuf.MessageOrBuilder { + + /** + * <code>.context.SliceId slice_id = 1;</code> + * @return Whether the sliceId field is set. + */ + boolean hasSliceId(); + /** + * <code>.context.SliceId slice_id = 1;</code> + * @return The sliceId. + */ + context.ContextOuterClass.SliceId getSliceId(); + /** + * <code>.context.SliceId slice_id = 1;</code> + */ + context.ContextOuterClass.SliceIdOrBuilder getSliceIdOrBuilder(); + + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + java.util.List<context.ContextOuterClass.EndPointId> + getSliceEndpointIdsList(); + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + context.ContextOuterClass.EndPointId getSliceEndpointIds(int index); + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + int getSliceEndpointIdsCount(); + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + java.util.List<? extends context.ContextOuterClass.EndPointIdOrBuilder> + getSliceEndpointIdsOrBuilderList(); + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + context.ContextOuterClass.EndPointIdOrBuilder getSliceEndpointIdsOrBuilder( + int index); + + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + java.util.List<context.ContextOuterClass.Constraint> + getSliceConstraintsList(); + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + context.ContextOuterClass.Constraint getSliceConstraints(int index); + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + int getSliceConstraintsCount(); + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + java.util.List<? extends context.ContextOuterClass.ConstraintOrBuilder> + getSliceConstraintsOrBuilderList(); + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + context.ContextOuterClass.ConstraintOrBuilder getSliceConstraintsOrBuilder( + int index); + + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + java.util.List<context.ContextOuterClass.ServiceId> + getSliceServiceIdsList(); + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + context.ContextOuterClass.ServiceId getSliceServiceIds(int index); + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + int getSliceServiceIdsCount(); + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + java.util.List<? extends context.ContextOuterClass.ServiceIdOrBuilder> + getSliceServiceIdsOrBuilderList(); + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + context.ContextOuterClass.ServiceIdOrBuilder getSliceServiceIdsOrBuilder( + int index); + + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + java.util.List<context.ContextOuterClass.SliceId> + getSliceSubsliceIdsList(); + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + context.ContextOuterClass.SliceId getSliceSubsliceIds(int index); + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + int getSliceSubsliceIdsCount(); + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + java.util.List<? extends context.ContextOuterClass.SliceIdOrBuilder> + getSliceSubsliceIdsOrBuilderList(); + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + context.ContextOuterClass.SliceIdOrBuilder getSliceSubsliceIdsOrBuilder( + int index); + + /** + * <code>.context.SliceStatus slice_status = 6;</code> + * @return Whether the sliceStatus field is set. + */ + boolean hasSliceStatus(); + /** + * <code>.context.SliceStatus slice_status = 6;</code> + * @return The sliceStatus. + */ + context.ContextOuterClass.SliceStatus getSliceStatus(); + /** + * <code>.context.SliceStatus slice_status = 6;</code> + */ + context.ContextOuterClass.SliceStatusOrBuilder getSliceStatusOrBuilder(); + } + /** + * Protobuf type {@code context.Slice} + */ + public static final class Slice extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.Slice) + SliceOrBuilder { + private static final long serialVersionUID = 0L; + // Use Slice.newBuilder() to construct. + private Slice(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private Slice() { + sliceEndpointIds_ = java.util.Collections.emptyList(); + sliceConstraints_ = java.util.Collections.emptyList(); + sliceServiceIds_ = java.util.Collections.emptyList(); + sliceSubsliceIds_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Slice(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Slice( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + context.ContextOuterClass.SliceId.Builder subBuilder = null; + if (sliceId_ != null) { + subBuilder = sliceId_.toBuilder(); + } + sliceId_ = input.readMessage(context.ContextOuterClass.SliceId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(sliceId_); + sliceId_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + sliceEndpointIds_ = new java.util.ArrayList<context.ContextOuterClass.EndPointId>(); + mutable_bitField0_ |= 0x00000001; + } + sliceEndpointIds_.add( + input.readMessage(context.ContextOuterClass.EndPointId.parser(), extensionRegistry)); + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + sliceConstraints_ = new java.util.ArrayList<context.ContextOuterClass.Constraint>(); + mutable_bitField0_ |= 0x00000002; + } + sliceConstraints_.add( + input.readMessage(context.ContextOuterClass.Constraint.parser(), extensionRegistry)); + break; + } + case 34: { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + sliceServiceIds_ = new java.util.ArrayList<context.ContextOuterClass.ServiceId>(); + mutable_bitField0_ |= 0x00000004; + } + sliceServiceIds_.add( + input.readMessage(context.ContextOuterClass.ServiceId.parser(), extensionRegistry)); + break; + } + case 42: { + if (!((mutable_bitField0_ & 0x00000008) != 0)) { + sliceSubsliceIds_ = new java.util.ArrayList<context.ContextOuterClass.SliceId>(); + mutable_bitField0_ |= 0x00000008; + } + sliceSubsliceIds_.add( + input.readMessage(context.ContextOuterClass.SliceId.parser(), extensionRegistry)); + break; + } + case 50: { + context.ContextOuterClass.SliceStatus.Builder subBuilder = null; + if (sliceStatus_ != null) { + subBuilder = sliceStatus_.toBuilder(); + } + sliceStatus_ = input.readMessage(context.ContextOuterClass.SliceStatus.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(sliceStatus_); + sliceStatus_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + sliceEndpointIds_ = java.util.Collections.unmodifiableList(sliceEndpointIds_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + sliceConstraints_ = java.util.Collections.unmodifiableList(sliceConstraints_); + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + sliceServiceIds_ = java.util.Collections.unmodifiableList(sliceServiceIds_); + } + if (((mutable_bitField0_ & 0x00000008) != 0)) { + sliceSubsliceIds_ = java.util.Collections.unmodifiableList(sliceSubsliceIds_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_Slice_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_Slice_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.Slice.class, context.ContextOuterClass.Slice.Builder.class); + } + + public static final int SLICE_ID_FIELD_NUMBER = 1; + private context.ContextOuterClass.SliceId sliceId_; + /** + * <code>.context.SliceId slice_id = 1;</code> + * @return Whether the sliceId field is set. + */ + @java.lang.Override + public boolean hasSliceId() { + return sliceId_ != null; + } + /** + * <code>.context.SliceId slice_id = 1;</code> + * @return The sliceId. + */ + @java.lang.Override + public context.ContextOuterClass.SliceId getSliceId() { + return sliceId_ == null ? context.ContextOuterClass.SliceId.getDefaultInstance() : sliceId_; + } + /** + * <code>.context.SliceId slice_id = 1;</code> + */ + @java.lang.Override + public context.ContextOuterClass.SliceIdOrBuilder getSliceIdOrBuilder() { + return getSliceId(); + } + + public static final int SLICE_ENDPOINT_IDS_FIELD_NUMBER = 2; + private java.util.List<context.ContextOuterClass.EndPointId> sliceEndpointIds_; + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + @java.lang.Override + public java.util.List<context.ContextOuterClass.EndPointId> getSliceEndpointIdsList() { + return sliceEndpointIds_; + } + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + @java.lang.Override + public java.util.List<? extends context.ContextOuterClass.EndPointIdOrBuilder> + getSliceEndpointIdsOrBuilderList() { + return sliceEndpointIds_; + } + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + @java.lang.Override + public int getSliceEndpointIdsCount() { + return sliceEndpointIds_.size(); + } + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + @java.lang.Override + public context.ContextOuterClass.EndPointId getSliceEndpointIds(int index) { + return sliceEndpointIds_.get(index); + } + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + @java.lang.Override + public context.ContextOuterClass.EndPointIdOrBuilder getSliceEndpointIdsOrBuilder( + int index) { + return sliceEndpointIds_.get(index); + } + + public static final int SLICE_CONSTRAINTS_FIELD_NUMBER = 3; + private java.util.List<context.ContextOuterClass.Constraint> sliceConstraints_; + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + @java.lang.Override + public java.util.List<context.ContextOuterClass.Constraint> getSliceConstraintsList() { + return sliceConstraints_; + } + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + @java.lang.Override + public java.util.List<? extends context.ContextOuterClass.ConstraintOrBuilder> + getSliceConstraintsOrBuilderList() { + return sliceConstraints_; + } + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + @java.lang.Override + public int getSliceConstraintsCount() { + return sliceConstraints_.size(); + } + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + @java.lang.Override + public context.ContextOuterClass.Constraint getSliceConstraints(int index) { + return sliceConstraints_.get(index); + } + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + @java.lang.Override + public context.ContextOuterClass.ConstraintOrBuilder getSliceConstraintsOrBuilder( + int index) { + return sliceConstraints_.get(index); + } + + public static final int SLICE_SERVICE_IDS_FIELD_NUMBER = 4; + private java.util.List<context.ContextOuterClass.ServiceId> sliceServiceIds_; + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + @java.lang.Override + public java.util.List<context.ContextOuterClass.ServiceId> getSliceServiceIdsList() { + return sliceServiceIds_; + } + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + @java.lang.Override + public java.util.List<? extends context.ContextOuterClass.ServiceIdOrBuilder> + getSliceServiceIdsOrBuilderList() { + return sliceServiceIds_; + } + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + @java.lang.Override + public int getSliceServiceIdsCount() { + return sliceServiceIds_.size(); + } + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + @java.lang.Override + public context.ContextOuterClass.ServiceId getSliceServiceIds(int index) { + return sliceServiceIds_.get(index); + } + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + @java.lang.Override + public context.ContextOuterClass.ServiceIdOrBuilder getSliceServiceIdsOrBuilder( + int index) { + return sliceServiceIds_.get(index); + } + + public static final int SLICE_SUBSLICE_IDS_FIELD_NUMBER = 5; + private java.util.List<context.ContextOuterClass.SliceId> sliceSubsliceIds_; + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + @java.lang.Override + public java.util.List<context.ContextOuterClass.SliceId> getSliceSubsliceIdsList() { + return sliceSubsliceIds_; + } + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + @java.lang.Override + public java.util.List<? extends context.ContextOuterClass.SliceIdOrBuilder> + getSliceSubsliceIdsOrBuilderList() { + return sliceSubsliceIds_; + } + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + @java.lang.Override + public int getSliceSubsliceIdsCount() { + return sliceSubsliceIds_.size(); + } + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + @java.lang.Override + public context.ContextOuterClass.SliceId getSliceSubsliceIds(int index) { + return sliceSubsliceIds_.get(index); + } + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + @java.lang.Override + public context.ContextOuterClass.SliceIdOrBuilder getSliceSubsliceIdsOrBuilder( + int index) { + return sliceSubsliceIds_.get(index); + } + + public static final int SLICE_STATUS_FIELD_NUMBER = 6; + private context.ContextOuterClass.SliceStatus sliceStatus_; + /** + * <code>.context.SliceStatus slice_status = 6;</code> + * @return Whether the sliceStatus field is set. + */ + @java.lang.Override + public boolean hasSliceStatus() { + return sliceStatus_ != null; + } + /** + * <code>.context.SliceStatus slice_status = 6;</code> + * @return The sliceStatus. + */ + @java.lang.Override + public context.ContextOuterClass.SliceStatus getSliceStatus() { + return sliceStatus_ == null ? context.ContextOuterClass.SliceStatus.getDefaultInstance() : sliceStatus_; + } + /** + * <code>.context.SliceStatus slice_status = 6;</code> + */ + @java.lang.Override + public context.ContextOuterClass.SliceStatusOrBuilder getSliceStatusOrBuilder() { + return getSliceStatus(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (sliceId_ != null) { + output.writeMessage(1, getSliceId()); + } + for (int i = 0; i < sliceEndpointIds_.size(); i++) { + output.writeMessage(2, sliceEndpointIds_.get(i)); + } + for (int i = 0; i < sliceConstraints_.size(); i++) { + output.writeMessage(3, sliceConstraints_.get(i)); + } + for (int i = 0; i < sliceServiceIds_.size(); i++) { + output.writeMessage(4, sliceServiceIds_.get(i)); + } + for (int i = 0; i < sliceSubsliceIds_.size(); i++) { + output.writeMessage(5, sliceSubsliceIds_.get(i)); + } + if (sliceStatus_ != null) { + output.writeMessage(6, getSliceStatus()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (sliceId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getSliceId()); + } + for (int i = 0; i < sliceEndpointIds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, sliceEndpointIds_.get(i)); + } + for (int i = 0; i < sliceConstraints_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, sliceConstraints_.get(i)); + } + for (int i = 0; i < sliceServiceIds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, sliceServiceIds_.get(i)); + } + for (int i = 0; i < sliceSubsliceIds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, sliceSubsliceIds_.get(i)); + } + if (sliceStatus_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getSliceStatus()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof context.ContextOuterClass.Slice)) { + return super.equals(obj); + } + context.ContextOuterClass.Slice other = (context.ContextOuterClass.Slice) obj; + + if (hasSliceId() != other.hasSliceId()) return false; + if (hasSliceId()) { + if (!getSliceId() + .equals(other.getSliceId())) return false; + } + if (!getSliceEndpointIdsList() + .equals(other.getSliceEndpointIdsList())) return false; + if (!getSliceConstraintsList() + .equals(other.getSliceConstraintsList())) return false; + if (!getSliceServiceIdsList() + .equals(other.getSliceServiceIdsList())) return false; + if (!getSliceSubsliceIdsList() + .equals(other.getSliceSubsliceIdsList())) return false; + if (hasSliceStatus() != other.hasSliceStatus()) return false; + if (hasSliceStatus()) { + if (!getSliceStatus() + .equals(other.getSliceStatus())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasSliceId()) { + hash = (37 * hash) + SLICE_ID_FIELD_NUMBER; + hash = (53 * hash) + getSliceId().hashCode(); + } + if (getSliceEndpointIdsCount() > 0) { + hash = (37 * hash) + SLICE_ENDPOINT_IDS_FIELD_NUMBER; + hash = (53 * hash) + getSliceEndpointIdsList().hashCode(); + } + if (getSliceConstraintsCount() > 0) { + hash = (37 * hash) + SLICE_CONSTRAINTS_FIELD_NUMBER; + hash = (53 * hash) + getSliceConstraintsList().hashCode(); + } + if (getSliceServiceIdsCount() > 0) { + hash = (37 * hash) + SLICE_SERVICE_IDS_FIELD_NUMBER; + hash = (53 * hash) + getSliceServiceIdsList().hashCode(); + } + if (getSliceSubsliceIdsCount() > 0) { + hash = (37 * hash) + SLICE_SUBSLICE_IDS_FIELD_NUMBER; + hash = (53 * hash) + getSliceSubsliceIdsList().hashCode(); + } + if (hasSliceStatus()) { + hash = (37 * hash) + SLICE_STATUS_FIELD_NUMBER; + hash = (53 * hash) + getSliceStatus().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.Slice parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.Slice parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.Slice parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.Slice parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.Slice parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.Slice parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.Slice parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.Slice parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static context.ContextOuterClass.Slice parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.Slice parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static context.ContextOuterClass.Slice parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.Slice parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(context.ContextOuterClass.Slice prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code context.Slice} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:context.Slice) + context.ContextOuterClass.SliceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_Slice_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_Slice_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.Slice.class, context.ContextOuterClass.Slice.Builder.class); + } + + // Construct using context.ContextOuterClass.Slice.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getSliceEndpointIdsFieldBuilder(); + getSliceConstraintsFieldBuilder(); + getSliceServiceIdsFieldBuilder(); + getSliceSubsliceIdsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (sliceIdBuilder_ == null) { + sliceId_ = null; + } else { + sliceId_ = null; + sliceIdBuilder_ = null; + } + if (sliceEndpointIdsBuilder_ == null) { + sliceEndpointIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + sliceEndpointIdsBuilder_.clear(); + } + if (sliceConstraintsBuilder_ == null) { + sliceConstraints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + sliceConstraintsBuilder_.clear(); + } + if (sliceServiceIdsBuilder_ == null) { + sliceServiceIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + sliceServiceIdsBuilder_.clear(); + } + if (sliceSubsliceIdsBuilder_ == null) { + sliceSubsliceIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + } else { + sliceSubsliceIdsBuilder_.clear(); + } + if (sliceStatusBuilder_ == null) { + sliceStatus_ = null; + } else { + sliceStatus_ = null; + sliceStatusBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_Slice_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.Slice getDefaultInstanceForType() { + return context.ContextOuterClass.Slice.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.Slice build() { + context.ContextOuterClass.Slice result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.Slice buildPartial() { + context.ContextOuterClass.Slice result = new context.ContextOuterClass.Slice(this); + int from_bitField0_ = bitField0_; + if (sliceIdBuilder_ == null) { + result.sliceId_ = sliceId_; + } else { + result.sliceId_ = sliceIdBuilder_.build(); + } + if (sliceEndpointIdsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + sliceEndpointIds_ = java.util.Collections.unmodifiableList(sliceEndpointIds_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.sliceEndpointIds_ = sliceEndpointIds_; + } else { + result.sliceEndpointIds_ = sliceEndpointIdsBuilder_.build(); + } + if (sliceConstraintsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + sliceConstraints_ = java.util.Collections.unmodifiableList(sliceConstraints_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.sliceConstraints_ = sliceConstraints_; + } else { + result.sliceConstraints_ = sliceConstraintsBuilder_.build(); + } + if (sliceServiceIdsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + sliceServiceIds_ = java.util.Collections.unmodifiableList(sliceServiceIds_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.sliceServiceIds_ = sliceServiceIds_; + } else { + result.sliceServiceIds_ = sliceServiceIdsBuilder_.build(); + } + if (sliceSubsliceIdsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + sliceSubsliceIds_ = java.util.Collections.unmodifiableList(sliceSubsliceIds_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.sliceSubsliceIds_ = sliceSubsliceIds_; + } else { + result.sliceSubsliceIds_ = sliceSubsliceIdsBuilder_.build(); + } + if (sliceStatusBuilder_ == null) { + result.sliceStatus_ = sliceStatus_; + } else { + result.sliceStatus_ = sliceStatusBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof context.ContextOuterClass.Slice) { + return mergeFrom((context.ContextOuterClass.Slice)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.Slice other) { + if (other == context.ContextOuterClass.Slice.getDefaultInstance()) return this; + if (other.hasSliceId()) { + mergeSliceId(other.getSliceId()); + } + if (sliceEndpointIdsBuilder_ == null) { + if (!other.sliceEndpointIds_.isEmpty()) { + if (sliceEndpointIds_.isEmpty()) { + sliceEndpointIds_ = other.sliceEndpointIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSliceEndpointIdsIsMutable(); + sliceEndpointIds_.addAll(other.sliceEndpointIds_); + } + onChanged(); + } + } else { + if (!other.sliceEndpointIds_.isEmpty()) { + if (sliceEndpointIdsBuilder_.isEmpty()) { + sliceEndpointIdsBuilder_.dispose(); + sliceEndpointIdsBuilder_ = null; + sliceEndpointIds_ = other.sliceEndpointIds_; + bitField0_ = (bitField0_ & ~0x00000001); + sliceEndpointIdsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSliceEndpointIdsFieldBuilder() : null; + } else { + sliceEndpointIdsBuilder_.addAllMessages(other.sliceEndpointIds_); + } + } + } + if (sliceConstraintsBuilder_ == null) { + if (!other.sliceConstraints_.isEmpty()) { + if (sliceConstraints_.isEmpty()) { + sliceConstraints_ = other.sliceConstraints_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureSliceConstraintsIsMutable(); + sliceConstraints_.addAll(other.sliceConstraints_); + } + onChanged(); + } + } else { + if (!other.sliceConstraints_.isEmpty()) { + if (sliceConstraintsBuilder_.isEmpty()) { + sliceConstraintsBuilder_.dispose(); + sliceConstraintsBuilder_ = null; + sliceConstraints_ = other.sliceConstraints_; + bitField0_ = (bitField0_ & ~0x00000002); + sliceConstraintsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSliceConstraintsFieldBuilder() : null; + } else { + sliceConstraintsBuilder_.addAllMessages(other.sliceConstraints_); + } + } + } + if (sliceServiceIdsBuilder_ == null) { + if (!other.sliceServiceIds_.isEmpty()) { + if (sliceServiceIds_.isEmpty()) { + sliceServiceIds_ = other.sliceServiceIds_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureSliceServiceIdsIsMutable(); + sliceServiceIds_.addAll(other.sliceServiceIds_); + } + onChanged(); + } + } else { + if (!other.sliceServiceIds_.isEmpty()) { + if (sliceServiceIdsBuilder_.isEmpty()) { + sliceServiceIdsBuilder_.dispose(); + sliceServiceIdsBuilder_ = null; + sliceServiceIds_ = other.sliceServiceIds_; + bitField0_ = (bitField0_ & ~0x00000004); + sliceServiceIdsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSliceServiceIdsFieldBuilder() : null; + } else { + sliceServiceIdsBuilder_.addAllMessages(other.sliceServiceIds_); + } + } + } + if (sliceSubsliceIdsBuilder_ == null) { + if (!other.sliceSubsliceIds_.isEmpty()) { + if (sliceSubsliceIds_.isEmpty()) { + sliceSubsliceIds_ = other.sliceSubsliceIds_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureSliceSubsliceIdsIsMutable(); + sliceSubsliceIds_.addAll(other.sliceSubsliceIds_); + } + onChanged(); + } + } else { + if (!other.sliceSubsliceIds_.isEmpty()) { + if (sliceSubsliceIdsBuilder_.isEmpty()) { + sliceSubsliceIdsBuilder_.dispose(); + sliceSubsliceIdsBuilder_ = null; + sliceSubsliceIds_ = other.sliceSubsliceIds_; + bitField0_ = (bitField0_ & ~0x00000008); + sliceSubsliceIdsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSliceSubsliceIdsFieldBuilder() : null; + } else { + sliceSubsliceIdsBuilder_.addAllMessages(other.sliceSubsliceIds_); + } + } + } + if (other.hasSliceStatus()) { + mergeSliceStatus(other.getSliceStatus()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + context.ContextOuterClass.Slice parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.Slice) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private context.ContextOuterClass.SliceId sliceId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> sliceIdBuilder_; + /** + * <code>.context.SliceId slice_id = 1;</code> + * @return Whether the sliceId field is set. + */ + public boolean hasSliceId() { + return sliceIdBuilder_ != null || sliceId_ != null; + } + /** + * <code>.context.SliceId slice_id = 1;</code> + * @return The sliceId. + */ + public context.ContextOuterClass.SliceId getSliceId() { + if (sliceIdBuilder_ == null) { + return sliceId_ == null ? context.ContextOuterClass.SliceId.getDefaultInstance() : sliceId_; + } else { + return sliceIdBuilder_.getMessage(); + } + } + /** + * <code>.context.SliceId slice_id = 1;</code> + */ + public Builder setSliceId(context.ContextOuterClass.SliceId value) { + if (sliceIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sliceId_ = value; + onChanged(); + } else { + sliceIdBuilder_.setMessage(value); + } + + return this; + } + /** + * <code>.context.SliceId slice_id = 1;</code> + */ + public Builder setSliceId( + context.ContextOuterClass.SliceId.Builder builderForValue) { + if (sliceIdBuilder_ == null) { + sliceId_ = builderForValue.build(); + onChanged(); + } else { + sliceIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * <code>.context.SliceId slice_id = 1;</code> + */ + public Builder mergeSliceId(context.ContextOuterClass.SliceId value) { + if (sliceIdBuilder_ == null) { + if (sliceId_ != null) { + sliceId_ = + context.ContextOuterClass.SliceId.newBuilder(sliceId_).mergeFrom(value).buildPartial(); + } else { + sliceId_ = value; + } + onChanged(); + } else { + sliceIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * <code>.context.SliceId slice_id = 1;</code> + */ + public Builder clearSliceId() { + if (sliceIdBuilder_ == null) { + sliceId_ = null; + onChanged(); + } else { + sliceId_ = null; + sliceIdBuilder_ = null; + } + + return this; + } + /** + * <code>.context.SliceId slice_id = 1;</code> + */ + public context.ContextOuterClass.SliceId.Builder getSliceIdBuilder() { + + onChanged(); + return getSliceIdFieldBuilder().getBuilder(); + } + /** + * <code>.context.SliceId slice_id = 1;</code> + */ + public context.ContextOuterClass.SliceIdOrBuilder getSliceIdOrBuilder() { + if (sliceIdBuilder_ != null) { + return sliceIdBuilder_.getMessageOrBuilder(); + } else { + return sliceId_ == null ? + context.ContextOuterClass.SliceId.getDefaultInstance() : sliceId_; + } + } + /** + * <code>.context.SliceId slice_id = 1;</code> + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> + getSliceIdFieldBuilder() { + if (sliceIdBuilder_ == null) { + sliceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder>( + getSliceId(), + getParentForChildren(), + isClean()); + sliceId_ = null; + } + return sliceIdBuilder_; + } + + private java.util.List<context.ContextOuterClass.EndPointId> sliceEndpointIds_ = + java.util.Collections.emptyList(); + private void ensureSliceEndpointIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + sliceEndpointIds_ = new java.util.ArrayList<context.ContextOuterClass.EndPointId>(sliceEndpointIds_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> sliceEndpointIdsBuilder_; + + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + public java.util.List<context.ContextOuterClass.EndPointId> getSliceEndpointIdsList() { + if (sliceEndpointIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(sliceEndpointIds_); + } else { + return sliceEndpointIdsBuilder_.getMessageList(); + } + } + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + public int getSliceEndpointIdsCount() { + if (sliceEndpointIdsBuilder_ == null) { + return sliceEndpointIds_.size(); + } else { + return sliceEndpointIdsBuilder_.getCount(); + } + } + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + public context.ContextOuterClass.EndPointId getSliceEndpointIds(int index) { + if (sliceEndpointIdsBuilder_ == null) { + return sliceEndpointIds_.get(index); + } else { + return sliceEndpointIdsBuilder_.getMessage(index); + } + } + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + public Builder setSliceEndpointIds( + int index, context.ContextOuterClass.EndPointId value) { + if (sliceEndpointIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceEndpointIdsIsMutable(); + sliceEndpointIds_.set(index, value); + onChanged(); + } else { + sliceEndpointIdsBuilder_.setMessage(index, value); + } + return this; + } + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + public Builder setSliceEndpointIds( + int index, context.ContextOuterClass.EndPointId.Builder builderForValue) { + if (sliceEndpointIdsBuilder_ == null) { + ensureSliceEndpointIdsIsMutable(); + sliceEndpointIds_.set(index, builderForValue.build()); + onChanged(); + } else { + sliceEndpointIdsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + public Builder addSliceEndpointIds(context.ContextOuterClass.EndPointId value) { + if (sliceEndpointIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceEndpointIdsIsMutable(); + sliceEndpointIds_.add(value); + onChanged(); + } else { + sliceEndpointIdsBuilder_.addMessage(value); + } + return this; + } + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + public Builder addSliceEndpointIds( + int index, context.ContextOuterClass.EndPointId value) { + if (sliceEndpointIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceEndpointIdsIsMutable(); + sliceEndpointIds_.add(index, value); + onChanged(); + } else { + sliceEndpointIdsBuilder_.addMessage(index, value); + } + return this; + } + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + public Builder addSliceEndpointIds( + context.ContextOuterClass.EndPointId.Builder builderForValue) { + if (sliceEndpointIdsBuilder_ == null) { + ensureSliceEndpointIdsIsMutable(); + sliceEndpointIds_.add(builderForValue.build()); + onChanged(); + } else { + sliceEndpointIdsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + public Builder addSliceEndpointIds( + int index, context.ContextOuterClass.EndPointId.Builder builderForValue) { + if (sliceEndpointIdsBuilder_ == null) { + ensureSliceEndpointIdsIsMutable(); + sliceEndpointIds_.add(index, builderForValue.build()); + onChanged(); + } else { + sliceEndpointIdsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + public Builder addAllSliceEndpointIds( + java.lang.Iterable<? extends context.ContextOuterClass.EndPointId> values) { + if (sliceEndpointIdsBuilder_ == null) { + ensureSliceEndpointIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, sliceEndpointIds_); + onChanged(); + } else { + sliceEndpointIdsBuilder_.addAllMessages(values); + } + return this; + } + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + public Builder clearSliceEndpointIds() { + if (sliceEndpointIdsBuilder_ == null) { + sliceEndpointIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + sliceEndpointIdsBuilder_.clear(); + } + return this; + } + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + public Builder removeSliceEndpointIds(int index) { + if (sliceEndpointIdsBuilder_ == null) { + ensureSliceEndpointIdsIsMutable(); + sliceEndpointIds_.remove(index); + onChanged(); + } else { + sliceEndpointIdsBuilder_.remove(index); + } + return this; + } + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + public context.ContextOuterClass.EndPointId.Builder getSliceEndpointIdsBuilder( + int index) { + return getSliceEndpointIdsFieldBuilder().getBuilder(index); + } + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + public context.ContextOuterClass.EndPointIdOrBuilder getSliceEndpointIdsOrBuilder( + int index) { + if (sliceEndpointIdsBuilder_ == null) { + return sliceEndpointIds_.get(index); } else { + return sliceEndpointIdsBuilder_.getMessageOrBuilder(index); + } + } + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + public java.util.List<? extends context.ContextOuterClass.EndPointIdOrBuilder> + getSliceEndpointIdsOrBuilderList() { + if (sliceEndpointIdsBuilder_ != null) { + return sliceEndpointIdsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(sliceEndpointIds_); + } + } + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + public context.ContextOuterClass.EndPointId.Builder addSliceEndpointIdsBuilder() { + return getSliceEndpointIdsFieldBuilder().addBuilder( + context.ContextOuterClass.EndPointId.getDefaultInstance()); + } + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + public context.ContextOuterClass.EndPointId.Builder addSliceEndpointIdsBuilder( + int index) { + return getSliceEndpointIdsFieldBuilder().addBuilder( + index, context.ContextOuterClass.EndPointId.getDefaultInstance()); + } + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + public java.util.List<context.ContextOuterClass.EndPointId.Builder> + getSliceEndpointIdsBuilderList() { + return getSliceEndpointIdsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> + getSliceEndpointIdsFieldBuilder() { + if (sliceEndpointIdsBuilder_ == null) { + sliceEndpointIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder>( + sliceEndpointIds_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + sliceEndpointIds_ = null; + } + return sliceEndpointIdsBuilder_; + } + + private java.util.List<context.ContextOuterClass.Constraint> sliceConstraints_ = + java.util.Collections.emptyList(); + private void ensureSliceConstraintsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + sliceConstraints_ = new java.util.ArrayList<context.ContextOuterClass.Constraint>(sliceConstraints_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Constraint, context.ContextOuterClass.Constraint.Builder, context.ContextOuterClass.ConstraintOrBuilder> sliceConstraintsBuilder_; + + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + public java.util.List<context.ContextOuterClass.Constraint> getSliceConstraintsList() { + if (sliceConstraintsBuilder_ == null) { + return java.util.Collections.unmodifiableList(sliceConstraints_); + } else { + return sliceConstraintsBuilder_.getMessageList(); + } + } + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + public int getSliceConstraintsCount() { + if (sliceConstraintsBuilder_ == null) { + return sliceConstraints_.size(); + } else { + return sliceConstraintsBuilder_.getCount(); + } + } + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + public context.ContextOuterClass.Constraint getSliceConstraints(int index) { + if (sliceConstraintsBuilder_ == null) { + return sliceConstraints_.get(index); + } else { + return sliceConstraintsBuilder_.getMessage(index); + } + } + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + public Builder setSliceConstraints( + int index, context.ContextOuterClass.Constraint value) { + if (sliceConstraintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceConstraintsIsMutable(); + sliceConstraints_.set(index, value); + onChanged(); + } else { + sliceConstraintsBuilder_.setMessage(index, value); + } + return this; + } + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + public Builder setSliceConstraints( + int index, context.ContextOuterClass.Constraint.Builder builderForValue) { + if (sliceConstraintsBuilder_ == null) { + ensureSliceConstraintsIsMutable(); + sliceConstraints_.set(index, builderForValue.build()); + onChanged(); + } else { + sliceConstraintsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + public Builder addSliceConstraints(context.ContextOuterClass.Constraint value) { + if (sliceConstraintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceConstraintsIsMutable(); + sliceConstraints_.add(value); + onChanged(); + } else { + sliceConstraintsBuilder_.addMessage(value); + } + return this; + } + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + public Builder addSliceConstraints( + int index, context.ContextOuterClass.Constraint value) { + if (sliceConstraintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceConstraintsIsMutable(); + sliceConstraints_.add(index, value); + onChanged(); + } else { + sliceConstraintsBuilder_.addMessage(index, value); + } + return this; + } + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + public Builder addSliceConstraints( + context.ContextOuterClass.Constraint.Builder builderForValue) { + if (sliceConstraintsBuilder_ == null) { + ensureSliceConstraintsIsMutable(); + sliceConstraints_.add(builderForValue.build()); + onChanged(); + } else { + sliceConstraintsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + public Builder addSliceConstraints( + int index, context.ContextOuterClass.Constraint.Builder builderForValue) { + if (sliceConstraintsBuilder_ == null) { + ensureSliceConstraintsIsMutable(); + sliceConstraints_.add(index, builderForValue.build()); + onChanged(); + } else { + sliceConstraintsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + public Builder addAllSliceConstraints( + java.lang.Iterable<? extends context.ContextOuterClass.Constraint> values) { + if (sliceConstraintsBuilder_ == null) { + ensureSliceConstraintsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, sliceConstraints_); + onChanged(); + } else { + sliceConstraintsBuilder_.addAllMessages(values); + } + return this; + } + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + public Builder clearSliceConstraints() { + if (sliceConstraintsBuilder_ == null) { + sliceConstraints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + sliceConstraintsBuilder_.clear(); + } + return this; + } + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + public Builder removeSliceConstraints(int index) { + if (sliceConstraintsBuilder_ == null) { + ensureSliceConstraintsIsMutable(); + sliceConstraints_.remove(index); + onChanged(); + } else { + sliceConstraintsBuilder_.remove(index); + } + return this; + } + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + public context.ContextOuterClass.Constraint.Builder getSliceConstraintsBuilder( + int index) { + return getSliceConstraintsFieldBuilder().getBuilder(index); + } + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + public context.ContextOuterClass.ConstraintOrBuilder getSliceConstraintsOrBuilder( + int index) { + if (sliceConstraintsBuilder_ == null) { + return sliceConstraints_.get(index); } else { + return sliceConstraintsBuilder_.getMessageOrBuilder(index); + } + } + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + public java.util.List<? extends context.ContextOuterClass.ConstraintOrBuilder> + getSliceConstraintsOrBuilderList() { + if (sliceConstraintsBuilder_ != null) { + return sliceConstraintsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(sliceConstraints_); + } + } + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + public context.ContextOuterClass.Constraint.Builder addSliceConstraintsBuilder() { + return getSliceConstraintsFieldBuilder().addBuilder( + context.ContextOuterClass.Constraint.getDefaultInstance()); + } + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + public context.ContextOuterClass.Constraint.Builder addSliceConstraintsBuilder( + int index) { + return getSliceConstraintsFieldBuilder().addBuilder( + index, context.ContextOuterClass.Constraint.getDefaultInstance()); + } + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + public java.util.List<context.ContextOuterClass.Constraint.Builder> + getSliceConstraintsBuilderList() { + return getSliceConstraintsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Constraint, context.ContextOuterClass.Constraint.Builder, context.ContextOuterClass.ConstraintOrBuilder> + getSliceConstraintsFieldBuilder() { + if (sliceConstraintsBuilder_ == null) { + sliceConstraintsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Constraint, context.ContextOuterClass.Constraint.Builder, context.ContextOuterClass.ConstraintOrBuilder>( + sliceConstraints_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + sliceConstraints_ = null; + } + return sliceConstraintsBuilder_; + } + + private java.util.List<context.ContextOuterClass.ServiceId> sliceServiceIds_ = + java.util.Collections.emptyList(); + private void ensureSliceServiceIdsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + sliceServiceIds_ = new java.util.ArrayList<context.ContextOuterClass.ServiceId>(sliceServiceIds_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> sliceServiceIdsBuilder_; + + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + public java.util.List<context.ContextOuterClass.ServiceId> getSliceServiceIdsList() { + if (sliceServiceIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(sliceServiceIds_); + } else { + return sliceServiceIdsBuilder_.getMessageList(); + } + } + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + public int getSliceServiceIdsCount() { + if (sliceServiceIdsBuilder_ == null) { + return sliceServiceIds_.size(); + } else { + return sliceServiceIdsBuilder_.getCount(); + } + } + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + public context.ContextOuterClass.ServiceId getSliceServiceIds(int index) { + if (sliceServiceIdsBuilder_ == null) { + return sliceServiceIds_.get(index); + } else { + return sliceServiceIdsBuilder_.getMessage(index); + } + } + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + public Builder setSliceServiceIds( + int index, context.ContextOuterClass.ServiceId value) { + if (sliceServiceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceServiceIdsIsMutable(); + sliceServiceIds_.set(index, value); + onChanged(); + } else { + sliceServiceIdsBuilder_.setMessage(index, value); + } + return this; + } + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + public Builder setSliceServiceIds( + int index, context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (sliceServiceIdsBuilder_ == null) { + ensureSliceServiceIdsIsMutable(); + sliceServiceIds_.set(index, builderForValue.build()); + onChanged(); + } else { + sliceServiceIdsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + public Builder addSliceServiceIds(context.ContextOuterClass.ServiceId value) { + if (sliceServiceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceServiceIdsIsMutable(); + sliceServiceIds_.add(value); + onChanged(); + } else { + sliceServiceIdsBuilder_.addMessage(value); + } + return this; + } + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + public Builder addSliceServiceIds( + int index, context.ContextOuterClass.ServiceId value) { + if (sliceServiceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceServiceIdsIsMutable(); + sliceServiceIds_.add(index, value); + onChanged(); + } else { + sliceServiceIdsBuilder_.addMessage(index, value); + } + return this; + } + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + public Builder addSliceServiceIds( + context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (sliceServiceIdsBuilder_ == null) { + ensureSliceServiceIdsIsMutable(); + sliceServiceIds_.add(builderForValue.build()); + onChanged(); + } else { + sliceServiceIdsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + public Builder addSliceServiceIds( + int index, context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (sliceServiceIdsBuilder_ == null) { + ensureSliceServiceIdsIsMutable(); + sliceServiceIds_.add(index, builderForValue.build()); + onChanged(); + } else { + sliceServiceIdsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + public Builder addAllSliceServiceIds( + java.lang.Iterable<? extends context.ContextOuterClass.ServiceId> values) { + if (sliceServiceIdsBuilder_ == null) { + ensureSliceServiceIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, sliceServiceIds_); + onChanged(); + } else { + sliceServiceIdsBuilder_.addAllMessages(values); + } + return this; + } + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + public Builder clearSliceServiceIds() { + if (sliceServiceIdsBuilder_ == null) { + sliceServiceIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + sliceServiceIdsBuilder_.clear(); + } + return this; + } + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + public Builder removeSliceServiceIds(int index) { + if (sliceServiceIdsBuilder_ == null) { + ensureSliceServiceIdsIsMutable(); + sliceServiceIds_.remove(index); + onChanged(); + } else { + sliceServiceIdsBuilder_.remove(index); + } + return this; + } + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + public context.ContextOuterClass.ServiceId.Builder getSliceServiceIdsBuilder( + int index) { + return getSliceServiceIdsFieldBuilder().getBuilder(index); + } + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + public context.ContextOuterClass.ServiceIdOrBuilder getSliceServiceIdsOrBuilder( + int index) { + if (sliceServiceIdsBuilder_ == null) { + return sliceServiceIds_.get(index); } else { + return sliceServiceIdsBuilder_.getMessageOrBuilder(index); + } + } + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + public java.util.List<? extends context.ContextOuterClass.ServiceIdOrBuilder> + getSliceServiceIdsOrBuilderList() { + if (sliceServiceIdsBuilder_ != null) { + return sliceServiceIdsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(sliceServiceIds_); + } + } + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + public context.ContextOuterClass.ServiceId.Builder addSliceServiceIdsBuilder() { + return getSliceServiceIdsFieldBuilder().addBuilder( + context.ContextOuterClass.ServiceId.getDefaultInstance()); + } + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + public context.ContextOuterClass.ServiceId.Builder addSliceServiceIdsBuilder( + int index) { + return getSliceServiceIdsFieldBuilder().addBuilder( + index, context.ContextOuterClass.ServiceId.getDefaultInstance()); + } + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + public java.util.List<context.ContextOuterClass.ServiceId.Builder> + getSliceServiceIdsBuilderList() { + return getSliceServiceIdsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> + getSliceServiceIdsFieldBuilder() { + if (sliceServiceIdsBuilder_ == null) { + sliceServiceIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder>( + sliceServiceIds_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + sliceServiceIds_ = null; + } + return sliceServiceIdsBuilder_; + } + + private java.util.List<context.ContextOuterClass.SliceId> sliceSubsliceIds_ = + java.util.Collections.emptyList(); + private void ensureSliceSubsliceIdsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + sliceSubsliceIds_ = new java.util.ArrayList<context.ContextOuterClass.SliceId>(sliceSubsliceIds_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> sliceSubsliceIdsBuilder_; + + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + public java.util.List<context.ContextOuterClass.SliceId> getSliceSubsliceIdsList() { + if (sliceSubsliceIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(sliceSubsliceIds_); + } else { + return sliceSubsliceIdsBuilder_.getMessageList(); + } + } + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + public int getSliceSubsliceIdsCount() { + if (sliceSubsliceIdsBuilder_ == null) { + return sliceSubsliceIds_.size(); + } else { + return sliceSubsliceIdsBuilder_.getCount(); + } + } + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + public context.ContextOuterClass.SliceId getSliceSubsliceIds(int index) { + if (sliceSubsliceIdsBuilder_ == null) { + return sliceSubsliceIds_.get(index); + } else { + return sliceSubsliceIdsBuilder_.getMessage(index); + } + } + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + public Builder setSliceSubsliceIds( + int index, context.ContextOuterClass.SliceId value) { + if (sliceSubsliceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceSubsliceIdsIsMutable(); + sliceSubsliceIds_.set(index, value); + onChanged(); + } else { + sliceSubsliceIdsBuilder_.setMessage(index, value); + } + return this; + } + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + public Builder setSliceSubsliceIds( + int index, context.ContextOuterClass.SliceId.Builder builderForValue) { + if (sliceSubsliceIdsBuilder_ == null) { + ensureSliceSubsliceIdsIsMutable(); + sliceSubsliceIds_.set(index, builderForValue.build()); + onChanged(); + } else { + sliceSubsliceIdsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + public Builder addSliceSubsliceIds(context.ContextOuterClass.SliceId value) { + if (sliceSubsliceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceSubsliceIdsIsMutable(); + sliceSubsliceIds_.add(value); + onChanged(); + } else { + sliceSubsliceIdsBuilder_.addMessage(value); + } + return this; + } + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + public Builder addSliceSubsliceIds( + int index, context.ContextOuterClass.SliceId value) { + if (sliceSubsliceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceSubsliceIdsIsMutable(); + sliceSubsliceIds_.add(index, value); + onChanged(); + } else { + sliceSubsliceIdsBuilder_.addMessage(index, value); + } + return this; + } + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + public Builder addSliceSubsliceIds( + context.ContextOuterClass.SliceId.Builder builderForValue) { + if (sliceSubsliceIdsBuilder_ == null) { + ensureSliceSubsliceIdsIsMutable(); + sliceSubsliceIds_.add(builderForValue.build()); + onChanged(); + } else { + sliceSubsliceIdsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + public Builder addSliceSubsliceIds( + int index, context.ContextOuterClass.SliceId.Builder builderForValue) { + if (sliceSubsliceIdsBuilder_ == null) { + ensureSliceSubsliceIdsIsMutable(); + sliceSubsliceIds_.add(index, builderForValue.build()); + onChanged(); + } else { + sliceSubsliceIdsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + public Builder addAllSliceSubsliceIds( + java.lang.Iterable<? extends context.ContextOuterClass.SliceId> values) { + if (sliceSubsliceIdsBuilder_ == null) { + ensureSliceSubsliceIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, sliceSubsliceIds_); + onChanged(); + } else { + sliceSubsliceIdsBuilder_.addAllMessages(values); + } + return this; + } + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + public Builder clearSliceSubsliceIds() { + if (sliceSubsliceIdsBuilder_ == null) { + sliceSubsliceIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + sliceSubsliceIdsBuilder_.clear(); + } + return this; + } + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + public Builder removeSliceSubsliceIds(int index) { + if (sliceSubsliceIdsBuilder_ == null) { + ensureSliceSubsliceIdsIsMutable(); + sliceSubsliceIds_.remove(index); + onChanged(); + } else { + sliceSubsliceIdsBuilder_.remove(index); + } + return this; + } + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + public context.ContextOuterClass.SliceId.Builder getSliceSubsliceIdsBuilder( + int index) { + return getSliceSubsliceIdsFieldBuilder().getBuilder(index); + } + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + public context.ContextOuterClass.SliceIdOrBuilder getSliceSubsliceIdsOrBuilder( + int index) { + if (sliceSubsliceIdsBuilder_ == null) { + return sliceSubsliceIds_.get(index); } else { + return sliceSubsliceIdsBuilder_.getMessageOrBuilder(index); + } + } + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + public java.util.List<? extends context.ContextOuterClass.SliceIdOrBuilder> + getSliceSubsliceIdsOrBuilderList() { + if (sliceSubsliceIdsBuilder_ != null) { + return sliceSubsliceIdsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(sliceSubsliceIds_); + } + } + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + public context.ContextOuterClass.SliceId.Builder addSliceSubsliceIdsBuilder() { + return getSliceSubsliceIdsFieldBuilder().addBuilder( + context.ContextOuterClass.SliceId.getDefaultInstance()); + } + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + public context.ContextOuterClass.SliceId.Builder addSliceSubsliceIdsBuilder( + int index) { + return getSliceSubsliceIdsFieldBuilder().addBuilder( + index, context.ContextOuterClass.SliceId.getDefaultInstance()); + } + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + public java.util.List<context.ContextOuterClass.SliceId.Builder> + getSliceSubsliceIdsBuilderList() { + return getSliceSubsliceIdsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> + getSliceSubsliceIdsFieldBuilder() { + if (sliceSubsliceIdsBuilder_ == null) { + sliceSubsliceIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder>( + sliceSubsliceIds_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + sliceSubsliceIds_ = null; + } + return sliceSubsliceIdsBuilder_; + } + + private context.ContextOuterClass.SliceStatus sliceStatus_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceStatus, context.ContextOuterClass.SliceStatus.Builder, context.ContextOuterClass.SliceStatusOrBuilder> sliceStatusBuilder_; + /** + * <code>.context.SliceStatus slice_status = 6;</code> + * @return Whether the sliceStatus field is set. + */ + public boolean hasSliceStatus() { + return sliceStatusBuilder_ != null || sliceStatus_ != null; + } + /** + * <code>.context.SliceStatus slice_status = 6;</code> + * @return The sliceStatus. + */ + public context.ContextOuterClass.SliceStatus getSliceStatus() { + if (sliceStatusBuilder_ == null) { + return sliceStatus_ == null ? context.ContextOuterClass.SliceStatus.getDefaultInstance() : sliceStatus_; + } else { + return sliceStatusBuilder_.getMessage(); + } + } + /** + * <code>.context.SliceStatus slice_status = 6;</code> + */ + public Builder setSliceStatus(context.ContextOuterClass.SliceStatus value) { + if (sliceStatusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sliceStatus_ = value; + onChanged(); + } else { + sliceStatusBuilder_.setMessage(value); + } + + return this; + } + /** + * <code>.context.SliceStatus slice_status = 6;</code> + */ + public Builder setSliceStatus( + context.ContextOuterClass.SliceStatus.Builder builderForValue) { + if (sliceStatusBuilder_ == null) { + sliceStatus_ = builderForValue.build(); + onChanged(); + } else { + sliceStatusBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * <code>.context.SliceStatus slice_status = 6;</code> + */ + public Builder mergeSliceStatus(context.ContextOuterClass.SliceStatus value) { + if (sliceStatusBuilder_ == null) { + if (sliceStatus_ != null) { + sliceStatus_ = + context.ContextOuterClass.SliceStatus.newBuilder(sliceStatus_).mergeFrom(value).buildPartial(); + } else { + sliceStatus_ = value; + } + onChanged(); + } else { + sliceStatusBuilder_.mergeFrom(value); + } + + return this; + } + /** + * <code>.context.SliceStatus slice_status = 6;</code> + */ + public Builder clearSliceStatus() { + if (sliceStatusBuilder_ == null) { + sliceStatus_ = null; + onChanged(); + } else { + sliceStatus_ = null; + sliceStatusBuilder_ = null; + } + + return this; + } + /** + * <code>.context.SliceStatus slice_status = 6;</code> + */ + public context.ContextOuterClass.SliceStatus.Builder getSliceStatusBuilder() { + + onChanged(); + return getSliceStatusFieldBuilder().getBuilder(); + } + /** + * <code>.context.SliceStatus slice_status = 6;</code> + */ + public context.ContextOuterClass.SliceStatusOrBuilder getSliceStatusOrBuilder() { + if (sliceStatusBuilder_ != null) { + return sliceStatusBuilder_.getMessageOrBuilder(); + } else { + return sliceStatus_ == null ? + context.ContextOuterClass.SliceStatus.getDefaultInstance() : sliceStatus_; + } + } + /** + * <code>.context.SliceStatus slice_status = 6;</code> + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceStatus, context.ContextOuterClass.SliceStatus.Builder, context.ContextOuterClass.SliceStatusOrBuilder> + getSliceStatusFieldBuilder() { + if (sliceStatusBuilder_ == null) { + sliceStatusBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceStatus, context.ContextOuterClass.SliceStatus.Builder, context.ContextOuterClass.SliceStatusOrBuilder>( + getSliceStatus(), + getParentForChildren(), + isClean()); + sliceStatus_ = null; + } + return sliceStatusBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:context.Slice) + } + + // @@protoc_insertion_point(class_scope:context.Slice) + private static final context.ContextOuterClass.Slice DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.Slice(); + } + + public static context.ContextOuterClass.Slice getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<Slice> + PARSER = new com.google.protobuf.AbstractParser<Slice>() { + @java.lang.Override + public Slice parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Slice(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<Slice> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<Slice> getParserForType() { + return PARSER; + } + + @java.lang.Override + public context.ContextOuterClass.Slice getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SliceStatusOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.SliceStatus) + com.google.protobuf.MessageOrBuilder { + + /** + * <code>.context.SliceStatusEnum slice_status = 1;</code> + * @return The enum numeric value on the wire for sliceStatus. + */ + int getSliceStatusValue(); + /** + * <code>.context.SliceStatusEnum slice_status = 1;</code> + * @return The sliceStatus. + */ + context.ContextOuterClass.SliceStatusEnum getSliceStatus(); + } + /** + * Protobuf type {@code context.SliceStatus} + */ + public static final class SliceStatus extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.SliceStatus) + SliceStatusOrBuilder { + private static final long serialVersionUID = 0L; + // Use SliceStatus.newBuilder() to construct. + private SliceStatus(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private SliceStatus() { + sliceStatus_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SliceStatus(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SliceStatus( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + int rawValue = input.readEnum(); + + sliceStatus_ = rawValue; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_SliceStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_SliceStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.SliceStatus.class, context.ContextOuterClass.SliceStatus.Builder.class); + } + + public static final int SLICE_STATUS_FIELD_NUMBER = 1; + private int sliceStatus_; + /** + * <code>.context.SliceStatusEnum slice_status = 1;</code> + * @return The enum numeric value on the wire for sliceStatus. + */ + @java.lang.Override public int getSliceStatusValue() { + return sliceStatus_; + } + /** + * <code>.context.SliceStatusEnum slice_status = 1;</code> + * @return The sliceStatus. + */ + @java.lang.Override public context.ContextOuterClass.SliceStatusEnum getSliceStatus() { + @SuppressWarnings("deprecation") + context.ContextOuterClass.SliceStatusEnum result = context.ContextOuterClass.SliceStatusEnum.valueOf(sliceStatus_); + return result == null ? context.ContextOuterClass.SliceStatusEnum.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (sliceStatus_ != context.ContextOuterClass.SliceStatusEnum.SLICESTATUS_UNDEFINED.getNumber()) { + output.writeEnum(1, sliceStatus_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (sliceStatus_ != context.ContextOuterClass.SliceStatusEnum.SLICESTATUS_UNDEFINED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, sliceStatus_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof context.ContextOuterClass.SliceStatus)) { + return super.equals(obj); + } + context.ContextOuterClass.SliceStatus other = (context.ContextOuterClass.SliceStatus) obj; + + if (sliceStatus_ != other.sliceStatus_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SLICE_STATUS_FIELD_NUMBER; + hash = (53 * hash) + sliceStatus_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.SliceStatus parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.SliceStatus parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.SliceStatus parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.SliceStatus parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.SliceStatus parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.SliceStatus parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.SliceStatus parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.SliceStatus parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static context.ContextOuterClass.SliceStatus parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.SliceStatus parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static context.ContextOuterClass.SliceStatus parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.SliceStatus parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(context.ContextOuterClass.SliceStatus prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code context.SliceStatus} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:context.SliceStatus) + context.ContextOuterClass.SliceStatusOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_SliceStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_SliceStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.SliceStatus.class, context.ContextOuterClass.SliceStatus.Builder.class); + } + + // Construct using context.ContextOuterClass.SliceStatus.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + sliceStatus_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_SliceStatus_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.SliceStatus getDefaultInstanceForType() { + return context.ContextOuterClass.SliceStatus.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.SliceStatus build() { + context.ContextOuterClass.SliceStatus result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.SliceStatus buildPartial() { + context.ContextOuterClass.SliceStatus result = new context.ContextOuterClass.SliceStatus(this); + result.sliceStatus_ = sliceStatus_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof context.ContextOuterClass.SliceStatus) { + return mergeFrom((context.ContextOuterClass.SliceStatus)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.SliceStatus other) { + if (other == context.ContextOuterClass.SliceStatus.getDefaultInstance()) return this; + if (other.sliceStatus_ != 0) { + setSliceStatusValue(other.getSliceStatusValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + context.ContextOuterClass.SliceStatus parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.SliceStatus) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int sliceStatus_ = 0; + /** + * <code>.context.SliceStatusEnum slice_status = 1;</code> + * @return The enum numeric value on the wire for sliceStatus. + */ + @java.lang.Override public int getSliceStatusValue() { + return sliceStatus_; + } + /** + * <code>.context.SliceStatusEnum slice_status = 1;</code> + * @param value The enum numeric value on the wire for sliceStatus to set. + * @return This builder for chaining. + */ + public Builder setSliceStatusValue(int value) { + + sliceStatus_ = value; + onChanged(); + return this; + } + /** + * <code>.context.SliceStatusEnum slice_status = 1;</code> + * @return The sliceStatus. + */ + @java.lang.Override + public context.ContextOuterClass.SliceStatusEnum getSliceStatus() { + @SuppressWarnings("deprecation") + context.ContextOuterClass.SliceStatusEnum result = context.ContextOuterClass.SliceStatusEnum.valueOf(sliceStatus_); + return result == null ? context.ContextOuterClass.SliceStatusEnum.UNRECOGNIZED : result; + } + /** + * <code>.context.SliceStatusEnum slice_status = 1;</code> + * @param value The sliceStatus to set. + * @return This builder for chaining. + */ + public Builder setSliceStatus(context.ContextOuterClass.SliceStatusEnum value) { + if (value == null) { + throw new NullPointerException(); + } + + sliceStatus_ = value.getNumber(); + onChanged(); + return this; + } + /** + * <code>.context.SliceStatusEnum slice_status = 1;</code> + * @return This builder for chaining. + */ + public Builder clearSliceStatus() { + + sliceStatus_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:context.SliceStatus) + } + + // @@protoc_insertion_point(class_scope:context.SliceStatus) + private static final context.ContextOuterClass.SliceStatus DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.SliceStatus(); + } + + public static context.ContextOuterClass.SliceStatus getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<SliceStatus> + PARSER = new com.google.protobuf.AbstractParser<SliceStatus>() { + @java.lang.Override + public SliceStatus parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SliceStatus(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<SliceStatus> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<SliceStatus> getParserForType() { + return PARSER; + } + + @java.lang.Override + public context.ContextOuterClass.SliceStatus getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SliceIdListOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.SliceIdList) + com.google.protobuf.MessageOrBuilder { + + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + java.util.List<context.ContextOuterClass.SliceId> + getSliceIdsList(); + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + context.ContextOuterClass.SliceId getSliceIds(int index); + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + int getSliceIdsCount(); + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + java.util.List<? extends context.ContextOuterClass.SliceIdOrBuilder> + getSliceIdsOrBuilderList(); + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + context.ContextOuterClass.SliceIdOrBuilder getSliceIdsOrBuilder( + int index); + } + /** + * Protobuf type {@code context.SliceIdList} + */ + public static final class SliceIdList extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.SliceIdList) + SliceIdListOrBuilder { + private static final long serialVersionUID = 0L; + // Use SliceIdList.newBuilder() to construct. + private SliceIdList(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private SliceIdList() { + sliceIds_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SliceIdList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SliceIdList( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + sliceIds_ = new java.util.ArrayList<context.ContextOuterClass.SliceId>(); + mutable_bitField0_ |= 0x00000001; + } + sliceIds_.add( + input.readMessage(context.ContextOuterClass.SliceId.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + sliceIds_ = java.util.Collections.unmodifiableList(sliceIds_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_SliceIdList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_SliceIdList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.SliceIdList.class, context.ContextOuterClass.SliceIdList.Builder.class); + } + + public static final int SLICE_IDS_FIELD_NUMBER = 1; + private java.util.List<context.ContextOuterClass.SliceId> sliceIds_; + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + @java.lang.Override + public java.util.List<context.ContextOuterClass.SliceId> getSliceIdsList() { + return sliceIds_; + } + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + @java.lang.Override + public java.util.List<? extends context.ContextOuterClass.SliceIdOrBuilder> + getSliceIdsOrBuilderList() { + return sliceIds_; + } + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + @java.lang.Override + public int getSliceIdsCount() { + return sliceIds_.size(); + } + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + @java.lang.Override + public context.ContextOuterClass.SliceId getSliceIds(int index) { + return sliceIds_.get(index); + } + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + @java.lang.Override + public context.ContextOuterClass.SliceIdOrBuilder getSliceIdsOrBuilder( + int index) { + return sliceIds_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < sliceIds_.size(); i++) { + output.writeMessage(1, sliceIds_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < sliceIds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, sliceIds_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof context.ContextOuterClass.SliceIdList)) { + return super.equals(obj); + } + context.ContextOuterClass.SliceIdList other = (context.ContextOuterClass.SliceIdList) obj; + + if (!getSliceIdsList() + .equals(other.getSliceIdsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getSliceIdsCount() > 0) { + hash = (37 * hash) + SLICE_IDS_FIELD_NUMBER; + hash = (53 * hash) + getSliceIdsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.SliceIdList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.SliceIdList parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.SliceIdList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.SliceIdList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.SliceIdList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.SliceIdList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.SliceIdList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.SliceIdList parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static context.ContextOuterClass.SliceIdList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.SliceIdList parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static context.ContextOuterClass.SliceIdList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.SliceIdList parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(context.ContextOuterClass.SliceIdList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code context.SliceIdList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:context.SliceIdList) + context.ContextOuterClass.SliceIdListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_SliceIdList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_SliceIdList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.SliceIdList.class, context.ContextOuterClass.SliceIdList.Builder.class); + } + + // Construct using context.ContextOuterClass.SliceIdList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getSliceIdsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (sliceIdsBuilder_ == null) { + sliceIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + sliceIdsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_SliceIdList_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.SliceIdList getDefaultInstanceForType() { + return context.ContextOuterClass.SliceIdList.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.SliceIdList build() { + context.ContextOuterClass.SliceIdList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.SliceIdList buildPartial() { + context.ContextOuterClass.SliceIdList result = new context.ContextOuterClass.SliceIdList(this); + int from_bitField0_ = bitField0_; + if (sliceIdsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + sliceIds_ = java.util.Collections.unmodifiableList(sliceIds_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.sliceIds_ = sliceIds_; + } else { + result.sliceIds_ = sliceIdsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof context.ContextOuterClass.SliceIdList) { + return mergeFrom((context.ContextOuterClass.SliceIdList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.SliceIdList other) { + if (other == context.ContextOuterClass.SliceIdList.getDefaultInstance()) return this; + if (sliceIdsBuilder_ == null) { + if (!other.sliceIds_.isEmpty()) { + if (sliceIds_.isEmpty()) { + sliceIds_ = other.sliceIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSliceIdsIsMutable(); + sliceIds_.addAll(other.sliceIds_); + } + onChanged(); + } + } else { + if (!other.sliceIds_.isEmpty()) { + if (sliceIdsBuilder_.isEmpty()) { + sliceIdsBuilder_.dispose(); + sliceIdsBuilder_ = null; + sliceIds_ = other.sliceIds_; + bitField0_ = (bitField0_ & ~0x00000001); + sliceIdsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSliceIdsFieldBuilder() : null; + } else { + sliceIdsBuilder_.addAllMessages(other.sliceIds_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + context.ContextOuterClass.SliceIdList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.SliceIdList) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List<context.ContextOuterClass.SliceId> sliceIds_ = + java.util.Collections.emptyList(); + private void ensureSliceIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + sliceIds_ = new java.util.ArrayList<context.ContextOuterClass.SliceId>(sliceIds_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> sliceIdsBuilder_; + + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + public java.util.List<context.ContextOuterClass.SliceId> getSliceIdsList() { + if (sliceIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(sliceIds_); + } else { + return sliceIdsBuilder_.getMessageList(); + } + } + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + public int getSliceIdsCount() { + if (sliceIdsBuilder_ == null) { + return sliceIds_.size(); + } else { + return sliceIdsBuilder_.getCount(); + } + } + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + public context.ContextOuterClass.SliceId getSliceIds(int index) { + if (sliceIdsBuilder_ == null) { + return sliceIds_.get(index); + } else { + return sliceIdsBuilder_.getMessage(index); + } + } + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + public Builder setSliceIds( + int index, context.ContextOuterClass.SliceId value) { + if (sliceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceIdsIsMutable(); + sliceIds_.set(index, value); + onChanged(); + } else { + sliceIdsBuilder_.setMessage(index, value); + } + return this; + } + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + public Builder setSliceIds( + int index, context.ContextOuterClass.SliceId.Builder builderForValue) { + if (sliceIdsBuilder_ == null) { + ensureSliceIdsIsMutable(); + sliceIds_.set(index, builderForValue.build()); + onChanged(); + } else { + sliceIdsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + public Builder addSliceIds(context.ContextOuterClass.SliceId value) { + if (sliceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceIdsIsMutable(); + sliceIds_.add(value); + onChanged(); + } else { + sliceIdsBuilder_.addMessage(value); + } + return this; + } + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + public Builder addSliceIds( + int index, context.ContextOuterClass.SliceId value) { + if (sliceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceIdsIsMutable(); + sliceIds_.add(index, value); + onChanged(); + } else { + sliceIdsBuilder_.addMessage(index, value); + } + return this; + } + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + public Builder addSliceIds( + context.ContextOuterClass.SliceId.Builder builderForValue) { + if (sliceIdsBuilder_ == null) { + ensureSliceIdsIsMutable(); + sliceIds_.add(builderForValue.build()); + onChanged(); + } else { + sliceIdsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + public Builder addSliceIds( + int index, context.ContextOuterClass.SliceId.Builder builderForValue) { + if (sliceIdsBuilder_ == null) { + ensureSliceIdsIsMutable(); + sliceIds_.add(index, builderForValue.build()); + onChanged(); + } else { + sliceIdsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + public Builder addAllSliceIds( + java.lang.Iterable<? extends context.ContextOuterClass.SliceId> values) { + if (sliceIdsBuilder_ == null) { + ensureSliceIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, sliceIds_); + onChanged(); + } else { + sliceIdsBuilder_.addAllMessages(values); + } + return this; + } + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + public Builder clearSliceIds() { + if (sliceIdsBuilder_ == null) { + sliceIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + sliceIdsBuilder_.clear(); + } + return this; + } + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + public Builder removeSliceIds(int index) { + if (sliceIdsBuilder_ == null) { + ensureSliceIdsIsMutable(); + sliceIds_.remove(index); + onChanged(); + } else { + sliceIdsBuilder_.remove(index); + } + return this; + } + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + public context.ContextOuterClass.SliceId.Builder getSliceIdsBuilder( + int index) { + return getSliceIdsFieldBuilder().getBuilder(index); + } + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + public context.ContextOuterClass.SliceIdOrBuilder getSliceIdsOrBuilder( + int index) { + if (sliceIdsBuilder_ == null) { + return sliceIds_.get(index); } else { + return sliceIdsBuilder_.getMessageOrBuilder(index); + } + } + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + public java.util.List<? extends context.ContextOuterClass.SliceIdOrBuilder> + getSliceIdsOrBuilderList() { + if (sliceIdsBuilder_ != null) { + return sliceIdsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(sliceIds_); + } + } + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + public context.ContextOuterClass.SliceId.Builder addSliceIdsBuilder() { + return getSliceIdsFieldBuilder().addBuilder( + context.ContextOuterClass.SliceId.getDefaultInstance()); + } + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + public context.ContextOuterClass.SliceId.Builder addSliceIdsBuilder( + int index) { + return getSliceIdsFieldBuilder().addBuilder( + index, context.ContextOuterClass.SliceId.getDefaultInstance()); + } + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + public java.util.List<context.ContextOuterClass.SliceId.Builder> + getSliceIdsBuilderList() { + return getSliceIdsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> + getSliceIdsFieldBuilder() { + if (sliceIdsBuilder_ == null) { + sliceIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder>( + sliceIds_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + sliceIds_ = null; + } + return sliceIdsBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:context.SliceIdList) + } + + // @@protoc_insertion_point(class_scope:context.SliceIdList) + private static final context.ContextOuterClass.SliceIdList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.SliceIdList(); + } + + public static context.ContextOuterClass.SliceIdList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<SliceIdList> + PARSER = new com.google.protobuf.AbstractParser<SliceIdList>() { + @java.lang.Override + public SliceIdList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SliceIdList(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<SliceIdList> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<SliceIdList> getParserForType() { + return PARSER; + } + + @java.lang.Override + public context.ContextOuterClass.SliceIdList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SliceListOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.SliceList) + com.google.protobuf.MessageOrBuilder { + + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + java.util.List<context.ContextOuterClass.Slice> + getSlicesList(); + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + context.ContextOuterClass.Slice getSlices(int index); + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + int getSlicesCount(); + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + java.util.List<? extends context.ContextOuterClass.SliceOrBuilder> + getSlicesOrBuilderList(); + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + context.ContextOuterClass.SliceOrBuilder getSlicesOrBuilder( + int index); + } + /** + * Protobuf type {@code context.SliceList} + */ + public static final class SliceList extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.SliceList) + SliceListOrBuilder { + private static final long serialVersionUID = 0L; + // Use SliceList.newBuilder() to construct. + private SliceList(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private SliceList() { + slices_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SliceList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SliceList( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + slices_ = new java.util.ArrayList<context.ContextOuterClass.Slice>(); + mutable_bitField0_ |= 0x00000001; + } + slices_.add( + input.readMessage(context.ContextOuterClass.Slice.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + slices_ = java.util.Collections.unmodifiableList(slices_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_SliceList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_SliceList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.SliceList.class, context.ContextOuterClass.SliceList.Builder.class); + } + + public static final int SLICES_FIELD_NUMBER = 1; + private java.util.List<context.ContextOuterClass.Slice> slices_; + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + @java.lang.Override + public java.util.List<context.ContextOuterClass.Slice> getSlicesList() { + return slices_; + } + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + @java.lang.Override + public java.util.List<? extends context.ContextOuterClass.SliceOrBuilder> + getSlicesOrBuilderList() { + return slices_; + } + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + @java.lang.Override + public int getSlicesCount() { + return slices_.size(); + } + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + @java.lang.Override + public context.ContextOuterClass.Slice getSlices(int index) { + return slices_.get(index); + } + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + @java.lang.Override + public context.ContextOuterClass.SliceOrBuilder getSlicesOrBuilder( + int index) { + return slices_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < slices_.size(); i++) { + output.writeMessage(1, slices_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < slices_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, slices_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof context.ContextOuterClass.SliceList)) { + return super.equals(obj); + } + context.ContextOuterClass.SliceList other = (context.ContextOuterClass.SliceList) obj; + + if (!getSlicesList() + .equals(other.getSlicesList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getSlicesCount() > 0) { + hash = (37 * hash) + SLICES_FIELD_NUMBER; + hash = (53 * hash) + getSlicesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.SliceList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.SliceList parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.SliceList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.SliceList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.SliceList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.SliceList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.SliceList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.SliceList parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static context.ContextOuterClass.SliceList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.SliceList parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static context.ContextOuterClass.SliceList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.SliceList parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(context.ContextOuterClass.SliceList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code context.SliceList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:context.SliceList) + context.ContextOuterClass.SliceListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_SliceList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_SliceList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.SliceList.class, context.ContextOuterClass.SliceList.Builder.class); + } + + // Construct using context.ContextOuterClass.SliceList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getSlicesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (slicesBuilder_ == null) { + slices_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + slicesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_SliceList_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.SliceList getDefaultInstanceForType() { + return context.ContextOuterClass.SliceList.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.SliceList build() { + context.ContextOuterClass.SliceList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.SliceList buildPartial() { + context.ContextOuterClass.SliceList result = new context.ContextOuterClass.SliceList(this); + int from_bitField0_ = bitField0_; + if (slicesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + slices_ = java.util.Collections.unmodifiableList(slices_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.slices_ = slices_; + } else { + result.slices_ = slicesBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof context.ContextOuterClass.SliceList) { + return mergeFrom((context.ContextOuterClass.SliceList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.SliceList other) { + if (other == context.ContextOuterClass.SliceList.getDefaultInstance()) return this; + if (slicesBuilder_ == null) { + if (!other.slices_.isEmpty()) { + if (slices_.isEmpty()) { + slices_ = other.slices_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSlicesIsMutable(); + slices_.addAll(other.slices_); + } + onChanged(); + } + } else { + if (!other.slices_.isEmpty()) { + if (slicesBuilder_.isEmpty()) { + slicesBuilder_.dispose(); + slicesBuilder_ = null; + slices_ = other.slices_; + bitField0_ = (bitField0_ & ~0x00000001); + slicesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSlicesFieldBuilder() : null; + } else { + slicesBuilder_.addAllMessages(other.slices_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + context.ContextOuterClass.SliceList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.SliceList) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List<context.ContextOuterClass.Slice> slices_ = + java.util.Collections.emptyList(); + private void ensureSlicesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + slices_ = new java.util.ArrayList<context.ContextOuterClass.Slice>(slices_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Slice, context.ContextOuterClass.Slice.Builder, context.ContextOuterClass.SliceOrBuilder> slicesBuilder_; + + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + public java.util.List<context.ContextOuterClass.Slice> getSlicesList() { + if (slicesBuilder_ == null) { + return java.util.Collections.unmodifiableList(slices_); + } else { + return slicesBuilder_.getMessageList(); + } + } + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + public int getSlicesCount() { + if (slicesBuilder_ == null) { + return slices_.size(); + } else { + return slicesBuilder_.getCount(); + } + } + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + public context.ContextOuterClass.Slice getSlices(int index) { + if (slicesBuilder_ == null) { + return slices_.get(index); + } else { + return slicesBuilder_.getMessage(index); + } + } + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + public Builder setSlices( + int index, context.ContextOuterClass.Slice value) { + if (slicesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSlicesIsMutable(); + slices_.set(index, value); + onChanged(); + } else { + slicesBuilder_.setMessage(index, value); + } + return this; + } + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + public Builder setSlices( + int index, context.ContextOuterClass.Slice.Builder builderForValue) { + if (slicesBuilder_ == null) { + ensureSlicesIsMutable(); + slices_.set(index, builderForValue.build()); + onChanged(); + } else { + slicesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + public Builder addSlices(context.ContextOuterClass.Slice value) { + if (slicesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSlicesIsMutable(); + slices_.add(value); + onChanged(); + } else { + slicesBuilder_.addMessage(value); + } + return this; + } + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + public Builder addSlices( + int index, context.ContextOuterClass.Slice value) { + if (slicesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSlicesIsMutable(); + slices_.add(index, value); + onChanged(); + } else { + slicesBuilder_.addMessage(index, value); + } + return this; + } + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + public Builder addSlices( + context.ContextOuterClass.Slice.Builder builderForValue) { + if (slicesBuilder_ == null) { + ensureSlicesIsMutable(); + slices_.add(builderForValue.build()); + onChanged(); + } else { + slicesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + public Builder addSlices( + int index, context.ContextOuterClass.Slice.Builder builderForValue) { + if (slicesBuilder_ == null) { + ensureSlicesIsMutable(); + slices_.add(index, builderForValue.build()); + onChanged(); + } else { + slicesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + public Builder addAllSlices( + java.lang.Iterable<? extends context.ContextOuterClass.Slice> values) { + if (slicesBuilder_ == null) { + ensureSlicesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, slices_); + onChanged(); + } else { + slicesBuilder_.addAllMessages(values); + } + return this; + } + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + public Builder clearSlices() { + if (slicesBuilder_ == null) { + slices_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + slicesBuilder_.clear(); + } + return this; + } + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + public Builder removeSlices(int index) { + if (slicesBuilder_ == null) { + ensureSlicesIsMutable(); + slices_.remove(index); + onChanged(); + } else { + slicesBuilder_.remove(index); + } + return this; + } + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + public context.ContextOuterClass.Slice.Builder getSlicesBuilder( + int index) { + return getSlicesFieldBuilder().getBuilder(index); + } + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + public context.ContextOuterClass.SliceOrBuilder getSlicesOrBuilder( + int index) { + if (slicesBuilder_ == null) { + return slices_.get(index); } else { + return slicesBuilder_.getMessageOrBuilder(index); + } + } + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + public java.util.List<? extends context.ContextOuterClass.SliceOrBuilder> + getSlicesOrBuilderList() { + if (slicesBuilder_ != null) { + return slicesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(slices_); + } + } + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + public context.ContextOuterClass.Slice.Builder addSlicesBuilder() { + return getSlicesFieldBuilder().addBuilder( + context.ContextOuterClass.Slice.getDefaultInstance()); + } + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + public context.ContextOuterClass.Slice.Builder addSlicesBuilder( + int index) { + return getSlicesFieldBuilder().addBuilder( + index, context.ContextOuterClass.Slice.getDefaultInstance()); + } + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + public java.util.List<context.ContextOuterClass.Slice.Builder> + getSlicesBuilderList() { + return getSlicesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Slice, context.ContextOuterClass.Slice.Builder, context.ContextOuterClass.SliceOrBuilder> + getSlicesFieldBuilder() { + if (slicesBuilder_ == null) { + slicesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Slice, context.ContextOuterClass.Slice.Builder, context.ContextOuterClass.SliceOrBuilder>( + slices_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + slices_ = null; + } + return slicesBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:context.SliceList) + } + + // @@protoc_insertion_point(class_scope:context.SliceList) + private static final context.ContextOuterClass.SliceList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.SliceList(); + } + + public static context.ContextOuterClass.SliceList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<SliceList> + PARSER = new com.google.protobuf.AbstractParser<SliceList>() { + @java.lang.Override + public SliceList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SliceList(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<SliceList> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<SliceList> getParserForType() { + return PARSER; + } + + @java.lang.Override + public context.ContextOuterClass.SliceList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SliceEventOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.SliceEvent) + com.google.protobuf.MessageOrBuilder { + + /** + * <code>.context.Event event = 1;</code> + * @return Whether the event field is set. + */ + boolean hasEvent(); + /** + * <code>.context.Event event = 1;</code> + * @return The event. + */ + context.ContextOuterClass.Event getEvent(); + /** + * <code>.context.Event event = 1;</code> + */ + context.ContextOuterClass.EventOrBuilder getEventOrBuilder(); + + /** + * <code>.context.SliceId slice_id = 2;</code> + * @return Whether the sliceId field is set. + */ + boolean hasSliceId(); + /** + * <code>.context.SliceId slice_id = 2;</code> + * @return The sliceId. + */ + context.ContextOuterClass.SliceId getSliceId(); + /** + * <code>.context.SliceId slice_id = 2;</code> + */ + context.ContextOuterClass.SliceIdOrBuilder getSliceIdOrBuilder(); + } + /** + * Protobuf type {@code context.SliceEvent} + */ + public static final class SliceEvent extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.SliceEvent) + SliceEventOrBuilder { + private static final long serialVersionUID = 0L; + // Use SliceEvent.newBuilder() to construct. + private SliceEvent(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private SliceEvent() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SliceEvent(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SliceEvent( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + context.ContextOuterClass.Event.Builder subBuilder = null; + if (event_ != null) { + subBuilder = event_.toBuilder(); + } + event_ = input.readMessage(context.ContextOuterClass.Event.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(event_); + event_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + context.ContextOuterClass.SliceId.Builder subBuilder = null; + if (sliceId_ != null) { + subBuilder = sliceId_.toBuilder(); + } + sliceId_ = input.readMessage(context.ContextOuterClass.SliceId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(sliceId_); + sliceId_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_SliceEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_SliceEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.SliceEvent.class, context.ContextOuterClass.SliceEvent.Builder.class); + } + + public static final int EVENT_FIELD_NUMBER = 1; + private context.ContextOuterClass.Event event_; + /** + * <code>.context.Event event = 1;</code> + * @return Whether the event field is set. + */ + @java.lang.Override + public boolean hasEvent() { + return event_ != null; + } + /** + * <code>.context.Event event = 1;</code> + * @return The event. + */ + @java.lang.Override + public context.ContextOuterClass.Event getEvent() { + return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; + } + /** + * <code>.context.Event event = 1;</code> + */ + @java.lang.Override + public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { + return getEvent(); + } + + public static final int SLICE_ID_FIELD_NUMBER = 2; + private context.ContextOuterClass.SliceId sliceId_; + /** + * <code>.context.SliceId slice_id = 2;</code> + * @return Whether the sliceId field is set. + */ + @java.lang.Override + public boolean hasSliceId() { + return sliceId_ != null; + } + /** + * <code>.context.SliceId slice_id = 2;</code> + * @return The sliceId. + */ + @java.lang.Override + public context.ContextOuterClass.SliceId getSliceId() { + return sliceId_ == null ? context.ContextOuterClass.SliceId.getDefaultInstance() : sliceId_; + } + /** + * <code>.context.SliceId slice_id = 2;</code> + */ + @java.lang.Override + public context.ContextOuterClass.SliceIdOrBuilder getSliceIdOrBuilder() { + return getSliceId(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (event_ != null) { + output.writeMessage(1, getEvent()); + } + if (sliceId_ != null) { + output.writeMessage(2, getSliceId()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (event_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getEvent()); + } + if (sliceId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getSliceId()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof context.ContextOuterClass.SliceEvent)) { + return super.equals(obj); + } + context.ContextOuterClass.SliceEvent other = (context.ContextOuterClass.SliceEvent) obj; + + if (hasEvent() != other.hasEvent()) return false; + if (hasEvent()) { + if (!getEvent() + .equals(other.getEvent())) return false; + } + if (hasSliceId() != other.hasSliceId()) return false; + if (hasSliceId()) { + if (!getSliceId() + .equals(other.getSliceId())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasEvent()) { + hash = (37 * hash) + EVENT_FIELD_NUMBER; + hash = (53 * hash) + getEvent().hashCode(); + } + if (hasSliceId()) { + hash = (37 * hash) + SLICE_ID_FIELD_NUMBER; + hash = (53 * hash) + getSliceId().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.SliceEvent parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.SliceEvent parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.SliceEvent parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.SliceEvent parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.SliceEvent parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.SliceEvent parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.SliceEvent parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.SliceEvent parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static context.ContextOuterClass.SliceEvent parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.SliceEvent parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static context.ContextOuterClass.SliceEvent parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.SliceEvent parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(context.ContextOuterClass.SliceEvent prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code context.SliceEvent} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:context.SliceEvent) + context.ContextOuterClass.SliceEventOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_SliceEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_SliceEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.SliceEvent.class, context.ContextOuterClass.SliceEvent.Builder.class); + } + + // Construct using context.ContextOuterClass.SliceEvent.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (eventBuilder_ == null) { + event_ = null; + } else { + event_ = null; + eventBuilder_ = null; + } + if (sliceIdBuilder_ == null) { + sliceId_ = null; + } else { + sliceId_ = null; + sliceIdBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_SliceEvent_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.SliceEvent getDefaultInstanceForType() { + return context.ContextOuterClass.SliceEvent.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.SliceEvent build() { + context.ContextOuterClass.SliceEvent result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.SliceEvent buildPartial() { + context.ContextOuterClass.SliceEvent result = new context.ContextOuterClass.SliceEvent(this); + if (eventBuilder_ == null) { + result.event_ = event_; + } else { + result.event_ = eventBuilder_.build(); + } + if (sliceIdBuilder_ == null) { + result.sliceId_ = sliceId_; + } else { + result.sliceId_ = sliceIdBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof context.ContextOuterClass.SliceEvent) { + return mergeFrom((context.ContextOuterClass.SliceEvent)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.SliceEvent other) { + if (other == context.ContextOuterClass.SliceEvent.getDefaultInstance()) return this; + if (other.hasEvent()) { + mergeEvent(other.getEvent()); + } + if (other.hasSliceId()) { + mergeSliceId(other.getSliceId()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + context.ContextOuterClass.SliceEvent parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.SliceEvent) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private context.ContextOuterClass.Event event_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> eventBuilder_; + /** + * <code>.context.Event event = 1;</code> + * @return Whether the event field is set. + */ + public boolean hasEvent() { + return eventBuilder_ != null || event_ != null; + } + /** + * <code>.context.Event event = 1;</code> + * @return The event. + */ + public context.ContextOuterClass.Event getEvent() { + if (eventBuilder_ == null) { + return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; + } else { + return eventBuilder_.getMessage(); + } + } + /** + * <code>.context.Event event = 1;</code> + */ + public Builder setEvent(context.ContextOuterClass.Event value) { + if (eventBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + event_ = value; + onChanged(); + } else { + eventBuilder_.setMessage(value); + } + + return this; + } + /** + * <code>.context.Event event = 1;</code> + */ + public Builder setEvent( + context.ContextOuterClass.Event.Builder builderForValue) { + if (eventBuilder_ == null) { + event_ = builderForValue.build(); + onChanged(); + } else { + eventBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * <code>.context.Event event = 1;</code> + */ + public Builder mergeEvent(context.ContextOuterClass.Event value) { + if (eventBuilder_ == null) { + if (event_ != null) { + event_ = + context.ContextOuterClass.Event.newBuilder(event_).mergeFrom(value).buildPartial(); + } else { + event_ = value; + } + onChanged(); + } else { + eventBuilder_.mergeFrom(value); + } + + return this; + } + /** + * <code>.context.Event event = 1;</code> + */ + public Builder clearEvent() { + if (eventBuilder_ == null) { + event_ = null; + onChanged(); + } else { + event_ = null; + eventBuilder_ = null; + } + + return this; + } + /** + * <code>.context.Event event = 1;</code> + */ + public context.ContextOuterClass.Event.Builder getEventBuilder() { + + onChanged(); + return getEventFieldBuilder().getBuilder(); + } + /** + * <code>.context.Event event = 1;</code> + */ + public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { + if (eventBuilder_ != null) { + return eventBuilder_.getMessageOrBuilder(); + } else { + return event_ == null ? + context.ContextOuterClass.Event.getDefaultInstance() : event_; + } + } + /** + * <code>.context.Event event = 1;</code> + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> + getEventFieldBuilder() { + if (eventBuilder_ == null) { + eventBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder>( + getEvent(), + getParentForChildren(), + isClean()); + event_ = null; + } + return eventBuilder_; + } + + private context.ContextOuterClass.SliceId sliceId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> sliceIdBuilder_; + /** + * <code>.context.SliceId slice_id = 2;</code> + * @return Whether the sliceId field is set. + */ + public boolean hasSliceId() { + return sliceIdBuilder_ != null || sliceId_ != null; + } + /** + * <code>.context.SliceId slice_id = 2;</code> + * @return The sliceId. + */ + public context.ContextOuterClass.SliceId getSliceId() { + if (sliceIdBuilder_ == null) { + return sliceId_ == null ? context.ContextOuterClass.SliceId.getDefaultInstance() : sliceId_; + } else { + return sliceIdBuilder_.getMessage(); + } + } + /** + * <code>.context.SliceId slice_id = 2;</code> + */ + public Builder setSliceId(context.ContextOuterClass.SliceId value) { + if (sliceIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sliceId_ = value; + onChanged(); + } else { + sliceIdBuilder_.setMessage(value); + } + + return this; + } + /** + * <code>.context.SliceId slice_id = 2;</code> + */ + public Builder setSliceId( + context.ContextOuterClass.SliceId.Builder builderForValue) { + if (sliceIdBuilder_ == null) { + sliceId_ = builderForValue.build(); + onChanged(); + } else { + sliceIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * <code>.context.SliceId slice_id = 2;</code> + */ + public Builder mergeSliceId(context.ContextOuterClass.SliceId value) { + if (sliceIdBuilder_ == null) { + if (sliceId_ != null) { + sliceId_ = + context.ContextOuterClass.SliceId.newBuilder(sliceId_).mergeFrom(value).buildPartial(); + } else { + sliceId_ = value; + } + onChanged(); + } else { + sliceIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * <code>.context.SliceId slice_id = 2;</code> + */ + public Builder clearSliceId() { + if (sliceIdBuilder_ == null) { + sliceId_ = null; + onChanged(); + } else { + sliceId_ = null; + sliceIdBuilder_ = null; + } + + return this; + } + /** + * <code>.context.SliceId slice_id = 2;</code> + */ + public context.ContextOuterClass.SliceId.Builder getSliceIdBuilder() { + + onChanged(); + return getSliceIdFieldBuilder().getBuilder(); + } + /** + * <code>.context.SliceId slice_id = 2;</code> + */ + public context.ContextOuterClass.SliceIdOrBuilder getSliceIdOrBuilder() { + if (sliceIdBuilder_ != null) { + return sliceIdBuilder_.getMessageOrBuilder(); + } else { + return sliceId_ == null ? + context.ContextOuterClass.SliceId.getDefaultInstance() : sliceId_; + } + } + /** + * <code>.context.SliceId slice_id = 2;</code> + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> + getSliceIdFieldBuilder() { + if (sliceIdBuilder_ == null) { + sliceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder>( + getSliceId(), + getParentForChildren(), + isClean()); + sliceId_ = null; + } + return sliceIdBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:context.SliceEvent) + } + + // @@protoc_insertion_point(class_scope:context.SliceEvent) + private static final context.ContextOuterClass.SliceEvent DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.SliceEvent(); + } + + public static context.ContextOuterClass.SliceEvent getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<SliceEvent> + PARSER = new com.google.protobuf.AbstractParser<SliceEvent>() { + @java.lang.Override + public SliceEvent parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SliceEvent(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<SliceEvent> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<SliceEvent> getParserForType() { + return PARSER; + } + + @java.lang.Override + public context.ContextOuterClass.SliceEvent getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ConnectionIdOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ConnectionId) + com.google.protobuf.MessageOrBuilder { + + /** + * <code>.context.Uuid connection_uuid = 1;</code> + * @return Whether the connectionUuid field is set. + */ + boolean hasConnectionUuid(); + /** + * <code>.context.Uuid connection_uuid = 1;</code> + * @return The connectionUuid. + */ + context.ContextOuterClass.Uuid getConnectionUuid(); + /** + * <code>.context.Uuid connection_uuid = 1;</code> + */ + context.ContextOuterClass.UuidOrBuilder getConnectionUuidOrBuilder(); + } + /** + * <pre> + * ----- Connection ---------------------------------------------------------------------------------------------------- + * </pre> + * + * Protobuf type {@code context.ConnectionId} + */ + public static final class ConnectionId extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.ConnectionId) + ConnectionIdOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConnectionId.newBuilder() to construct. + private ConnectionId(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private ConnectionId() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ConnectionId(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ConnectionId( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + context.ContextOuterClass.Uuid.Builder subBuilder = null; + if (connectionUuid_ != null) { + subBuilder = connectionUuid_.toBuilder(); + } + connectionUuid_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(connectionUuid_); + connectionUuid_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_ConnectionId_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ConnectionId_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ConnectionId.class, context.ContextOuterClass.ConnectionId.Builder.class); + } + + public static final int CONNECTION_UUID_FIELD_NUMBER = 1; + private context.ContextOuterClass.Uuid connectionUuid_; + /** + * <code>.context.Uuid connection_uuid = 1;</code> + * @return Whether the connectionUuid field is set. + */ + @java.lang.Override + public boolean hasConnectionUuid() { + return connectionUuid_ != null; + } + /** + * <code>.context.Uuid connection_uuid = 1;</code> + * @return The connectionUuid. + */ + @java.lang.Override + public context.ContextOuterClass.Uuid getConnectionUuid() { + return connectionUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : connectionUuid_; + } + /** + * <code>.context.Uuid connection_uuid = 1;</code> + */ + @java.lang.Override + public context.ContextOuterClass.UuidOrBuilder getConnectionUuidOrBuilder() { + return getConnectionUuid(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (connectionUuid_ != null) { + output.writeMessage(1, getConnectionUuid()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (connectionUuid_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getConnectionUuid()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof context.ContextOuterClass.ConnectionId)) { + return super.equals(obj); + } + context.ContextOuterClass.ConnectionId other = (context.ContextOuterClass.ConnectionId) obj; + + if (hasConnectionUuid() != other.hasConnectionUuid()) return false; + if (hasConnectionUuid()) { + if (!getConnectionUuid() + .equals(other.getConnectionUuid())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasConnectionUuid()) { + hash = (37 * hash) + CONNECTION_UUID_FIELD_NUMBER; + hash = (53 * hash) + getConnectionUuid().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.ConnectionId parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ConnectionId parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ConnectionId parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ConnectionId parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ConnectionId parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ConnectionId parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ConnectionId parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ConnectionId parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static context.ContextOuterClass.ConnectionId parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ConnectionId parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static context.ContextOuterClass.ConnectionId parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ConnectionId parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(context.ContextOuterClass.ConnectionId prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * <pre> + * ----- Connection ---------------------------------------------------------------------------------------------------- + * </pre> + * + * Protobuf type {@code context.ConnectionId} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:context.ConnectionId) + context.ContextOuterClass.ConnectionIdOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_ConnectionId_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ConnectionId_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ConnectionId.class, context.ContextOuterClass.ConnectionId.Builder.class); + } + + // Construct using context.ContextOuterClass.ConnectionId.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (connectionUuidBuilder_ == null) { + connectionUuid_ = null; + } else { + connectionUuid_ = null; + connectionUuidBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_ConnectionId_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.ConnectionId getDefaultInstanceForType() { + return context.ContextOuterClass.ConnectionId.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.ConnectionId build() { + context.ContextOuterClass.ConnectionId result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.ConnectionId buildPartial() { + context.ContextOuterClass.ConnectionId result = new context.ContextOuterClass.ConnectionId(this); + if (connectionUuidBuilder_ == null) { + result.connectionUuid_ = connectionUuid_; + } else { + result.connectionUuid_ = connectionUuidBuilder_.build(); } onBuilt(); return result; @@ -37615,6 +43832,36 @@ public final class ContextOuterClass { private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_context_ServiceEvent_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_SliceId_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_SliceId_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_Slice_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_Slice_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_SliceStatus_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_SliceStatus_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_SliceIdList_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_SliceIdList_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_SliceList_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_SliceList_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_SliceEvent_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_SliceEvent_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_context_ConnectionId_descriptor; private static final @@ -37744,107 +43991,134 @@ public final class ContextOuterClass { "\"\n\010services\030\001 \003(\0132\020.context.Service\"U\n\014S" + "erviceEvent\022\035\n\005event\030\001 \001(\0132\016.context.Eve" + "nt\022&\n\nservice_id\030\002 \001(\0132\022.context.Service" + - "Id\"6\n\014ConnectionId\022&\n\017connection_uuid\030\001 " + - "\001(\0132\r.context.Uuid\"\304\001\n\nConnection\022,\n\rcon" + - "nection_id\030\001 \001(\0132\025.context.ConnectionId\022" + - "&\n\nservice_id\030\002 \001(\0132\022.context.ServiceId\022" + - "3\n\026path_hops_endpoint_ids\030\003 \003(\0132\023.contex" + - "t.EndPointId\022+\n\017sub_service_ids\030\004 \003(\0132\022." + - "context.ServiceId\"A\n\020ConnectionIdList\022-\n" + - "\016connection_ids\030\001 \003(\0132\025.context.Connecti" + - "onId\":\n\016ConnectionList\022(\n\013connections\030\001 " + - "\003(\0132\023.context.Connection\"^\n\017ConnectionEv" + - "ent\022\035\n\005event\030\001 \001(\0132\016.context.Event\022,\n\rco" + - "nnection_id\030\002 \001(\0132\025.context.ConnectionId" + - "\"\202\001\n\nEndPointId\022(\n\013topology_id\030\001 \001(\0132\023.c" + - "ontext.TopologyId\022$\n\tdevice_id\030\002 \001(\0132\021.c" + - "ontext.DeviceId\022$\n\rendpoint_uuid\030\003 \001(\0132\r" + - ".context.Uuid\"\206\001\n\010EndPoint\022(\n\013endpoint_i" + - "d\030\001 \001(\0132\023.context.EndPointId\022\025\n\rendpoint" + - "_type\030\002 \001(\t\0229\n\020kpi_sample_types\030\003 \003(\0162\037." + - "kpi_sample_types.KpiSampleType\"e\n\nConfig" + - "Rule\022)\n\006action\030\001 \001(\0162\031.context.ConfigAct" + - "ionEnum\022\024\n\014resource_key\030\002 \001(\t\022\026\n\016resourc" + - "e_value\030\003 \001(\t\"?\n\nConstraint\022\027\n\017constrain" + - "t_type\030\001 \001(\t\022\030\n\020constraint_value\030\002 \001(\t\"^" + - "\n\022TeraFlowController\022&\n\ncontext_id\030\001 \001(\013" + - "2\022.context.ContextId\022\022\n\nip_address\030\002 \001(\t" + - "\022\014\n\004port\030\003 \001(\r\"U\n\024AuthenticationResult\022&" + - "\n\ncontext_id\030\001 \001(\0132\022.context.ContextId\022\025" + - "\n\rauthenticated\030\002 \001(\010*j\n\rEventTypeEnum\022\027" + - "\n\023EVENTTYPE_UNDEFINED\020\000\022\024\n\020EVENTTYPE_CRE" + - "ATE\020\001\022\024\n\020EVENTTYPE_UPDATE\020\002\022\024\n\020EVENTTYPE" + - "_REMOVE\020\003*\305\001\n\020DeviceDriverEnum\022\032\n\026DEVICE" + - "DRIVER_UNDEFINED\020\000\022\033\n\027DEVICEDRIVER_OPENC" + - "ONFIG\020\001\022\036\n\032DEVICEDRIVER_TRANSPORT_API\020\002\022" + - "\023\n\017DEVICEDRIVER_P4\020\003\022&\n\"DEVICEDRIVER_IET" + - "F_NETWORK_TOPOLOGY\020\004\022\033\n\027DEVICEDRIVER_ONF" + - "_TR_352\020\005*\217\001\n\033DeviceOperationalStatusEnu" + - "m\022%\n!DEVICEOPERATIONALSTATUS_UNDEFINED\020\000" + - "\022$\n DEVICEOPERATIONALSTATUS_DISABLED\020\001\022#" + - "\n\037DEVICEOPERATIONALSTATUS_ENABLED\020\002*\201\001\n\017" + - "ServiceTypeEnum\022\027\n\023SERVICETYPE_UNKNOWN\020\000" + - "\022\024\n\020SERVICETYPE_L3NM\020\001\022\024\n\020SERVICETYPE_L2" + - "NM\020\002\022)\n%SERVICETYPE_TAPI_CONNECTIVITY_SE" + - "RVICE\020\003*\210\001\n\021ServiceStatusEnum\022\033\n\027SERVICE" + - "STATUS_UNDEFINED\020\000\022\031\n\025SERVICESTATUS_PLAN" + - "NED\020\001\022\030\n\024SERVICESTATUS_ACTIVE\020\002\022!\n\035SERVI" + - "CESTATUS_PENDING_REMOVAL\020\003*]\n\020ConfigActi" + - "onEnum\022\032\n\026CONFIGACTION_UNDEFINED\020\000\022\024\n\020CO" + - "NFIGACTION_SET\020\001\022\027\n\023CONFIGACTION_DELETE\020" + - "\0022\255\020\n\016ContextService\022:\n\016ListContextIds\022\016" + - ".context.Empty\032\026.context.ContextIdList\"\000" + - "\0226\n\014ListContexts\022\016.context.Empty\032\024.conte" + - "xt.ContextList\"\000\0224\n\nGetContext\022\022.context" + - ".ContextId\032\020.context.Context\"\000\0224\n\nSetCon" + - "text\022\020.context.Context\032\022.context.Context" + - "Id\"\000\0225\n\rRemoveContext\022\022.context.ContextI" + - "d\032\016.context.Empty\"\000\022=\n\020GetContextEvents\022" + - "\016.context.Empty\032\025.context.ContextEvent\"\000" + - "0\001\022@\n\017ListTopologyIds\022\022.context.ContextI" + - "d\032\027.context.TopologyIdList\"\000\022=\n\016ListTopo" + - "logies\022\022.context.ContextId\032\025.context.Top" + - "ologyList\"\000\0227\n\013GetTopology\022\023.context.Top" + - "ologyId\032\021.context.Topology\"\000\0227\n\013SetTopol" + - "ogy\022\021.context.Topology\032\023.context.Topolog" + - "yId\"\000\0227\n\016RemoveTopology\022\023.context.Topolo" + - "gyId\032\016.context.Empty\"\000\022?\n\021GetTopologyEve" + - "nts\022\016.context.Empty\032\026.context.TopologyEv" + - "ent\"\0000\001\0228\n\rListDeviceIds\022\016.context.Empty" + - "\032\025.context.DeviceIdList\"\000\0224\n\013ListDevices" + - "\022\016.context.Empty\032\023.context.DeviceList\"\000\022" + - "1\n\tGetDevice\022\021.context.DeviceId\032\017.contex" + - "t.Device\"\000\0221\n\tSetDevice\022\017.context.Device" + - "\032\021.context.DeviceId\"\000\0223\n\014RemoveDevice\022\021." + - "context.DeviceId\032\016.context.Empty\"\000\022;\n\017Ge" + - "tDeviceEvents\022\016.context.Empty\032\024.context." + - "DeviceEvent\"\0000\001\0224\n\013ListLinkIds\022\016.context" + - ".Empty\032\023.context.LinkIdList\"\000\0220\n\tListLin" + - "ks\022\016.context.Empty\032\021.context.LinkList\"\000\022" + - "+\n\007GetLink\022\017.context.LinkId\032\r.context.Li" + - "nk\"\000\022+\n\007SetLink\022\r.context.Link\032\017.context" + - ".LinkId\"\000\022/\n\nRemoveLink\022\017.context.LinkId" + - "\032\016.context.Empty\"\000\0227\n\rGetLinkEvents\022\016.co" + - "ntext.Empty\032\022.context.LinkEvent\"\0000\001\022>\n\016L" + - "istServiceIds\022\022.context.ContextId\032\026.cont" + - "ext.ServiceIdList\"\000\022:\n\014ListServices\022\022.co" + - "ntext.ContextId\032\024.context.ServiceList\"\000\022" + - "4\n\nGetService\022\022.context.ServiceId\032\020.cont" + - "ext.Service\"\000\0224\n\nSetService\022\020.context.Se" + - "rvice\032\022.context.ServiceId\"\000\0225\n\rRemoveSer" + - "vice\022\022.context.ServiceId\032\016.context.Empty" + - "\"\000\022=\n\020GetServiceEvents\022\016.context.Empty\032\025" + - ".context.ServiceEvent\"\0000\001\022D\n\021ListConnect" + - "ionIds\022\022.context.ServiceId\032\031.context.Con" + - "nectionIdList\"\000\022@\n\017ListConnections\022\022.con" + - "text.ServiceId\032\027.context.ConnectionList\"" + - "\000\022=\n\rGetConnection\022\025.context.ConnectionI" + - "d\032\023.context.Connection\"\000\022=\n\rSetConnectio" + - "n\022\023.context.Connection\032\025.context.Connect" + - "ionId\"\000\022;\n\020RemoveConnection\022\025.context.Co" + - "nnectionId\032\016.context.Empty\"\000\022C\n\023GetConne" + - "ctionEvents\022\016.context.Empty\032\030.context.Co" + - "nnectionEvent\"\0000\001b\006proto3" + "Id\"T\n\007SliceId\022&\n\ncontext_id\030\001 \001(\0132\022.cont" + + "ext.ContextId\022!\n\nslice_uuid\030\002 \001(\0132\r.cont" + + "ext.Uuid\"\225\002\n\005Slice\022\"\n\010slice_id\030\001 \001(\0132\020.c" + + "ontext.SliceId\022/\n\022slice_endpoint_ids\030\002 \003" + + "(\0132\023.context.EndPointId\022.\n\021slice_constra" + + "ints\030\003 \003(\0132\023.context.Constraint\022-\n\021slice" + + "_service_ids\030\004 \003(\0132\022.context.ServiceId\022," + + "\n\022slice_subslice_ids\030\005 \003(\0132\020.context.Sli" + + "ceId\022*\n\014slice_status\030\006 \001(\0132\024.context.Sli" + + "ceStatus\"=\n\013SliceStatus\022.\n\014slice_status\030" + + "\001 \001(\0162\030.context.SliceStatusEnum\"2\n\013Slice" + + "IdList\022#\n\tslice_ids\030\001 \003(\0132\020.context.Slic" + + "eId\"+\n\tSliceList\022\036\n\006slices\030\001 \003(\0132\016.conte" + + "xt.Slice\"O\n\nSliceEvent\022\035\n\005event\030\001 \001(\0132\016." + + "context.Event\022\"\n\010slice_id\030\002 \001(\0132\020.contex" + + "t.SliceId\"6\n\014ConnectionId\022&\n\017connection_" + + "uuid\030\001 \001(\0132\r.context.Uuid\"\304\001\n\nConnection" + + "\022,\n\rconnection_id\030\001 \001(\0132\025.context.Connec" + + "tionId\022&\n\nservice_id\030\002 \001(\0132\022.context.Ser" + + "viceId\0223\n\026path_hops_endpoint_ids\030\003 \003(\0132\023" + + ".context.EndPointId\022+\n\017sub_service_ids\030\004" + + " \003(\0132\022.context.ServiceId\"A\n\020ConnectionId" + + "List\022-\n\016connection_ids\030\001 \003(\0132\025.context.C" + + "onnectionId\":\n\016ConnectionList\022(\n\013connect" + + "ions\030\001 \003(\0132\023.context.Connection\"^\n\017Conne" + + "ctionEvent\022\035\n\005event\030\001 \001(\0132\016.context.Even" + + "t\022,\n\rconnection_id\030\002 \001(\0132\025.context.Conne" + + "ctionId\"\202\001\n\nEndPointId\022(\n\013topology_id\030\001 " + + "\001(\0132\023.context.TopologyId\022$\n\tdevice_id\030\002 " + + "\001(\0132\021.context.DeviceId\022$\n\rendpoint_uuid\030" + + "\003 \001(\0132\r.context.Uuid\"\206\001\n\010EndPoint\022(\n\013end" + + "point_id\030\001 \001(\0132\023.context.EndPointId\022\025\n\re" + + "ndpoint_type\030\002 \001(\t\0229\n\020kpi_sample_types\030\003" + + " \003(\0162\037.kpi_sample_types.KpiSampleType\"e\n" + + "\nConfigRule\022)\n\006action\030\001 \001(\0162\031.context.Co" + + "nfigActionEnum\022\024\n\014resource_key\030\002 \001(\t\022\026\n\016" + + "resource_value\030\003 \001(\t\"?\n\nConstraint\022\027\n\017co" + + "nstraint_type\030\001 \001(\t\022\030\n\020constraint_value\030" + + "\002 \001(\t\"^\n\022TeraFlowController\022&\n\ncontext_i" + + "d\030\001 \001(\0132\022.context.ContextId\022\022\n\nip_addres" + + "s\030\002 \001(\t\022\014\n\004port\030\003 \001(\r\"U\n\024AuthenticationR" + + "esult\022&\n\ncontext_id\030\001 \001(\0132\022.context.Cont" + + "extId\022\025\n\rauthenticated\030\002 \001(\010*j\n\rEventTyp" + + "eEnum\022\027\n\023EVENTTYPE_UNDEFINED\020\000\022\024\n\020EVENTT" + + "YPE_CREATE\020\001\022\024\n\020EVENTTYPE_UPDATE\020\002\022\024\n\020EV" + + "ENTTYPE_REMOVE\020\003*\305\001\n\020DeviceDriverEnum\022\032\n" + + "\026DEVICEDRIVER_UNDEFINED\020\000\022\033\n\027DEVICEDRIVE" + + "R_OPENCONFIG\020\001\022\036\n\032DEVICEDRIVER_TRANSPORT" + + "_API\020\002\022\023\n\017DEVICEDRIVER_P4\020\003\022&\n\"DEVICEDRI" + + "VER_IETF_NETWORK_TOPOLOGY\020\004\022\033\n\027DEVICEDRI" + + "VER_ONF_TR_352\020\005*\217\001\n\033DeviceOperationalSt" + + "atusEnum\022%\n!DEVICEOPERATIONALSTATUS_UNDE" + + "FINED\020\000\022$\n DEVICEOPERATIONALSTATUS_DISAB" + + "LED\020\001\022#\n\037DEVICEOPERATIONALSTATUS_ENABLED" + + "\020\002*\201\001\n\017ServiceTypeEnum\022\027\n\023SERVICETYPE_UN" + + "KNOWN\020\000\022\024\n\020SERVICETYPE_L3NM\020\001\022\024\n\020SERVICE" + + "TYPE_L2NM\020\002\022)\n%SERVICETYPE_TAPI_CONNECTI" + + "VITY_SERVICE\020\003*\210\001\n\021ServiceStatusEnum\022\033\n\027" + + "SERVICESTATUS_UNDEFINED\020\000\022\031\n\025SERVICESTAT" + + "US_PLANNED\020\001\022\030\n\024SERVICESTATUS_ACTIVE\020\002\022!" + + "\n\035SERVICESTATUS_PENDING_REMOVAL\020\003*\213\001\n\017Sl" + + "iceStatusEnum\022\031\n\025SLICESTATUS_UNDEFINED\020\000" + + "\022\027\n\023SLICESTATUS_PLANNED\020\001\022\024\n\020SLICESTATUS" + + "_INIT\020\002\022\026\n\022SLICESTATUS_ACTIVE\020\003\022\026\n\022SLICE" + + "STATUS_DEINIT\020\004*]\n\020ConfigActionEnum\022\032\n\026C" + + "ONFIGACTION_UNDEFINED\020\000\022\024\n\020CONFIGACTION_" + + "SET\020\001\022\027\n\023CONFIGACTION_DELETE\020\0022\357\022\n\016Conte" + + "xtService\022:\n\016ListContextIds\022\016.context.Em" + + "pty\032\026.context.ContextIdList\"\000\0226\n\014ListCon" + + "texts\022\016.context.Empty\032\024.context.ContextL" + + "ist\"\000\0224\n\nGetContext\022\022.context.ContextId\032" + + "\020.context.Context\"\000\0224\n\nSetContext\022\020.cont" + + "ext.Context\032\022.context.ContextId\"\000\0225\n\rRem" + + "oveContext\022\022.context.ContextId\032\016.context" + + ".Empty\"\000\022=\n\020GetContextEvents\022\016.context.E" + + "mpty\032\025.context.ContextEvent\"\0000\001\022@\n\017ListT" + + "opologyIds\022\022.context.ContextId\032\027.context" + + ".TopologyIdList\"\000\022=\n\016ListTopologies\022\022.co" + + "ntext.ContextId\032\025.context.TopologyList\"\000" + + "\0227\n\013GetTopology\022\023.context.TopologyId\032\021.c" + + "ontext.Topology\"\000\0227\n\013SetTopology\022\021.conte" + + "xt.Topology\032\023.context.TopologyId\"\000\0227\n\016Re" + + "moveTopology\022\023.context.TopologyId\032\016.cont" + + "ext.Empty\"\000\022?\n\021GetTopologyEvents\022\016.conte" + + "xt.Empty\032\026.context.TopologyEvent\"\0000\001\0228\n\r" + + "ListDeviceIds\022\016.context.Empty\032\025.context." + + "DeviceIdList\"\000\0224\n\013ListDevices\022\016.context." + + "Empty\032\023.context.DeviceList\"\000\0221\n\tGetDevic" + + "e\022\021.context.DeviceId\032\017.context.Device\"\000\022" + + "1\n\tSetDevice\022\017.context.Device\032\021.context." + + "DeviceId\"\000\0223\n\014RemoveDevice\022\021.context.Dev" + + "iceId\032\016.context.Empty\"\000\022;\n\017GetDeviceEven" + + "ts\022\016.context.Empty\032\024.context.DeviceEvent" + + "\"\0000\001\0224\n\013ListLinkIds\022\016.context.Empty\032\023.co" + + "ntext.LinkIdList\"\000\0220\n\tListLinks\022\016.contex" + + "t.Empty\032\021.context.LinkList\"\000\022+\n\007GetLink\022" + + "\017.context.LinkId\032\r.context.Link\"\000\022+\n\007Set" + + "Link\022\r.context.Link\032\017.context.LinkId\"\000\022/" + + "\n\nRemoveLink\022\017.context.LinkId\032\016.context." + + "Empty\"\000\0227\n\rGetLinkEvents\022\016.context.Empty" + + "\032\022.context.LinkEvent\"\0000\001\022>\n\016ListServiceI" + + "ds\022\022.context.ContextId\032\026.context.Service" + + "IdList\"\000\022:\n\014ListServices\022\022.context.Conte" + + "xtId\032\024.context.ServiceList\"\000\0224\n\nGetServi" + + "ce\022\022.context.ServiceId\032\020.context.Service" + + "\"\000\0224\n\nSetService\022\020.context.Service\032\022.con" + + "text.ServiceId\"\000\0225\n\rRemoveService\022\022.cont" + + "ext.ServiceId\032\016.context.Empty\"\000\022=\n\020GetSe" + + "rviceEvents\022\016.context.Empty\032\025.context.Se" + + "rviceEvent\"\0000\001\022:\n\014ListSliceIds\022\022.context" + + ".ContextId\032\024.context.SliceIdList\"\000\0226\n\nLi" + + "stSlices\022\022.context.ContextId\032\022.context.S" + + "liceList\"\000\022.\n\010GetSlice\022\020.context.SliceId" + + "\032\016.context.Slice\"\000\022.\n\010SetSlice\022\016.context" + + ".Slice\032\020.context.SliceId\"\000\0221\n\013RemoveSlic" + + "e\022\020.context.SliceId\032\016.context.Empty\"\000\0229\n" + + "\016GetSliceEvents\022\016.context.Empty\032\023.contex" + + "t.SliceEvent\"\0000\001\022D\n\021ListConnectionIds\022\022." + + "context.ServiceId\032\031.context.ConnectionId" + + "List\"\000\022@\n\017ListConnections\022\022.context.Serv" + + "iceId\032\027.context.ConnectionList\"\000\022=\n\rGetC" + + "onnection\022\025.context.ConnectionId\032\023.conte" + + "xt.Connection\"\000\022=\n\rSetConnection\022\023.conte" + + "xt.Connection\032\025.context.ConnectionId\"\000\022;" + + "\n\020RemoveConnection\022\025.context.ConnectionI" + + "d\032\016.context.Empty\"\000\022C\n\023GetConnectionEven" + + "ts\022\016.context.Empty\032\030.context.ConnectionE" + + "vent\"\0000\001b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -38037,68 +44311,104 @@ public final class ContextOuterClass { com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ServiceEvent_descriptor, new java.lang.String[] { "Event", "ServiceId", }); - internal_static_context_ConnectionId_descriptor = + internal_static_context_SliceId_descriptor = getDescriptor().getMessageTypes().get(31); + internal_static_context_SliceId_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_SliceId_descriptor, + new java.lang.String[] { "ContextId", "SliceUuid", }); + internal_static_context_Slice_descriptor = + getDescriptor().getMessageTypes().get(32); + internal_static_context_Slice_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_Slice_descriptor, + new java.lang.String[] { "SliceId", "SliceEndpointIds", "SliceConstraints", "SliceServiceIds", "SliceSubsliceIds", "SliceStatus", }); + internal_static_context_SliceStatus_descriptor = + getDescriptor().getMessageTypes().get(33); + internal_static_context_SliceStatus_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_SliceStatus_descriptor, + new java.lang.String[] { "SliceStatus", }); + internal_static_context_SliceIdList_descriptor = + getDescriptor().getMessageTypes().get(34); + internal_static_context_SliceIdList_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_SliceIdList_descriptor, + new java.lang.String[] { "SliceIds", }); + internal_static_context_SliceList_descriptor = + getDescriptor().getMessageTypes().get(35); + internal_static_context_SliceList_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_SliceList_descriptor, + new java.lang.String[] { "Slices", }); + internal_static_context_SliceEvent_descriptor = + getDescriptor().getMessageTypes().get(36); + internal_static_context_SliceEvent_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_SliceEvent_descriptor, + new java.lang.String[] { "Event", "SliceId", }); + internal_static_context_ConnectionId_descriptor = + getDescriptor().getMessageTypes().get(37); internal_static_context_ConnectionId_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ConnectionId_descriptor, new java.lang.String[] { "ConnectionUuid", }); internal_static_context_Connection_descriptor = - getDescriptor().getMessageTypes().get(32); + getDescriptor().getMessageTypes().get(38); internal_static_context_Connection_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Connection_descriptor, new java.lang.String[] { "ConnectionId", "ServiceId", "PathHopsEndpointIds", "SubServiceIds", }); internal_static_context_ConnectionIdList_descriptor = - getDescriptor().getMessageTypes().get(33); + getDescriptor().getMessageTypes().get(39); internal_static_context_ConnectionIdList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ConnectionIdList_descriptor, new java.lang.String[] { "ConnectionIds", }); internal_static_context_ConnectionList_descriptor = - getDescriptor().getMessageTypes().get(34); + getDescriptor().getMessageTypes().get(40); internal_static_context_ConnectionList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ConnectionList_descriptor, new java.lang.String[] { "Connections", }); internal_static_context_ConnectionEvent_descriptor = - getDescriptor().getMessageTypes().get(35); + getDescriptor().getMessageTypes().get(41); internal_static_context_ConnectionEvent_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ConnectionEvent_descriptor, new java.lang.String[] { "Event", "ConnectionId", }); internal_static_context_EndPointId_descriptor = - getDescriptor().getMessageTypes().get(36); + getDescriptor().getMessageTypes().get(42); internal_static_context_EndPointId_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_EndPointId_descriptor, new java.lang.String[] { "TopologyId", "DeviceId", "EndpointUuid", }); internal_static_context_EndPoint_descriptor = - getDescriptor().getMessageTypes().get(37); + getDescriptor().getMessageTypes().get(43); internal_static_context_EndPoint_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_EndPoint_descriptor, new java.lang.String[] { "EndpointId", "EndpointType", "KpiSampleTypes", }); internal_static_context_ConfigRule_descriptor = - getDescriptor().getMessageTypes().get(38); + getDescriptor().getMessageTypes().get(44); internal_static_context_ConfigRule_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ConfigRule_descriptor, new java.lang.String[] { "Action", "ResourceKey", "ResourceValue", }); internal_static_context_Constraint_descriptor = - getDescriptor().getMessageTypes().get(39); + getDescriptor().getMessageTypes().get(45); internal_static_context_Constraint_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Constraint_descriptor, new java.lang.String[] { "ConstraintType", "ConstraintValue", }); internal_static_context_TeraFlowController_descriptor = - getDescriptor().getMessageTypes().get(40); + getDescriptor().getMessageTypes().get(46); internal_static_context_TeraFlowController_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_TeraFlowController_descriptor, new java.lang.String[] { "ContextId", "IpAddress", "Port", }); internal_static_context_AuthenticationResult_descriptor = - getDescriptor().getMessageTypes().get(41); + getDescriptor().getMessageTypes().get(47); internal_static_context_AuthenticationResult_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_AuthenticationResult_descriptor, diff --git a/src/automation/target/generated-sources/grpc/context/ContextService.java b/src/automation/target/generated-sources/grpc/context/ContextService.java index cbd51163f340212839e0eeb2ad096032fdba8109..d54c56057ca53e40071490d3b9aa313a13a77665 100644 --- a/src/automation/target/generated-sources/grpc/context/ContextService.java +++ b/src/automation/target/generated-sources/grpc/context/ContextService.java @@ -58,6 +58,16 @@ public interface ContextService extends MutinyService { io.smallrye.mutiny.Uni<context.ContextOuterClass.Empty> removeService(context.ContextOuterClass.ServiceId request); + io.smallrye.mutiny.Uni<context.ContextOuterClass.SliceIdList> listSliceIds(context.ContextOuterClass.ContextId request); + + io.smallrye.mutiny.Uni<context.ContextOuterClass.SliceList> listSlices(context.ContextOuterClass.ContextId request); + + io.smallrye.mutiny.Uni<context.ContextOuterClass.Slice> getSlice(context.ContextOuterClass.SliceId request); + + io.smallrye.mutiny.Uni<context.ContextOuterClass.SliceId> setSlice(context.ContextOuterClass.Slice request); + + io.smallrye.mutiny.Uni<context.ContextOuterClass.Empty> removeSlice(context.ContextOuterClass.SliceId request); + io.smallrye.mutiny.Uni<context.ContextOuterClass.ConnectionIdList> listConnectionIds(context.ContextOuterClass.ServiceId request); io.smallrye.mutiny.Uni<context.ContextOuterClass.ConnectionList> listConnections(context.ContextOuterClass.ServiceId request); @@ -79,6 +89,8 @@ public interface ContextService extends MutinyService { io.smallrye.mutiny.Multi<context.ContextOuterClass.ServiceEvent> getServiceEvents(context.ContextOuterClass.Empty request); + io.smallrye.mutiny.Multi<context.ContextOuterClass.SliceEvent> getSliceEvents(context.ContextOuterClass.Empty request); + io.smallrye.mutiny.Multi<context.ContextOuterClass.ConnectionEvent> getConnectionEvents(context.ContextOuterClass.Empty request); diff --git a/src/automation/target/generated-sources/grpc/context/ContextServiceBean.java b/src/automation/target/generated-sources/grpc/context/ContextServiceBean.java index 6900cf3c8a09ad6e3df1aaf2cc403c32490d3289..f552294b8e6d645af41cc30632ae0432504bbc67 100644 --- a/src/automation/target/generated-sources/grpc/context/ContextServiceBean.java +++ b/src/automation/target/generated-sources/grpc/context/ContextServiceBean.java @@ -216,6 +216,46 @@ public class ContextServiceBean extends MutinyContextServiceGrpc.ContextServiceI } } @Override + public io.smallrye.mutiny.Uni<context.ContextOuterClass.SliceIdList> listSliceIds(context.ContextOuterClass.ContextId request) { + try { + return delegate.listSliceIds(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni<context.ContextOuterClass.SliceList> listSlices(context.ContextOuterClass.ContextId request) { + try { + return delegate.listSlices(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni<context.ContextOuterClass.Slice> getSlice(context.ContextOuterClass.SliceId request) { + try { + return delegate.getSlice(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni<context.ContextOuterClass.SliceId> setSlice(context.ContextOuterClass.Slice request) { + try { + return delegate.setSlice(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni<context.ContextOuterClass.Empty> removeSlice(context.ContextOuterClass.SliceId request) { + try { + return delegate.removeSlice(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override public io.smallrye.mutiny.Uni<context.ContextOuterClass.ConnectionIdList> listConnectionIds(context.ContextOuterClass.ServiceId request) { try { return delegate.listConnectionIds(request); @@ -301,6 +341,15 @@ public class ContextServiceBean extends MutinyContextServiceGrpc.ContextServiceI } } + @Override + public io.smallrye.mutiny.Multi<context.ContextOuterClass.SliceEvent> getSliceEvents(context.ContextOuterClass.Empty request) { + try { + return delegate.getSliceEvents(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override public io.smallrye.mutiny.Multi<context.ContextOuterClass.ConnectionEvent> getConnectionEvents(context.ContextOuterClass.Empty request) { try { diff --git a/src/automation/target/generated-sources/grpc/context/ContextServiceClient.java b/src/automation/target/generated-sources/grpc/context/ContextServiceClient.java index a3d74cb7dfce2b3ffd259570a6dc65699f85f0cc..c6493bd4d381967238e5eb87dd717f679d028526 100644 --- a/src/automation/target/generated-sources/grpc/context/ContextServiceClient.java +++ b/src/automation/target/generated-sources/grpc/context/ContextServiceClient.java @@ -121,6 +121,26 @@ public class ContextServiceClient implements ContextService, MutinyClient<Mutiny return stub.removeService(request); } @Override + public io.smallrye.mutiny.Uni<context.ContextOuterClass.SliceIdList> listSliceIds(context.ContextOuterClass.ContextId request) { + return stub.listSliceIds(request); + } + @Override + public io.smallrye.mutiny.Uni<context.ContextOuterClass.SliceList> listSlices(context.ContextOuterClass.ContextId request) { + return stub.listSlices(request); + } + @Override + public io.smallrye.mutiny.Uni<context.ContextOuterClass.Slice> getSlice(context.ContextOuterClass.SliceId request) { + return stub.getSlice(request); + } + @Override + public io.smallrye.mutiny.Uni<context.ContextOuterClass.SliceId> setSlice(context.ContextOuterClass.Slice request) { + return stub.setSlice(request); + } + @Override + public io.smallrye.mutiny.Uni<context.ContextOuterClass.Empty> removeSlice(context.ContextOuterClass.SliceId request) { + return stub.removeSlice(request); + } + @Override public io.smallrye.mutiny.Uni<context.ContextOuterClass.ConnectionIdList> listConnectionIds(context.ContextOuterClass.ServiceId request) { return stub.listConnectionIds(request); } @@ -166,6 +186,11 @@ public class ContextServiceClient implements ContextService, MutinyClient<Mutiny return stub.getServiceEvents(request); } + @Override + public io.smallrye.mutiny.Multi<context.ContextOuterClass.SliceEvent> getSliceEvents(context.ContextOuterClass.Empty request) { + return stub.getSliceEvents(request); + } + @Override public io.smallrye.mutiny.Multi<context.ContextOuterClass.ConnectionEvent> getConnectionEvents(context.ContextOuterClass.Empty request) { return stub.getConnectionEvents(request); diff --git a/src/automation/target/generated-sources/grpc/context/ContextServiceGrpc.java b/src/automation/target/generated-sources/grpc/context/ContextServiceGrpc.java index be9f381ffee96febd202beb540bce862c1347378..be720c127439e50f68c2518332f85f750d6579ee 100644 --- a/src/automation/target/generated-sources/grpc/context/ContextServiceGrpc.java +++ b/src/automation/target/generated-sources/grpc/context/ContextServiceGrpc.java @@ -944,6 +944,192 @@ public final class ContextServiceGrpc { return getGetServiceEventsMethod; } + private static volatile io.grpc.MethodDescriptor<context.ContextOuterClass.ContextId, + context.ContextOuterClass.SliceIdList> getListSliceIdsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListSliceIds", + requestType = context.ContextOuterClass.ContextId.class, + responseType = context.ContextOuterClass.SliceIdList.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor<context.ContextOuterClass.ContextId, + context.ContextOuterClass.SliceIdList> getListSliceIdsMethod() { + io.grpc.MethodDescriptor<context.ContextOuterClass.ContextId, context.ContextOuterClass.SliceIdList> getListSliceIdsMethod; + if ((getListSliceIdsMethod = ContextServiceGrpc.getListSliceIdsMethod) == null) { + synchronized (ContextServiceGrpc.class) { + if ((getListSliceIdsMethod = ContextServiceGrpc.getListSliceIdsMethod) == null) { + ContextServiceGrpc.getListSliceIdsMethod = getListSliceIdsMethod = + io.grpc.MethodDescriptor.<context.ContextOuterClass.ContextId, context.ContextOuterClass.SliceIdList>newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListSliceIds")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.ContextId.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.SliceIdList.getDefaultInstance())) + .setSchemaDescriptor(new ContextServiceMethodDescriptorSupplier("ListSliceIds")) + .build(); + } + } + } + return getListSliceIdsMethod; + } + + private static volatile io.grpc.MethodDescriptor<context.ContextOuterClass.ContextId, + context.ContextOuterClass.SliceList> getListSlicesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListSlices", + requestType = context.ContextOuterClass.ContextId.class, + responseType = context.ContextOuterClass.SliceList.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor<context.ContextOuterClass.ContextId, + context.ContextOuterClass.SliceList> getListSlicesMethod() { + io.grpc.MethodDescriptor<context.ContextOuterClass.ContextId, context.ContextOuterClass.SliceList> getListSlicesMethod; + if ((getListSlicesMethod = ContextServiceGrpc.getListSlicesMethod) == null) { + synchronized (ContextServiceGrpc.class) { + if ((getListSlicesMethod = ContextServiceGrpc.getListSlicesMethod) == null) { + ContextServiceGrpc.getListSlicesMethod = getListSlicesMethod = + io.grpc.MethodDescriptor.<context.ContextOuterClass.ContextId, context.ContextOuterClass.SliceList>newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListSlices")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.ContextId.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.SliceList.getDefaultInstance())) + .setSchemaDescriptor(new ContextServiceMethodDescriptorSupplier("ListSlices")) + .build(); + } + } + } + return getListSlicesMethod; + } + + private static volatile io.grpc.MethodDescriptor<context.ContextOuterClass.SliceId, + context.ContextOuterClass.Slice> getGetSliceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetSlice", + requestType = context.ContextOuterClass.SliceId.class, + responseType = context.ContextOuterClass.Slice.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor<context.ContextOuterClass.SliceId, + context.ContextOuterClass.Slice> getGetSliceMethod() { + io.grpc.MethodDescriptor<context.ContextOuterClass.SliceId, context.ContextOuterClass.Slice> getGetSliceMethod; + if ((getGetSliceMethod = ContextServiceGrpc.getGetSliceMethod) == null) { + synchronized (ContextServiceGrpc.class) { + if ((getGetSliceMethod = ContextServiceGrpc.getGetSliceMethod) == null) { + ContextServiceGrpc.getGetSliceMethod = getGetSliceMethod = + io.grpc.MethodDescriptor.<context.ContextOuterClass.SliceId, context.ContextOuterClass.Slice>newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSlice")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.SliceId.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Slice.getDefaultInstance())) + .setSchemaDescriptor(new ContextServiceMethodDescriptorSupplier("GetSlice")) + .build(); + } + } + } + return getGetSliceMethod; + } + + private static volatile io.grpc.MethodDescriptor<context.ContextOuterClass.Slice, + context.ContextOuterClass.SliceId> getSetSliceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SetSlice", + requestType = context.ContextOuterClass.Slice.class, + responseType = context.ContextOuterClass.SliceId.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor<context.ContextOuterClass.Slice, + context.ContextOuterClass.SliceId> getSetSliceMethod() { + io.grpc.MethodDescriptor<context.ContextOuterClass.Slice, context.ContextOuterClass.SliceId> getSetSliceMethod; + if ((getSetSliceMethod = ContextServiceGrpc.getSetSliceMethod) == null) { + synchronized (ContextServiceGrpc.class) { + if ((getSetSliceMethod = ContextServiceGrpc.getSetSliceMethod) == null) { + ContextServiceGrpc.getSetSliceMethod = getSetSliceMethod = + io.grpc.MethodDescriptor.<context.ContextOuterClass.Slice, context.ContextOuterClass.SliceId>newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SetSlice")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Slice.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.SliceId.getDefaultInstance())) + .setSchemaDescriptor(new ContextServiceMethodDescriptorSupplier("SetSlice")) + .build(); + } + } + } + return getSetSliceMethod; + } + + private static volatile io.grpc.MethodDescriptor<context.ContextOuterClass.SliceId, + context.ContextOuterClass.Empty> getRemoveSliceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RemoveSlice", + requestType = context.ContextOuterClass.SliceId.class, + responseType = context.ContextOuterClass.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor<context.ContextOuterClass.SliceId, + context.ContextOuterClass.Empty> getRemoveSliceMethod() { + io.grpc.MethodDescriptor<context.ContextOuterClass.SliceId, context.ContextOuterClass.Empty> getRemoveSliceMethod; + if ((getRemoveSliceMethod = ContextServiceGrpc.getRemoveSliceMethod) == null) { + synchronized (ContextServiceGrpc.class) { + if ((getRemoveSliceMethod = ContextServiceGrpc.getRemoveSliceMethod) == null) { + ContextServiceGrpc.getRemoveSliceMethod = getRemoveSliceMethod = + io.grpc.MethodDescriptor.<context.ContextOuterClass.SliceId, context.ContextOuterClass.Empty>newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RemoveSlice")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.SliceId.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Empty.getDefaultInstance())) + .setSchemaDescriptor(new ContextServiceMethodDescriptorSupplier("RemoveSlice")) + .build(); + } + } + } + return getRemoveSliceMethod; + } + + private static volatile io.grpc.MethodDescriptor<context.ContextOuterClass.Empty, + context.ContextOuterClass.SliceEvent> getGetSliceEventsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetSliceEvents", + requestType = context.ContextOuterClass.Empty.class, + responseType = context.ContextOuterClass.SliceEvent.class, + methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + public static io.grpc.MethodDescriptor<context.ContextOuterClass.Empty, + context.ContextOuterClass.SliceEvent> getGetSliceEventsMethod() { + io.grpc.MethodDescriptor<context.ContextOuterClass.Empty, context.ContextOuterClass.SliceEvent> getGetSliceEventsMethod; + if ((getGetSliceEventsMethod = ContextServiceGrpc.getGetSliceEventsMethod) == null) { + synchronized (ContextServiceGrpc.class) { + if ((getGetSliceEventsMethod = ContextServiceGrpc.getGetSliceEventsMethod) == null) { + ContextServiceGrpc.getGetSliceEventsMethod = getGetSliceEventsMethod = + io.grpc.MethodDescriptor.<context.ContextOuterClass.Empty, context.ContextOuterClass.SliceEvent>newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSliceEvents")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Empty.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.SliceEvent.getDefaultInstance())) + .setSchemaDescriptor(new ContextServiceMethodDescriptorSupplier("GetSliceEvents")) + .build(); + } + } + } + return getGetSliceEventsMethod; + } + private static volatile io.grpc.MethodDescriptor<context.ContextOuterClass.ServiceId, context.ContextOuterClass.ConnectionIdList> getListConnectionIdsMethod; @@ -1388,6 +1574,48 @@ public final class ContextServiceGrpc { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetServiceEventsMethod(), responseObserver); } + /** + */ + public void listSliceIds(context.ContextOuterClass.ContextId request, + io.grpc.stub.StreamObserver<context.ContextOuterClass.SliceIdList> responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListSliceIdsMethod(), responseObserver); + } + + /** + */ + public void listSlices(context.ContextOuterClass.ContextId request, + io.grpc.stub.StreamObserver<context.ContextOuterClass.SliceList> responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListSlicesMethod(), responseObserver); + } + + /** + */ + public void getSlice(context.ContextOuterClass.SliceId request, + io.grpc.stub.StreamObserver<context.ContextOuterClass.Slice> responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetSliceMethod(), responseObserver); + } + + /** + */ + public void setSlice(context.ContextOuterClass.Slice request, + io.grpc.stub.StreamObserver<context.ContextOuterClass.SliceId> responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSetSliceMethod(), responseObserver); + } + + /** + */ + public void removeSlice(context.ContextOuterClass.SliceId request, + io.grpc.stub.StreamObserver<context.ContextOuterClass.Empty> responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRemoveSliceMethod(), responseObserver); + } + + /** + */ + public void getSliceEvents(context.ContextOuterClass.Empty request, + io.grpc.stub.StreamObserver<context.ContextOuterClass.SliceEvent> responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetSliceEventsMethod(), responseObserver); + } + /** */ public void listConnectionIds(context.ContextOuterClass.ServiceId request, @@ -1642,6 +1870,48 @@ public final class ContextServiceGrpc { context.ContextOuterClass.Empty, context.ContextOuterClass.ServiceEvent>( this, METHODID_GET_SERVICE_EVENTS))) + .addMethod( + getListSliceIdsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.ContextId, + context.ContextOuterClass.SliceIdList>( + this, METHODID_LIST_SLICE_IDS))) + .addMethod( + getListSlicesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.ContextId, + context.ContextOuterClass.SliceList>( + this, METHODID_LIST_SLICES))) + .addMethod( + getGetSliceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.SliceId, + context.ContextOuterClass.Slice>( + this, METHODID_GET_SLICE))) + .addMethod( + getSetSliceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.Slice, + context.ContextOuterClass.SliceId>( + this, METHODID_SET_SLICE))) + .addMethod( + getRemoveSliceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.SliceId, + context.ContextOuterClass.Empty>( + this, METHODID_REMOVE_SLICE))) + .addMethod( + getGetSliceEventsMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + context.ContextOuterClass.Empty, + context.ContextOuterClass.SliceEvent>( + this, METHODID_GET_SLICE_EVENTS))) .addMethod( getListConnectionIdsMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( @@ -1942,6 +2212,54 @@ public final class ContextServiceGrpc { getChannel().newCall(getGetServiceEventsMethod(), getCallOptions()), request, responseObserver); } + /** + */ + public void listSliceIds(context.ContextOuterClass.ContextId request, + io.grpc.stub.StreamObserver<context.ContextOuterClass.SliceIdList> responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListSliceIdsMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void listSlices(context.ContextOuterClass.ContextId request, + io.grpc.stub.StreamObserver<context.ContextOuterClass.SliceList> responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListSlicesMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getSlice(context.ContextOuterClass.SliceId request, + io.grpc.stub.StreamObserver<context.ContextOuterClass.Slice> responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetSliceMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void setSlice(context.ContextOuterClass.Slice request, + io.grpc.stub.StreamObserver<context.ContextOuterClass.SliceId> responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSetSliceMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void removeSlice(context.ContextOuterClass.SliceId request, + io.grpc.stub.StreamObserver<context.ContextOuterClass.Empty> responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRemoveSliceMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getSliceEvents(context.ContextOuterClass.Empty request, + io.grpc.stub.StreamObserver<context.ContextOuterClass.SliceEvent> responseObserver) { + io.grpc.stub.ClientCalls.asyncServerStreamingCall( + getChannel().newCall(getGetSliceEventsMethod(), getCallOptions()), request, responseObserver); + } + /** */ public void listConnectionIds(context.ContextOuterClass.ServiceId request, @@ -2220,6 +2538,49 @@ public final class ContextServiceGrpc { getChannel(), getGetServiceEventsMethod(), getCallOptions(), request); } + /** + */ + public context.ContextOuterClass.SliceIdList listSliceIds(context.ContextOuterClass.ContextId request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListSliceIdsMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.SliceList listSlices(context.ContextOuterClass.ContextId request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListSlicesMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.Slice getSlice(context.ContextOuterClass.SliceId request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetSliceMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.SliceId setSlice(context.ContextOuterClass.Slice request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSetSliceMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.Empty removeSlice(context.ContextOuterClass.SliceId request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRemoveSliceMethod(), getCallOptions(), request); + } + + /** + */ + public java.util.Iterator<context.ContextOuterClass.SliceEvent> getSliceEvents( + context.ContextOuterClass.Empty request) { + return io.grpc.stub.ClientCalls.blockingServerStreamingCall( + getChannel(), getGetSliceEventsMethod(), getCallOptions(), request); + } + /** */ public context.ContextOuterClass.ConnectionIdList listConnectionIds(context.ContextOuterClass.ServiceId request) { @@ -2478,6 +2839,46 @@ public final class ContextServiceGrpc { getChannel().newCall(getRemoveServiceMethod(), getCallOptions()), request); } + /** + */ + public com.google.common.util.concurrent.ListenableFuture<context.ContextOuterClass.SliceIdList> listSliceIds( + context.ContextOuterClass.ContextId request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListSliceIdsMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture<context.ContextOuterClass.SliceList> listSlices( + context.ContextOuterClass.ContextId request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListSlicesMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture<context.ContextOuterClass.Slice> getSlice( + context.ContextOuterClass.SliceId request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetSliceMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture<context.ContextOuterClass.SliceId> setSlice( + context.ContextOuterClass.Slice request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSetSliceMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture<context.ContextOuterClass.Empty> removeSlice( + context.ContextOuterClass.SliceId request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRemoveSliceMethod(), getCallOptions()), request); + } + /** */ public com.google.common.util.concurrent.ListenableFuture<context.ContextOuterClass.ConnectionIdList> listConnectionIds( @@ -2549,12 +2950,18 @@ public final class ContextServiceGrpc { private static final int METHODID_SET_SERVICE = 27; private static final int METHODID_REMOVE_SERVICE = 28; private static final int METHODID_GET_SERVICE_EVENTS = 29; - private static final int METHODID_LIST_CONNECTION_IDS = 30; - private static final int METHODID_LIST_CONNECTIONS = 31; - private static final int METHODID_GET_CONNECTION = 32; - private static final int METHODID_SET_CONNECTION = 33; - private static final int METHODID_REMOVE_CONNECTION = 34; - private static final int METHODID_GET_CONNECTION_EVENTS = 35; + private static final int METHODID_LIST_SLICE_IDS = 30; + private static final int METHODID_LIST_SLICES = 31; + private static final int METHODID_GET_SLICE = 32; + private static final int METHODID_SET_SLICE = 33; + private static final int METHODID_REMOVE_SLICE = 34; + private static final int METHODID_GET_SLICE_EVENTS = 35; + private static final int METHODID_LIST_CONNECTION_IDS = 36; + private static final int METHODID_LIST_CONNECTIONS = 37; + private static final int METHODID_GET_CONNECTION = 38; + private static final int METHODID_SET_CONNECTION = 39; + private static final int METHODID_REMOVE_CONNECTION = 40; + private static final int METHODID_GET_CONNECTION_EVENTS = 41; private static final class MethodHandlers<Req, Resp> implements io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>, @@ -2693,6 +3100,30 @@ public final class ContextServiceGrpc { serviceImpl.getServiceEvents((context.ContextOuterClass.Empty) request, (io.grpc.stub.StreamObserver<context.ContextOuterClass.ServiceEvent>) responseObserver); break; + case METHODID_LIST_SLICE_IDS: + serviceImpl.listSliceIds((context.ContextOuterClass.ContextId) request, + (io.grpc.stub.StreamObserver<context.ContextOuterClass.SliceIdList>) responseObserver); + break; + case METHODID_LIST_SLICES: + serviceImpl.listSlices((context.ContextOuterClass.ContextId) request, + (io.grpc.stub.StreamObserver<context.ContextOuterClass.SliceList>) responseObserver); + break; + case METHODID_GET_SLICE: + serviceImpl.getSlice((context.ContextOuterClass.SliceId) request, + (io.grpc.stub.StreamObserver<context.ContextOuterClass.Slice>) responseObserver); + break; + case METHODID_SET_SLICE: + serviceImpl.setSlice((context.ContextOuterClass.Slice) request, + (io.grpc.stub.StreamObserver<context.ContextOuterClass.SliceId>) responseObserver); + break; + case METHODID_REMOVE_SLICE: + serviceImpl.removeSlice((context.ContextOuterClass.SliceId) request, + (io.grpc.stub.StreamObserver<context.ContextOuterClass.Empty>) responseObserver); + break; + case METHODID_GET_SLICE_EVENTS: + serviceImpl.getSliceEvents((context.ContextOuterClass.Empty) request, + (io.grpc.stub.StreamObserver<context.ContextOuterClass.SliceEvent>) responseObserver); + break; case METHODID_LIST_CONNECTION_IDS: serviceImpl.listConnectionIds((context.ContextOuterClass.ServiceId) request, (io.grpc.stub.StreamObserver<context.ContextOuterClass.ConnectionIdList>) responseObserver); @@ -2808,6 +3239,12 @@ public final class ContextServiceGrpc { .addMethod(getSetServiceMethod()) .addMethod(getRemoveServiceMethod()) .addMethod(getGetServiceEventsMethod()) + .addMethod(getListSliceIdsMethod()) + .addMethod(getListSlicesMethod()) + .addMethod(getGetSliceMethod()) + .addMethod(getSetSliceMethod()) + .addMethod(getRemoveSliceMethod()) + .addMethod(getGetSliceEventsMethod()) .addMethod(getListConnectionIdsMethod()) .addMethod(getListConnectionsMethod()) .addMethod(getGetConnectionMethod()) diff --git a/src/automation/target/generated-sources/grpc/context/MutinyContextServiceGrpc.java b/src/automation/target/generated-sources/grpc/context/MutinyContextServiceGrpc.java index 85abba20a9f315f684f964d16db4ad0cd7e91299..9f71b53786e40922546dc59cfd4328040a40bd7c 100644 --- a/src/automation/target/generated-sources/grpc/context/MutinyContextServiceGrpc.java +++ b/src/automation/target/generated-sources/grpc/context/MutinyContextServiceGrpc.java @@ -161,6 +161,31 @@ public final class MutinyContextServiceGrpc implements io.quarkus.grpc.runtime.M } + public io.smallrye.mutiny.Uni<context.ContextOuterClass.SliceIdList> listSliceIds(context.ContextOuterClass.ContextId request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::listSliceIds); + } + + + public io.smallrye.mutiny.Uni<context.ContextOuterClass.SliceList> listSlices(context.ContextOuterClass.ContextId request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::listSlices); + } + + + public io.smallrye.mutiny.Uni<context.ContextOuterClass.Slice> getSlice(context.ContextOuterClass.SliceId request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::getSlice); + } + + + public io.smallrye.mutiny.Uni<context.ContextOuterClass.SliceId> setSlice(context.ContextOuterClass.Slice request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::setSlice); + } + + + public io.smallrye.mutiny.Uni<context.ContextOuterClass.Empty> removeSlice(context.ContextOuterClass.SliceId request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::removeSlice); + } + + public io.smallrye.mutiny.Uni<context.ContextOuterClass.ConnectionIdList> listConnectionIds(context.ContextOuterClass.ServiceId request) { return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::listConnectionIds); } @@ -211,6 +236,11 @@ public final class MutinyContextServiceGrpc implements io.quarkus.grpc.runtime.M } + public io.smallrye.mutiny.Multi<context.ContextOuterClass.SliceEvent> getSliceEvents(context.ContextOuterClass.Empty request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToMany(request, delegateStub::getSliceEvents); + } + + public io.smallrye.mutiny.Multi<context.ContextOuterClass.ConnectionEvent> getConnectionEvents(context.ContextOuterClass.Empty request) { return io.quarkus.grpc.runtime.ClientCalls.oneToMany(request, delegateStub::getConnectionEvents); } @@ -358,6 +388,31 @@ public final class MutinyContextServiceGrpc implements io.quarkus.grpc.runtime.M } + public io.smallrye.mutiny.Uni<context.ContextOuterClass.SliceIdList> listSliceIds(context.ContextOuterClass.ContextId request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni<context.ContextOuterClass.SliceList> listSlices(context.ContextOuterClass.ContextId request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni<context.ContextOuterClass.Slice> getSlice(context.ContextOuterClass.SliceId request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni<context.ContextOuterClass.SliceId> setSlice(context.ContextOuterClass.Slice request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni<context.ContextOuterClass.Empty> removeSlice(context.ContextOuterClass.SliceId request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + public io.smallrye.mutiny.Uni<context.ContextOuterClass.ConnectionIdList> listConnectionIds(context.ContextOuterClass.ServiceId request) { throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } @@ -408,6 +463,11 @@ public final class MutinyContextServiceGrpc implements io.quarkus.grpc.runtime.M } + public io.smallrye.mutiny.Multi<context.ContextOuterClass.SliceEvent> getSliceEvents(context.ContextOuterClass.Empty request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + public io.smallrye.mutiny.Multi<context.ContextOuterClass.ConnectionEvent> getConnectionEvents(context.ContextOuterClass.Empty request) { throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } @@ -624,6 +684,48 @@ public final class MutinyContextServiceGrpc implements io.quarkus.grpc.runtime.M context.ContextOuterClass.Empty, context.ContextOuterClass.ServiceEvent>( this, METHODID_GET_SERVICE_EVENTS, compression))) + .addMethod( + context.ContextServiceGrpc.getListSliceIdsMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.ContextId, + context.ContextOuterClass.SliceIdList>( + this, METHODID_LIST_SLICE_IDS, compression))) + .addMethod( + context.ContextServiceGrpc.getListSlicesMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.ContextId, + context.ContextOuterClass.SliceList>( + this, METHODID_LIST_SLICES, compression))) + .addMethod( + context.ContextServiceGrpc.getGetSliceMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.SliceId, + context.ContextOuterClass.Slice>( + this, METHODID_GET_SLICE, compression))) + .addMethod( + context.ContextServiceGrpc.getSetSliceMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.Slice, + context.ContextOuterClass.SliceId>( + this, METHODID_SET_SLICE, compression))) + .addMethod( + context.ContextServiceGrpc.getRemoveSliceMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.SliceId, + context.ContextOuterClass.Empty>( + this, METHODID_REMOVE_SLICE, compression))) + .addMethod( + context.ContextServiceGrpc.getGetSliceEventsMethod(), + asyncServerStreamingCall( + new MethodHandlers< + context.ContextOuterClass.Empty, + context.ContextOuterClass.SliceEvent>( + this, METHODID_GET_SLICE_EVENTS, compression))) .addMethod( context.ContextServiceGrpc.getListConnectionIdsMethod(), asyncUnaryCall( @@ -700,12 +802,18 @@ public final class MutinyContextServiceGrpc implements io.quarkus.grpc.runtime.M private static final int METHODID_SET_SERVICE = 27; private static final int METHODID_REMOVE_SERVICE = 28; private static final int METHODID_GET_SERVICE_EVENTS = 29; - private static final int METHODID_LIST_CONNECTION_IDS = 30; - private static final int METHODID_LIST_CONNECTIONS = 31; - private static final int METHODID_GET_CONNECTION = 32; - private static final int METHODID_SET_CONNECTION = 33; - private static final int METHODID_REMOVE_CONNECTION = 34; - private static final int METHODID_GET_CONNECTION_EVENTS = 35; + private static final int METHODID_LIST_SLICE_IDS = 30; + private static final int METHODID_LIST_SLICES = 31; + private static final int METHODID_GET_SLICE = 32; + private static final int METHODID_SET_SLICE = 33; + private static final int METHODID_REMOVE_SLICE = 34; + private static final int METHODID_GET_SLICE_EVENTS = 35; + private static final int METHODID_LIST_CONNECTION_IDS = 36; + private static final int METHODID_LIST_CONNECTIONS = 37; + private static final int METHODID_GET_CONNECTION = 38; + private static final int METHODID_SET_CONNECTION = 39; + private static final int METHODID_REMOVE_CONNECTION = 40; + private static final int METHODID_GET_CONNECTION_EVENTS = 41; private static final class MethodHandlers<Req, Resp> implements io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>, @@ -906,6 +1014,42 @@ public final class MutinyContextServiceGrpc implements io.quarkus.grpc.runtime.M compression, serviceImpl::getServiceEvents); break; + case METHODID_LIST_SLICE_IDS: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.ContextId) request, + (io.grpc.stub.StreamObserver<context.ContextOuterClass.SliceIdList>) responseObserver, + compression, + serviceImpl::listSliceIds); + break; + case METHODID_LIST_SLICES: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.ContextId) request, + (io.grpc.stub.StreamObserver<context.ContextOuterClass.SliceList>) responseObserver, + compression, + serviceImpl::listSlices); + break; + case METHODID_GET_SLICE: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.SliceId) request, + (io.grpc.stub.StreamObserver<context.ContextOuterClass.Slice>) responseObserver, + compression, + serviceImpl::getSlice); + break; + case METHODID_SET_SLICE: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.Slice) request, + (io.grpc.stub.StreamObserver<context.ContextOuterClass.SliceId>) responseObserver, + compression, + serviceImpl::setSlice); + break; + case METHODID_REMOVE_SLICE: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.SliceId) request, + (io.grpc.stub.StreamObserver<context.ContextOuterClass.Empty>) responseObserver, + compression, + serviceImpl::removeSlice); + break; + case METHODID_GET_SLICE_EVENTS: + io.quarkus.grpc.runtime.ServerCalls.oneToMany((context.ContextOuterClass.Empty) request, + (io.grpc.stub.StreamObserver<context.ContextOuterClass.SliceEvent>) responseObserver, + compression, + serviceImpl::getSliceEvents); + break; case METHODID_LIST_CONNECTION_IDS: io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.ServiceId) request, (io.grpc.stub.StreamObserver<context.ContextOuterClass.ConnectionIdList>) responseObserver, diff --git a/src/automation/target/kubernetes/kubernetes.yml b/src/automation/target/kubernetes/kubernetes.yml index d8d4dc5449107b29174cfd8fecf660a28b5d558e..68a7a59c2fb4ee0bad0ddeb8df2ce00728fa80e5 100644 --- a/src/automation/target/kubernetes/kubernetes.yml +++ b/src/automation/target/kubernetes/kubernetes.yml @@ -1,36 +1,22 @@ -# 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: v1 kind: Service metadata: annotations: - app.quarkus.io/commit-id: 644f8ea4385acb720eab7317de057f9d1d8ebfe6 - app.quarkus.io/build-timestamp: 2022-02-14 - 10:21:58 +0000 + app.quarkus.io/commit-id: 665bca2f1245843e8c99eaa1a2c5315a6c002417 + app.quarkus.io/build-timestamp: 2022-07-13 - 10:46:17 +0000 labels: app.kubernetes.io/name: automationservice app: automationservice name: automationservice spec: ports: + - name: grpc-server + port: 5050 + targetPort: 5050 - name: http port: 8080 targetPort: 8080 - - name: grpc-server - port: 9999 - targetPort: 9999 selector: app.kubernetes.io/name: automationservice type: ClusterIP @@ -39,8 +25,8 @@ apiVersion: apps/v1 kind: Deployment metadata: annotations: - app.quarkus.io/commit-id: 644f8ea4385acb720eab7317de057f9d1d8ebfe6 - app.quarkus.io/build-timestamp: 2022-02-14 - 10:21:58 +0000 + app.quarkus.io/commit-id: 665bca2f1245843e8c99eaa1a2c5315a6c002417 + app.quarkus.io/build-timestamp: 2022-07-13 - 10:46:17 +0000 labels: app: automationservice app.kubernetes.io/name: automationservice @@ -53,8 +39,8 @@ spec: template: metadata: annotations: - app.quarkus.io/commit-id: 644f8ea4385acb720eab7317de057f9d1d8ebfe6 - app.quarkus.io/build-timestamp: 2022-02-14 - 10:21:58 +0000 + app.quarkus.io/commit-id: 665bca2f1245843e8c99eaa1a2c5315a6c002417 + app.quarkus.io/build-timestamp: 2022-07-13 - 10:46:17 +0000 labels: app: automationservice app.kubernetes.io/name: automationservice @@ -66,9 +52,9 @@ spec: fieldRef: fieldPath: metadata.namespace - name: DEVICE_SERVICE_HOST - value: deviceservice + value: DeviceService - name: CONTEXT_SERVICE_HOST - value: contextservice + value: ContextService image: registry.gitlab.com/teraflow-h2020/controller/automation:0.2.0 imagePullPolicy: Always livenessProbe: @@ -83,12 +69,12 @@ spec: timeoutSeconds: 10 name: automationservice ports: + - containerPort: 5050 + name: grpc-server + protocol: TCP - containerPort: 8080 name: http protocol: TCP - - containerPort: 9999 - name: grpc-server - protocol: TCP readinessProbe: failureThreshold: 3 httpGet: diff --git a/src/common/Constants.py b/src/common/Constants.py index 9d5edc235f582f7df4a274b15bf646413d14b1bd..dbe4124e792db73e122a7b436ca19be814aed761 100644 --- a/src/common/Constants.py +++ b/src/common/Constants.py @@ -12,5 +12,64 @@ # See the License for the specific language governing permissions and # limitations under the License. +import logging +from enum import Enum + +# Default logging level +DEFAULT_LOG_LEVEL = logging.WARNING + +# Default gRPC server settings +DEFAULT_GRPC_BIND_ADDRESS = '0.0.0.0' +DEFAULT_GRPC_MAX_WORKERS = 10 +DEFAULT_GRPC_GRACE_PERIOD = 60 + +# Default HTTP server settings +DEFAULT_HTTP_BIND_ADDRESS = '0.0.0.0' + +# Default Prometheus settings +DEFAULT_METRICS_PORT = 9192 + +# Default context and topology UUIDs DEFAULT_CONTEXT_UUID = 'admin' DEFAULT_TOPOLOGY_UUID = 'admin' + +# Default service names +class ServiceNameEnum(Enum): + CONTEXT = 'context' + DEVICE = 'device' + SERVICE = 'service' + SLICE = 'slice' + AUTOMATION = 'automation' + POLICY = 'policy' + MONITORING = 'monitoring' + DLT = 'dlt' + COMPUTE = 'compute' + CYBERSECURITY = 'cybersecurity' + INTERDOMAIN = 'interdomain' + +# Default gRPC service ports +DEFAULT_SERVICE_GRPC_PORTS = { + ServiceNameEnum.CONTEXT .value : 1010, + ServiceNameEnum.DEVICE .value : 2020, + ServiceNameEnum.SERVICE .value : 3030, + ServiceNameEnum.SLICE .value : 4040, + ServiceNameEnum.AUTOMATION .value : 5050, + ServiceNameEnum.POLICY .value : 6060, + ServiceNameEnum.MONITORING .value : 7070, + ServiceNameEnum.DLT .value : 8080, + ServiceNameEnum.COMPUTE .value : 9090, + ServiceNameEnum.CYBERSECURITY.value : 10000, + ServiceNameEnum.INTERDOMAIN .value : 10010, +} + +# Default HTTP/REST-API service ports +DEFAULT_SERVICE_HTTP_PORTS = { + ServiceNameEnum.CONTEXT .value : 8080, + ServiceNameEnum.COMPUTE .value : 8080, +} + +# Default HTTP/REST-API service base URLs +DEFAULT_SERVICE_HTTP_BASEURLS = { + ServiceNameEnum.CONTEXT .value : '/api', + ServiceNameEnum.COMPUTE .value : '/restconf/data', +} diff --git a/src/common/DeviceTypes.py b/src/common/DeviceTypes.py index 44f8e3981157d2b77e5450c34efa54ab66a39362..bf871a2d5afa6a73f1c9dd39431c64a7f31bbd7e 100644 --- a/src/common/DeviceTypes.py +++ b/src/common/DeviceTypes.py @@ -17,6 +17,7 @@ from enum import Enum class DeviceTypeEnum(Enum): EMULATED_OPTICAL_LINE_SYSTEM = 'emu-optical-line-system' EMULATED_PACKET_ROUTER = 'emu-packet-router' + MICROVAWE_RADIO_SYSTEM = 'microwave-radio-system' OPTICAL_ROADM = 'optical-roadm' OPTICAL_TRANDPONDER = 'optical-trandponder' OPTICAL_LINE_SYSTEM = 'optical-line-system' diff --git a/src/common/Settings.py b/src/common/Settings.py index f6bc214bf7500227c621b197e2626e09f2dafb93..e9d5f406d2acad0d31ae94b604183c129d28f146 100644 --- a/src/common/Settings.py +++ b/src/common/Settings.py @@ -14,15 +14,33 @@ import logging, os, time from typing import List +from common.Constants import ( + DEFAULT_GRPC_BIND_ADDRESS, DEFAULT_GRPC_GRACE_PERIOD, DEFAULT_GRPC_MAX_WORKERS, DEFAULT_HTTP_BIND_ADDRESS, + DEFAULT_LOG_LEVEL, DEFAULT_METRICS_PORT, DEFAULT_SERVICE_GRPC_PORTS, DEFAULT_SERVICE_HTTP_BASEURLS, + DEFAULT_SERVICE_HTTP_PORTS, ServiceNameEnum +) LOGGER = logging.getLogger(__name__) DEFAULT_RESTART_DELAY = 5.0 # seconds +ENVVAR_KUBERNETES_PORT = 'KUBERNETES_PORT' +ENVVAR_GRPC_BIND_ADDRESS = 'GRPC_BIND_ADDRESS' +ENVVAR_GRPC_MAX_WORKERS = 'GRPC_MAX_WORKERS' +ENVVAR_GRPC_GRACE_PERIOD = 'GRPC_GRACE_PERIOD' +ENVVAR_HTTP_BIND_ADDRESS = 'HTTP_BIND_ADDRESS' +ENVVAR_LOG_LEVEL = 'LOG_LEVEL' +ENVVAR_METRICS_PORT = 'METRICS_PORT' + +ENVVAR_SUFIX_SERVICE_BASEURL_HTTP = 'SERVICE_BASEURL_HTTP' +ENVVAR_SUFIX_SERVICE_HOST = 'SERVICE_HOST' +ENVVAR_SUFIX_SERVICE_PORT_GRPC = 'SERVICE_PORT_GRPC' +ENVVAR_SUFIX_SERVICE_PORT_HTTP = 'SERVICE_PORT_HTTP' + def wait_for_environment_variables( required_environment_variables : List[str] = [], wait_delay_seconds : float = DEFAULT_RESTART_DELAY ): - if 'KUBERNETES_PORT' not in os.environ: return # We're not running in Kubernetes, nothing to wait for + if ENVVAR_KUBERNETES_PORT not in os.environ: return # We're not running in Kubernetes, nothing to wait for missing_variables = set(required_environment_variables).difference(set(os.environ.keys())) if len(missing_variables) == 0: return # We have all environment variables defined msg = 'Variables({:s}) are missing in Environment({:s}), restarting in {:f} seconds...' @@ -36,4 +54,45 @@ def get_setting(name, **kwargs): value = kwargs['settings'].pop(name, value) if value is not None: return value if 'default' in kwargs: return kwargs['default'] - raise Exception('Setting({}) not specified in environment or configuration'.format(name)) + raise Exception('Setting({:s}) not specified in environment or configuration'.format(str(name))) + +def get_env_var_name(service_name : ServiceNameEnum, env_var_group): + return ('{:s}SERVICE_{:s}'.format(service_name.value, env_var_group)).upper() + +def get_service_host(service_name : ServiceNameEnum): + envvar_name = get_env_var_name(service_name, ENVVAR_SUFIX_SERVICE_HOST) + default_value = ('{:s}service'.format(service_name.value)) + return get_setting(envvar_name, default=default_value) + +def get_service_port_grpc(service_name : ServiceNameEnum): + envvar_name = get_env_var_name(service_name, ENVVAR_SUFIX_SERVICE_PORT_GRPC) + default_value = DEFAULT_SERVICE_GRPC_PORTS.get(service_name.value) + return get_setting(envvar_name, default=default_value) + +def get_service_port_http(service_name : ServiceNameEnum): + envvar_name = get_env_var_name(service_name, ENVVAR_SUFIX_SERVICE_PORT_HTTP) + default_value = DEFAULT_SERVICE_HTTP_PORTS.get(service_name.value) + return get_setting(envvar_name, default=default_value) + +def get_service_baseurl_http(service_name : ServiceNameEnum): + envvar_name = get_env_var_name(service_name, ENVVAR_SUFIX_SERVICE_BASEURL_HTTP) + default_value = DEFAULT_SERVICE_HTTP_BASEURLS.get(service_name.value) + return get_setting(envvar_name, default=default_value) + +def get_log_level(): + return get_setting(ENVVAR_LOG_LEVEL, default=DEFAULT_LOG_LEVEL) + +def get_metrics_port(): + return get_setting(ENVVAR_METRICS_PORT, default=DEFAULT_METRICS_PORT) + +def get_grpc_bind_address(): + return get_setting(ENVVAR_GRPC_BIND_ADDRESS, default=DEFAULT_GRPC_BIND_ADDRESS) + +def get_grpc_max_workers(): + return get_setting(ENVVAR_GRPC_MAX_WORKERS, default=DEFAULT_GRPC_MAX_WORKERS) + +def get_grpc_grace_period(): + return get_setting(ENVVAR_GRPC_GRACE_PERIOD, default=DEFAULT_GRPC_GRACE_PERIOD) + +def get_http_bind_address(): + return get_setting(ENVVAR_HTTP_BIND_ADDRESS, default=DEFAULT_HTTP_BIND_ADDRESS) diff --git a/src/common/database/api/context/slice/SliceStatus.py b/src/common/database/api/context/slice/SliceStatus.py new file mode 100644 index 0000000000000000000000000000000000000000..d97b3944999e58cc2ad54f28ed6e22232b5fcd71 --- /dev/null +++ b/src/common/database/api/context/slice/SliceStatus.py @@ -0,0 +1,31 @@ +from enum import Enum + +class SliceStatus(Enum): + PLANNED = 0 + INIT = 1 + ACTIVE = 2 + DEINIT = 3 + +ANY_TO_ENUM = { + 0: SliceStatus.PLANNED, + 1: SliceStatus.INIT, + 2: SliceStatus.ACTIVE, + 3: SliceStatus.DEINIT, + + '0': SliceStatus.PLANNED, + '1': SliceStatus.INIT, + '2': SliceStatus.ACTIVE, + '3': SliceStatus.DEINIT, + + 'planned': SliceStatus.PLANNED, + 'init': SliceStatus.INIT, + 'active': SliceStatus.ACTIVE, + 'deinit': SliceStatus.DEINIT, +} + +def slicestatus_enum_values(): + return {m.value for m in SliceStatus.__members__.values()} + +def to_slicestatus_enum(int_or_str): + if isinstance(int_or_str, str): int_or_str = int_or_str.lower() + return ANY_TO_ENUM.get(int_or_str) diff --git a/src/common/database/api/context/slice/__init__.py b/src/common/database/api/context/slice/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/common/logger.py b/src/common/logger.py index a0e9997cd9459015e60b073dafead854fdf6c943..c90e0bcf30c41d6dab1d4f63cbb475ab544a019a 100644 --- a/src/common/logger.py +++ b/src/common/logger.py @@ -1,6 +1,6 @@ #!/usr/bin/python # -# Copyright 2018 Google LLC +# 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. diff --git a/src/common/rpc_method_wrapper/Decorator.py b/src/common/rpc_method_wrapper/Decorator.py index 212481b7398439d7dbaa5bb76df6901544562ab5..31dc4b82bdaa8762b1dee5af247b3f8b7b9af2af 100644 --- a/src/common/rpc_method_wrapper/Decorator.py +++ b/src/common/rpc_method_wrapper/Decorator.py @@ -17,6 +17,7 @@ from enum import Enum from typing import Dict, List from prometheus_client import Counter, Histogram from prometheus_client.metrics import MetricWrapperBase +from common.tools.grpc.Tools import grpc_message_to_json_string from .ServiceExceptions import ServiceException class RequestConditionEnum(Enum): @@ -62,9 +63,9 @@ def safe_and_metered_rpc_method(metrics : Dict[str, MetricWrapperBase], logger : def inner_wrapper(self, request, grpc_context : grpc.ServicerContext): COUNTER_STARTED.inc() try: - logger.debug('{:s} request: {:s}'.format(function_name, str(request))) + logger.debug('{:s} request: {:s}'.format(function_name, grpc_message_to_json_string(request))) reply = func(self, request, grpc_context) - logger.debug('{:s} reply: {:s}'.format(function_name, str(reply))) + logger.debug('{:s} reply: {:s}'.format(function_name, grpc_message_to_json_string(reply))) COUNTER_COMPLETED.inc() return reply except ServiceException as e: # pragma: no cover (ServiceException not thrown) diff --git a/src/common/tests/MockService.py b/src/common/tests/MockService.py deleted file mode 100644 index 25f36e009be3a65c1ba9c18c7707742a75253a75..0000000000000000000000000000000000000000 --- a/src/common/tests/MockService.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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. - -import grpc, logging -from concurrent import futures - -GRPC_MAX_WORKERS = 10 -GRPC_GRACE_PERIOD = 60 - -class MockService: - def __init__(self, address, port, max_workers=GRPC_MAX_WORKERS, grace_period=GRPC_GRACE_PERIOD, cls_name=__name__): - self.logger = logging.getLogger(cls_name) - self.address = address - self.port = port - self.endpoint = None - self.max_workers = max_workers - self.grace_period = grace_period - self.pool = None - self.server = None - - def install_servicers(self): - pass - - def start(self): - self.endpoint = '{:s}:{:s}'.format(str(self.address), str(self.port)) - self.logger.info('Starting Service (tentative endpoint: {:s}, max_workers: {:s})...'.format( - str(self.endpoint), str(self.max_workers))) - - self.pool = futures.ThreadPoolExecutor(max_workers=self.max_workers) - self.server = grpc.server(self.pool) # , interceptors=(tracer_interceptor,)) - - self.install_servicers() - - port = self.server.add_insecure_port(self.endpoint) - self.endpoint = '{:s}:{:s}'.format(str(self.address), str(port)) - self.logger.info('Listening on {:s}...'.format(str(self.endpoint))) - self.server.start() - - self.logger.debug('Service started') - - def stop(self): - self.logger.debug('Stopping service (grace period {:s} seconds)...'.format(str(self.grace_period))) - self.server.stop(self.grace_period) - self.logger.debug('Service stopped') diff --git a/src/device/tests/MockMonitoringServiceServicerImpl.py b/src/common/tests/MockServicerImpl_Monitoring.py similarity index 70% rename from src/device/tests/MockMonitoringServiceServicerImpl.py rename to src/common/tests/MockServicerImpl_Monitoring.py index 05ca43dda0418df151bc3dfe255a90d75b50a088..9f646c3667485ae3240c59284a73fef01bffb7bb 100644 --- a/src/device/tests/MockMonitoringServiceServicerImpl.py +++ b/src/common/tests/MockServicerImpl_Monitoring.py @@ -12,18 +12,23 @@ # See the License for the specific language governing permissions and # limitations under the License. -import logging + +import grpc, logging from queue import Queue +from common.tools.grpc.Tools import grpc_message_to_json_string from monitoring.proto.context_pb2 import Empty from monitoring.proto.monitoring_pb2 import Kpi from monitoring.proto.monitoring_pb2_grpc import MonitoringServiceServicer LOGGER = logging.getLogger(__name__) -class MockMonitoringServiceServicerImpl(MonitoringServiceServicer): +class MockServicerImpl_Monitoring(MonitoringServiceServicer): def __init__(self, queue_samples : Queue): + LOGGER.info('[__init__] Creating Servicer...') self.queue_samples = queue_samples + LOGGER.info('[__init__] Servicer Created') - def IncludeKpi(self, request : Kpi, context) -> Empty: + def IncludeKpi(self, request : Kpi, context : grpc.ServicerContext) -> Empty: + LOGGER.info('[IncludeKpi] request={:s}'.format(grpc_message_to_json_string(request))) self.queue_samples.put(request) return Empty() diff --git a/src/common/tests/MockServicerImpl_Slice.py b/src/common/tests/MockServicerImpl_Slice.py new file mode 100644 index 0000000000000000000000000000000000000000..5fd349ee1f395d8299c0c4a41bd8d9f842ac08f5 --- /dev/null +++ b/src/common/tests/MockServicerImpl_Slice.py @@ -0,0 +1,45 @@ +# 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. + +import grpc, logging +from common.Settings import get_setting +from common.tools.grpc.Tools import grpc_message_to_json_string +from context.client.ContextClient import ContextClient +from slice.proto.context_pb2 import Empty, Slice, SliceId, SliceStatusEnum +from slice.proto.slice_pb2_grpc import SliceServiceServicer + +LOGGER = logging.getLogger(__name__) + +class MockServicerImpl_Slice(SliceServiceServicer): + def __init__(self): + LOGGER.info('[__init__] Creating Servicer...') + self.context_client = ContextClient( + get_setting('CONTEXTSERVICE_SERVICE_HOST'), + get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC')) + LOGGER.info('[__init__] Servicer Created') + + def CreateSlice(self, request : Slice, context : grpc.ServicerContext) -> SliceId: + LOGGER.info('[CreateSlice] request={:s}'.format(grpc_message_to_json_string(request))) + return self.context_client.SetSlice(request) + + def UpdateSlice(self, request : Slice, context : grpc.ServicerContext) -> SliceId: + LOGGER.info('[UpdateSlice] request={:s}'.format(grpc_message_to_json_string(request))) + slice_ = Slice() + slice_.CopyFrom(request) + slice_.slice_status.slice_status = SliceStatusEnum.SLICESTATUS_ACTIVE # pylint: disable=no-member + return self.context_client.SetSlice(slice_) + + def DeleteSlice(self, request : SliceId, context : grpc.ServicerContext) -> Empty: + LOGGER.info('[DeleteSlice] request={:s}'.format(grpc_message_to_json_string(request))) + return self.context_client.RemoveSlice(request) diff --git a/src/common/tools/client/RetryDecorator.py b/src/common/tools/client/RetryDecorator.py index d7bcdb42da9d156dd9f80804e33debcb5c278d83..9a1c0d69fc5d86b8a64a5886884c31e73af27777 100644 --- a/src/common/tools/client/RetryDecorator.py +++ b/src/common/tools/client/RetryDecorator.py @@ -57,7 +57,7 @@ def delay_linear(initial=0, increment=0, maximum=None): def delay_exponential(initial=1, increment=1, maximum=None): def compute(num_try): - delay = initial * pow((num_try - 1), increment) + delay = initial * pow(increment, (num_try - 1)) if maximum is not None: delay = max(delay, maximum) return delay return compute diff --git a/src/common/tools/grpc/Tools.py b/src/common/tools/grpc/Tools.py index 7c6a74348e4e0fa51ac68a40af511f4753c628ae..f0c72a36f18acf2c278f7204352055861b79216f 100644 --- a/src/common/tools/grpc/Tools.py +++ b/src/common/tools/grpc/Tools.py @@ -16,8 +16,9 @@ import json from google.protobuf.json_format import MessageToDict def grpc_message_to_json( - message, including_default_value_fields=True, preserving_proto_field_name=True, use_integers_for_enums=False): - + message, including_default_value_fields=True, preserving_proto_field_name=True, use_integers_for_enums=False + ): + if not hasattr(message, 'DESCRIPTOR'): return json.dumps(str(message), sort_keys=True) # not a gRPC message return MessageToDict( message, including_default_value_fields=including_default_value_fields, preserving_proto_field_name=preserving_proto_field_name, use_integers_for_enums=use_integers_for_enums) diff --git a/src/common/tools/object_factory/Device.py b/src/common/tools/object_factory/Device.py index ae065e9c03127bf26b4e15710431cc1cfad67208..e144b5b4c7af6ffc5a8ed2d6729a53f74d7f9949 100644 --- a/src/common/tools/object_factory/Device.py +++ b/src/common/tools/object_factory/Device.py @@ -20,8 +20,8 @@ from context.proto.context_pb2 import DeviceDriverEnum, DeviceOperationalStatusE DEVICE_DISABLED = DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_DISABLED +DEVICE_EMUOLS_TYPE = DeviceTypeEnum.EMULATED_OPTICAL_LINE_SYSTEM.value DEVICE_EMUPR_TYPE = DeviceTypeEnum.EMULATED_PACKET_ROUTER.value -DEVICE_EMUOLS_TYPE = DeviceTypeEnum.EMULATED_OPTICAL_LINE_SYSTEM.value DEVICE_EMU_DRIVERS = [DeviceDriverEnum.DEVICEDRIVER_UNDEFINED] DEVICE_EMU_ADDRESS = '127.0.0.1' DEVICE_EMU_PORT = '0' @@ -32,6 +32,10 @@ DEVICE_PR_DRIVERS = [DeviceDriverEnum.DEVICEDRIVER_OPENCONFIG] DEVICE_TAPI_TYPE = DeviceTypeEnum.OPTICAL_LINE_SYSTEM.value DEVICE_TAPI_DRIVERS = [DeviceDriverEnum.DEVICEDRIVER_TRANSPORT_API] +# check which enum type and value assign to microwave device +DEVICE_MICROWAVE_TYPE = DeviceTypeEnum.MICROVAWE_RADIO_SYSTEM.value +DEVICE_MICROWAVE_DRIVERS = [DeviceDriverEnum.DEVICEDRIVER_IETF_NETWORK_TOPOLOGY] + DEVICE_P4_TYPE = DeviceTypeEnum.P4_SWITCH.value DEVICE_P4_DRIVERS = [DeviceDriverEnum.DEVICEDRIVER_P4] @@ -81,6 +85,14 @@ def json_device_tapi_disabled( return json_device( device_uuid, DEVICE_TAPI_TYPE, DEVICE_DISABLED, endpoints=endpoints, config_rules=config_rules, drivers=drivers) +def json_device_microwave_disabled( + device_uuid : str, endpoints : List[Dict] = [], config_rules : List[Dict] = [], + drivers : List[Dict] = DEVICE_MICROWAVE_DRIVERS + ): + return json_device( + device_uuid, DEVICE_MICROWAVE_TYPE, DEVICE_DISABLED, endpoints=endpoints, config_rules=config_rules, + drivers=drivers) + def json_device_p4_disabled( device_uuid : str, endpoints : List[Dict] = [], config_rules : List[Dict] = [], drivers : List[Dict] = DEVICE_P4_DRIVERS diff --git a/src/common/tools/object_factory/EndPoint.py b/src/common/tools/object_factory/EndPoint.py index d750604365fc616536374dd3541a17613da4746f..9eca5e96371713d1e095eba4666ee806ad6cf71e 100644 --- a/src/common/tools/object_factory/EndPoint.py +++ b/src/common/tools/object_factory/EndPoint.py @@ -13,13 +13,21 @@ # limitations under the License. import copy -from typing import Dict, List, Optional +from typing import Dict, List, Optional, Tuple def json_endpoint_id(device_id : Dict, endpoint_uuid : str, topology_id : Optional[Dict] = None): result = {'device_id': copy.deepcopy(device_id), 'endpoint_uuid': {'uuid': endpoint_uuid}} if topology_id is not None: result['topology_id'] = copy.deepcopy(topology_id) return result +def json_endpoint_ids( + device_id : Dict, endpoint_descriptors : List[Tuple[str, str, List[int]]], topology_id : Optional[Dict] = None + ): + return [ + json_endpoint_id(device_id, endpoint_uuid, topology_id=topology_id) + for endpoint_uuid, _, _ in endpoint_descriptors + ] + def json_endpoint( device_id : Dict, endpoint_uuid : str, endpoint_type : str, topology_id : Optional[Dict] = None, kpi_sample_types : List[int] = [] @@ -31,3 +39,13 @@ def json_endpoint( } if len(kpi_sample_types) > 0: result['kpi_sample_types'] = copy.deepcopy(kpi_sample_types) return result + +def json_endpoints( + device_id : Dict, endpoint_descriptors : List[Tuple[str, str, List[int]]], topology_id : Optional[Dict] = None + ): + return [ + json_endpoint( + device_id, endpoint_uuid, endpoint_type, topology_id=topology_id, + kpi_sample_types=endpoint_sample_types) + for endpoint_uuid, endpoint_type, endpoint_sample_types in endpoint_descriptors + ] diff --git a/src/common/tools/object_factory/Link.py b/src/common/tools/object_factory/Link.py index fac27945912be6ee24b3808f567ea160e017fb37..624cbb8dcc868ce3575062e31ae3b0609c300637 100644 --- a/src/common/tools/object_factory/Link.py +++ b/src/common/tools/object_factory/Link.py @@ -15,6 +15,11 @@ import copy from typing import Dict, List +def get_link_uuid(a_device_id : Dict, a_endpoint_id : Dict, z_device_id : Dict, z_endpoint_id : Dict) -> str: + return '{:s}/{:s}=={:s}/{:s}'.format( + a_device_id['device_uuid']['uuid'], a_endpoint_id['endpoint_uuid']['uuid'], + z_device_id['device_uuid']['uuid'], z_endpoint_id['endpoint_uuid']['uuid']) + def json_link_id(link_uuid : str): return {'link_uuid': {'uuid': link_uuid}} diff --git a/src/common/tools/service/GenericGrpcService.py b/src/common/tools/service/GenericGrpcService.py new file mode 100644 index 0000000000000000000000000000000000000000..61fccdb02b5a6cbd23600093bcba4c69bf142d83 --- /dev/null +++ b/src/common/tools/service/GenericGrpcService.py @@ -0,0 +1,71 @@ +# 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. + +from typing import Optional, Union +import grpc, logging +from concurrent import futures +from grpc_health.v1.health import HealthServicer, OVERALL_HEALTH +from grpc_health.v1.health_pb2 import HealthCheckResponse +from grpc_health.v1.health_pb2_grpc import add_HealthServicer_to_server +from common.Settings import get_grpc_bind_address, get_grpc_grace_period, get_grpc_max_workers + +class GenericGrpcService: + def __init__( + self, bind_port : Union[str, int], bind_address : Optional[str] = None, max_workers : Optional[int] = None, + grace_period : Optional[int] = None, enable_health_servicer : bool = True, cls_name : str = __name__ + ) -> None: + self.logger = logging.getLogger(cls_name) + self.bind_port = bind_port + self.bind_address = get_grpc_bind_address() if bind_address is None else bind_address + self.max_workers = get_grpc_max_workers() if max_workers is None else max_workers + self.grace_period = get_grpc_grace_period() if grace_period is None else grace_period + self.enable_health_servicer = enable_health_servicer + self.endpoint = None + self.health_servicer = None + self.pool = None + self.server = None + + def install_servicers(self): + pass + + def start(self): + self.endpoint = '{:s}:{:s}'.format(str(self.bind_address), str(self.bind_port)) + self.logger.info('Starting Service (tentative endpoint: {:s}, max_workers: {:s})...'.format( + str(self.endpoint), str(self.max_workers))) + + self.pool = futures.ThreadPoolExecutor(max_workers=self.max_workers) + self.server = grpc.server(self.pool) # , interceptors=(tracer_interceptor,)) + + self.install_servicers() + + if self.enable_health_servicer: + self.health_servicer = HealthServicer( + experimental_non_blocking=True, experimental_thread_pool=futures.ThreadPoolExecutor(max_workers=1)) + add_HealthServicer_to_server(self.health_servicer, self.server) + + self.bind_port = self.server.add_insecure_port(self.endpoint) + self.endpoint = '{:s}:{:s}'.format(str(self.bind_address), str(self.bind_port)) + self.logger.info('Listening on {:s}...'.format(str(self.endpoint))) + self.server.start() + if self.enable_health_servicer: + self.health_servicer.set(OVERALL_HEALTH, HealthCheckResponse.SERVING) # pylint: disable=maybe-no-member + + self.logger.debug('Service started') + + def stop(self): + self.logger.debug('Stopping service (grace period {:s} seconds)...'.format(str(self.grace_period))) + if self.enable_health_servicer: + self.health_servicer.enter_graceful_shutdown() + self.server.stop(self.grace_period) + self.logger.debug('Service stopped') diff --git a/src/common/tools/service/GenericRestServer.py b/src/common/tools/service/GenericRestServer.py new file mode 100644 index 0000000000000000000000000000000000000000..4325fe1dbc0169665a1281b27e6993670add337c --- /dev/null +++ b/src/common/tools/service/GenericRestServer.py @@ -0,0 +1,59 @@ +# 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. + +import functools, logging, threading, time +from typing import Optional, Union +from flask import Flask, request +from flask_restful import Api, Resource +from werkzeug.serving import make_server +from common.Settings import get_http_bind_address + +logging.getLogger('werkzeug').setLevel(logging.WARNING) + + +def log_request(logger, response): + timestamp = time.strftime('[%Y-%b-%d %H:%M]') + logger.info('%s %s %s %s %s', timestamp, request.remote_addr, request.method, request.full_path, response.status) + return response + +class GenericRestServer(threading.Thread): + def __init__( + self, bind_port : Union[str, int], base_url : str, bind_address : Optional[str] = None, + cls_name : str = __name__ + ) -> None: + threading.Thread.__init__(self, daemon=True) + self.logger = logging.getLogger(cls_name) + self.bind_port = bind_port + self.base_url = base_url + self.bind_address = get_http_bind_address() if bind_address is None else bind_address + self.endpoint = 'http://{:s}:{:s}{:s}'.format(str(self.bind_address), str(self.bind_port), str(self.base_url)) + self.srv = None + self.ctx = None + self.app = Flask(__name__) + self.app.after_request(functools.partial(log_request, self.logger)) + self.api = Api(self.app, prefix=self.base_url) + + def add_resource(self, resource : Resource, *urls, **kwargs): + self.api.add_resource(resource, *urls, **kwargs) + + def run(self): + self.srv = make_server(self.bind_address, self.bind_port, self.app, threaded=True) + self.ctx = self.app.app_context() + self.ctx.push() + + self.logger.info('Listening on {:s}...'.format(str(self.endpoint))) + self.srv.serve_forever() + + def shutdown(self): + self.srv.shutdown() diff --git a/src/common/tools/service/__init__.py b/src/common/tools/service/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/common/tools/service/__init__.py @@ -0,0 +1,14 @@ +# 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. + diff --git a/src/compute/.gitlab-ci.yml b/src/compute/.gitlab-ci.yml index 7daa1764a9c10a79df3cc1b2aadb270b982c1224..f3d7c0f306b9d62a89382578bfb6c4c740b389e6 100644 --- a/src/compute/.gitlab-ci.yml +++ b/src/compute/.gitlab-ci.yml @@ -56,7 +56,6 @@ unit test compute: - docker ps -a - docker logs $IMAGE_NAME - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml" - - docker exec -i $IMAGE_NAME bash -c "coverage xml -o /opt/results/${IMAGE_NAME}_coverage.xml" - docker exec -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing" coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' after_script: @@ -64,7 +63,7 @@ unit test compute: - docker network rm teraflowbridge rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' - - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' - changes: - src/$IMAGE_NAME/**/*.{py,in,yml} - src/$IMAGE_NAME/Dockerfile @@ -76,7 +75,6 @@ unit test compute: when: always reports: junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml - cobertura: src/$IMAGE_NAME/tests/${IMAGE_NAME}_coverage.xml # Deployment of the service in Kubernetes Cluster deploy compute: diff --git a/src/compute/Config.py b/src/compute/Config.py index c568be4476326be0080aad9f88be0183d82ef833..341ae77f506ce1d2488c3d494262ee26ca6dd7eb 100644 --- a/src/compute/Config.py +++ b/src/compute/Config.py @@ -12,23 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -import logging from werkzeug.security import generate_password_hash -# General settings -LOG_LEVEL = logging.WARNING - -# gRPC settings -GRPC_SERVICE_PORT = 9090 -GRPC_MAX_WORKERS = 10 -GRPC_GRACE_PERIOD = 60 - -# REST-API settings -RESTAPI_SERVICE_PORT = 8080 -RESTAPI_BASE_URL = '/restconf/data' +# REST-API users RESTAPI_USERS = { # TODO: implement a database of credentials and permissions 'admin': generate_password_hash('admin'), } - -# Prometheus settings -METRICS_PORT = 9192 diff --git a/src/compute/Dockerfile b/src/compute/Dockerfile index 6d3cafda9f02cb5e90947eb8b235182644371be2..bb10332d155101f708019cb6b8b99c7c6bef45a6 100644 --- a/src/compute/Dockerfile +++ b/src/compute/Dockerfile @@ -46,6 +46,7 @@ COPY common/. common COPY compute/. compute COPY context/. context COPY service/. service +COPY slice/. slice # Start compute service ENTRYPOINT ["python", "-m", "compute.service"] diff --git a/src/compute/client/ComputeClient.py b/src/compute/client/ComputeClient.py index ac85500294f0288e7d0e86f77cd7c415f28ef5e5..5c2cfa8b68406e463467ab3a565b6aae6de56e99 100644 --- a/src/compute/client/ComputeClient.py +++ b/src/compute/client/ComputeClient.py @@ -13,7 +13,10 @@ # limitations under the License. import grpc, logging +from common.Constants import ServiceNameEnum +from common.Settings import get_service_host, get_service_port_grpc from common.tools.client.RetryDecorator import retry, delay_exponential +from common.tools.grpc.Tools import grpc_message_to_json_string from compute.proto.compute_pb2_grpc import ComputeServiceStub from compute.proto.context_pb2 import ( AuthenticationResult, Empty, Service, ServiceId, ServiceIdList, ServiceStatus, TeraFlowController) @@ -24,8 +27,10 @@ DELAY_FUNCTION = delay_exponential(initial=0.01, increment=2.0, maximum=5.0) RETRY_DECORATOR = retry(max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') class ComputeClient: - def __init__(self, address, port): - self.endpoint = '{:s}:{:s}'.format(str(address), str(port)) + def __init__(self, host=None, port=None): + if not host: host = get_service_host(ServiceNameEnum.COMPUTE) + if not port: port = get_service_port_grpc(ServiceNameEnum.COMPUTE) + self.endpoint = '{:s}:{:s}'.format(str(host), str(port)) LOGGER.debug('Creating channel to {:s}...'.format(str(self.endpoint))) self.channel = None self.stub = None @@ -37,55 +42,55 @@ class ComputeClient: self.stub = ComputeServiceStub(self.channel) def close(self): - if(self.channel is not None): self.channel.close() + if self.channel is not None: self.channel.close() self.channel = None self.stub = None @RETRY_DECORATOR def CheckCredentials(self, request : TeraFlowController) -> AuthenticationResult: - LOGGER.debug('CheckCredentials request: {:s}'.format(str(request))) + LOGGER.debug('CheckCredentials request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.CheckCredentials(request) - LOGGER.debug('CheckCredentials result: {:s}'.format(str(response))) + LOGGER.debug('CheckCredentials result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def GetConnectivityServiceStatus(self, request : ServiceId) -> ServiceStatus: - LOGGER.debug('GetConnectivityServiceStatus request: {:s}'.format(str(request))) + LOGGER.debug('GetConnectivityServiceStatus request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.GetConnectivityServiceStatus(request) - LOGGER.debug('GetConnectivityServiceStatus result: {:s}'.format(str(response))) + LOGGER.debug('GetConnectivityServiceStatus result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def CreateConnectivityService(self, request : Service) -> ServiceId: - LOGGER.debug('CreateConnectivityService request: {:s}'.format(str(request))) + LOGGER.debug('CreateConnectivityService request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.CreateConnectivityService(request) - LOGGER.debug('CreateConnectivityService result: {:s}'.format(str(response))) + LOGGER.debug('CreateConnectivityService result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def EditConnectivityService(self, request : Service) -> ServiceId: - LOGGER.debug('EditConnectivityService request: {:s}'.format(str(request))) + LOGGER.debug('EditConnectivityService request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.EditConnectivityService(request) - LOGGER.debug('EditConnectivityService result: {:s}'.format(str(response))) + LOGGER.debug('EditConnectivityService result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def DeleteConnectivityService(self, request : Service) -> Empty: - LOGGER.debug('DeleteConnectivityService request: {:s}'.format(str(request))) + LOGGER.debug('DeleteConnectivityService request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.DeleteConnectivityService(request) - LOGGER.debug('DeleteConnectivityService result: {:s}'.format(str(response))) + LOGGER.debug('DeleteConnectivityService result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def GetAllActiveConnectivityServices(self, request : Empty) -> ServiceIdList: - LOGGER.debug('GetAllActiveConnectivityServices request: {:s}'.format(str(request))) + LOGGER.debug('GetAllActiveConnectivityServices request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.GetAllActiveConnectivityServices(request) - LOGGER.debug('GetAllActiveConnectivityServices result: {:s}'.format(str(response))) + LOGGER.debug('GetAllActiveConnectivityServices result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def ClearAllConnectivityServices(self, request : Empty) -> Empty: - LOGGER.debug('ClearAllConnectivityServices request: {:s}'.format(str(request))) + LOGGER.debug('ClearAllConnectivityServices request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.ClearAllConnectivityServices(request) - LOGGER.debug('ClearAllConnectivityServices result: {:s}'.format(str(response))) + LOGGER.debug('ClearAllConnectivityServices result: {:s}'.format(grpc_message_to_json_string(response))) return response diff --git a/src/compute/genproto.sh b/src/compute/genproto.sh index c991aaf01610a0d54c96683cb4c4cb49490d74a1..0c0245c3e42e7dbf1fa1a2e49ea1dcd3f3191bd7 100755 --- a/src/compute/genproto.sh +++ b/src/compute/genproto.sh @@ -1,6 +1,6 @@ #!/bin/bash -eu # -# Copyright 2018 Google LLC +# 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. @@ -14,14 +14,27 @@ # See the License for the specific language governing permissions and # limitations under the License. -#!/bin/bash -e - # Make folder containing the script the root folder for its execution cd $(dirname $0) rm -rf proto/*.py rm -rf proto/__pycache__ -touch proto/__init__.py +tee proto/__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 python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto context.proto python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto service.proto diff --git a/src/compute/proto/context_pb2.py b/src/compute/proto/context_pb2.py index 68602b16f264ceac9acc3ef6669b09d5984e72c2..50d501d3ac053ad644554331af26e3c40cd426a1 100644 --- a/src/compute/proto/context_pb2.py +++ b/src/compute/proto/context_pb2.py @@ -21,7 +21,7 @@ DESCRIPTOR = _descriptor.FileDescriptor( syntax='proto3', serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\rcontext.proto\x12\x07\x63ontext\x1a\x16kpi_sample_types.proto\"\x07\n\x05\x45mpty\"\x14\n\x04Uuid\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"F\n\x05\x45vent\x12\x11\n\ttimestamp\x18\x01 \x01(\x01\x12*\n\nevent_type\x18\x02 \x01(\x0e\x32\x16.context.EventTypeEnum\"0\n\tContextId\x12#\n\x0c\x63ontext_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xb6\x01\n\x07\x43ontext\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12)\n\x0ctopology_ids\x18\x02 \x03(\x0b\x32\x13.context.TopologyId\x12\'\n\x0bservice_ids\x18\x03 \x03(\x0b\x32\x12.context.ServiceId\x12/\n\ncontroller\x18\x04 \x01(\x0b\x32\x1b.context.TeraFlowController\"8\n\rContextIdList\x12\'\n\x0b\x63ontext_ids\x18\x01 \x03(\x0b\x32\x12.context.ContextId\"1\n\x0b\x43ontextList\x12\"\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32\x10.context.Context\"U\n\x0c\x43ontextEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\ncontext_id\x18\x02 \x01(\x0b\x32\x12.context.ContextId\"Z\n\nTopologyId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12$\n\rtopology_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"~\n\x08Topology\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12%\n\ndevice_ids\x18\x02 \x03(\x0b\x32\x11.context.DeviceId\x12!\n\x08link_ids\x18\x03 \x03(\x0b\x32\x0f.context.LinkId\";\n\x0eTopologyIdList\x12)\n\x0ctopology_ids\x18\x01 \x03(\x0b\x32\x13.context.TopologyId\"5\n\x0cTopologyList\x12%\n\ntopologies\x18\x01 \x03(\x0b\x32\x11.context.Topology\"X\n\rTopologyEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12(\n\x0btopology_id\x18\x02 \x01(\x0b\x32\x13.context.TopologyId\".\n\x08\x44\x65viceId\x12\"\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x9a\x02\n\x06\x44\x65vice\x12$\n\tdevice_id\x18\x01 \x01(\x0b\x32\x11.context.DeviceId\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12,\n\rdevice_config\x18\x03 \x01(\x0b\x32\x15.context.DeviceConfig\x12G\n\x19\x64\x65vice_operational_status\x18\x04 \x01(\x0e\x32$.context.DeviceOperationalStatusEnum\x12\x31\n\x0e\x64\x65vice_drivers\x18\x05 \x03(\x0e\x32\x19.context.DeviceDriverEnum\x12+\n\x10\x64\x65vice_endpoints\x18\x06 \x03(\x0b\x32\x11.context.EndPoint\"9\n\x0c\x44\x65viceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"5\n\x0c\x44\x65viceIdList\x12%\n\ndevice_ids\x18\x01 \x03(\x0b\x32\x11.context.DeviceId\".\n\nDeviceList\x12 \n\x07\x64\x65vices\x18\x01 \x03(\x0b\x32\x0f.context.Device\"R\n\x0b\x44\x65viceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"*\n\x06LinkId\x12 \n\tlink_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"X\n\x04Link\x12 \n\x07link_id\x18\x01 \x01(\x0b\x32\x0f.context.LinkId\x12.\n\x11link_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\"/\n\nLinkIdList\x12!\n\x08link_ids\x18\x01 \x03(\x0b\x32\x0f.context.LinkId\"(\n\x08LinkList\x12\x1c\n\x05links\x18\x01 \x03(\x0b\x32\r.context.Link\"L\n\tLinkEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12 \n\x07link_id\x18\x02 \x01(\x0b\x32\x0f.context.LinkId\"X\n\tServiceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12#\n\x0cservice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\xa6\x02\n\x07Service\x12&\n\nservice_id\x18\x01 \x01(\x0b\x32\x12.context.ServiceId\x12.\n\x0cservice_type\x18\x02 \x01(\x0e\x32\x18.context.ServiceTypeEnum\x12\x31\n\x14service_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12\x30\n\x13service_constraints\x18\x04 \x03(\x0b\x32\x13.context.Constraint\x12.\n\x0eservice_status\x18\x05 \x01(\x0b\x32\x16.context.ServiceStatus\x12.\n\x0eservice_config\x18\x06 \x01(\x0b\x32\x16.context.ServiceConfig\"C\n\rServiceStatus\x12\x32\n\x0eservice_status\x18\x01 \x01(\x0e\x32\x1a.context.ServiceStatusEnum\":\n\rServiceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"8\n\rServiceIdList\x12\'\n\x0bservice_ids\x18\x01 \x03(\x0b\x32\x12.context.ServiceId\"1\n\x0bServiceList\x12\"\n\x08services\x18\x01 \x03(\x0b\x32\x10.context.Service\"U\n\x0cServiceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\"6\n\x0c\x43onnectionId\x12&\n\x0f\x63onnection_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xc4\x01\n\nConnection\x12,\n\rconnection_id\x18\x01 \x01(\x0b\x32\x15.context.ConnectionId\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\x12\x33\n\x16path_hops_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12+\n\x0fsub_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\"A\n\x10\x43onnectionIdList\x12-\n\x0e\x63onnection_ids\x18\x01 \x03(\x0b\x32\x15.context.ConnectionId\":\n\x0e\x43onnectionList\x12(\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x13.context.Connection\"^\n\x0f\x43onnectionEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12,\n\rconnection_id\x18\x02 \x01(\x0b\x32\x15.context.ConnectionId\"\x82\x01\n\nEndPointId\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\x12$\n\rendpoint_uuid\x18\x03 \x01(\x0b\x32\r.context.Uuid\"\x86\x01\n\x08\x45ndPoint\x12(\n\x0b\x65ndpoint_id\x18\x01 \x01(\x0b\x32\x13.context.EndPointId\x12\x15\n\rendpoint_type\x18\x02 \x01(\t\x12\x39\n\x10kpi_sample_types\x18\x03 \x03(\x0e\x32\x1f.kpi_sample_types.KpiSampleType\"e\n\nConfigRule\x12)\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x19.context.ConfigActionEnum\x12\x14\n\x0cresource_key\x18\x02 \x01(\t\x12\x16\n\x0eresource_value\x18\x03 \x01(\t\"?\n\nConstraint\x12\x17\n\x0f\x63onstraint_type\x18\x01 \x01(\t\x12\x18\n\x10\x63onstraint_value\x18\x02 \x01(\t\"^\n\x12TeraFlowController\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x12\n\nip_address\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\"U\n\x14\x41uthenticationResult\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x15\n\rauthenticated\x18\x02 \x01(\x08*j\n\rEventTypeEnum\x12\x17\n\x13\x45VENTTYPE_UNDEFINED\x10\x00\x12\x14\n\x10\x45VENTTYPE_CREATE\x10\x01\x12\x14\n\x10\x45VENTTYPE_UPDATE\x10\x02\x12\x14\n\x10\x45VENTTYPE_REMOVE\x10\x03*\xc5\x01\n\x10\x44\x65viceDriverEnum\x12\x1a\n\x16\x44\x45VICEDRIVER_UNDEFINED\x10\x00\x12\x1b\n\x17\x44\x45VICEDRIVER_OPENCONFIG\x10\x01\x12\x1e\n\x1a\x44\x45VICEDRIVER_TRANSPORT_API\x10\x02\x12\x13\n\x0f\x44\x45VICEDRIVER_P4\x10\x03\x12&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOGY\x10\x04\x12\x1b\n\x17\x44\x45VICEDRIVER_ONF_TR_352\x10\x05*\x8f\x01\n\x1b\x44\x65viceOperationalStatusEnum\x12%\n!DEVICEOPERATIONALSTATUS_UNDEFINED\x10\x00\x12$\n DEVICEOPERATIONALSTATUS_DISABLED\x10\x01\x12#\n\x1f\x44\x45VICEOPERATIONALSTATUS_ENABLED\x10\x02*\x81\x01\n\x0fServiceTypeEnum\x12\x17\n\x13SERVICETYPE_UNKNOWN\x10\x00\x12\x14\n\x10SERVICETYPE_L3NM\x10\x01\x12\x14\n\x10SERVICETYPE_L2NM\x10\x02\x12)\n%SERVICETYPE_TAPI_CONNECTIVITY_SERVICE\x10\x03*\x88\x01\n\x11ServiceStatusEnum\x12\x1b\n\x17SERVICESTATUS_UNDEFINED\x10\x00\x12\x19\n\x15SERVICESTATUS_PLANNED\x10\x01\x12\x18\n\x14SERVICESTATUS_ACTIVE\x10\x02\x12!\n\x1dSERVICESTATUS_PENDING_REMOVAL\x10\x03*]\n\x10\x43onfigActionEnum\x12\x1a\n\x16\x43ONFIGACTION_UNDEFINED\x10\x00\x12\x14\n\x10\x43ONFIGACTION_SET\x10\x01\x12\x17\n\x13\x43ONFIGACTION_DELETE\x10\x02\x32\xad\x10\n\x0e\x43ontextService\x12:\n\x0eListContextIds\x12\x0e.context.Empty\x1a\x16.context.ContextIdList\"\x00\x12\x36\n\x0cListContexts\x12\x0e.context.Empty\x1a\x14.context.ContextList\"\x00\x12\x34\n\nGetContext\x12\x12.context.ContextId\x1a\x10.context.Context\"\x00\x12\x34\n\nSetContext\x12\x10.context.Context\x1a\x12.context.ContextId\"\x00\x12\x35\n\rRemoveContext\x12\x12.context.ContextId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetContextEvents\x12\x0e.context.Empty\x1a\x15.context.ContextEvent\"\x00\x30\x01\x12@\n\x0fListTopologyIds\x12\x12.context.ContextId\x1a\x17.context.TopologyIdList\"\x00\x12=\n\x0eListTopologies\x12\x12.context.ContextId\x1a\x15.context.TopologyList\"\x00\x12\x37\n\x0bGetTopology\x12\x13.context.TopologyId\x1a\x11.context.Topology\"\x00\x12\x37\n\x0bSetTopology\x12\x11.context.Topology\x1a\x13.context.TopologyId\"\x00\x12\x37\n\x0eRemoveTopology\x12\x13.context.TopologyId\x1a\x0e.context.Empty\"\x00\x12?\n\x11GetTopologyEvents\x12\x0e.context.Empty\x1a\x16.context.TopologyEvent\"\x00\x30\x01\x12\x38\n\rListDeviceIds\x12\x0e.context.Empty\x1a\x15.context.DeviceIdList\"\x00\x12\x34\n\x0bListDevices\x12\x0e.context.Empty\x1a\x13.context.DeviceList\"\x00\x12\x31\n\tGetDevice\x12\x11.context.DeviceId\x1a\x0f.context.Device\"\x00\x12\x31\n\tSetDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0cRemoveDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x12;\n\x0fGetDeviceEvents\x12\x0e.context.Empty\x1a\x14.context.DeviceEvent\"\x00\x30\x01\x12\x34\n\x0bListLinkIds\x12\x0e.context.Empty\x1a\x13.context.LinkIdList\"\x00\x12\x30\n\tListLinks\x12\x0e.context.Empty\x1a\x11.context.LinkList\"\x00\x12+\n\x07GetLink\x12\x0f.context.LinkId\x1a\r.context.Link\"\x00\x12+\n\x07SetLink\x12\r.context.Link\x1a\x0f.context.LinkId\"\x00\x12/\n\nRemoveLink\x12\x0f.context.LinkId\x1a\x0e.context.Empty\"\x00\x12\x37\n\rGetLinkEvents\x12\x0e.context.Empty\x1a\x12.context.LinkEvent\"\x00\x30\x01\x12>\n\x0eListServiceIds\x12\x12.context.ContextId\x1a\x16.context.ServiceIdList\"\x00\x12:\n\x0cListServices\x12\x12.context.ContextId\x1a\x14.context.ServiceList\"\x00\x12\x34\n\nGetService\x12\x12.context.ServiceId\x1a\x10.context.Service\"\x00\x12\x34\n\nSetService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rRemoveService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetServiceEvents\x12\x0e.context.Empty\x1a\x15.context.ServiceEvent\"\x00\x30\x01\x12\x44\n\x11ListConnectionIds\x12\x12.context.ServiceId\x1a\x19.context.ConnectionIdList\"\x00\x12@\n\x0fListConnections\x12\x12.context.ServiceId\x1a\x17.context.ConnectionList\"\x00\x12=\n\rGetConnection\x12\x15.context.ConnectionId\x1a\x13.context.Connection\"\x00\x12=\n\rSetConnection\x12\x13.context.Connection\x1a\x15.context.ConnectionId\"\x00\x12;\n\x10RemoveConnection\x12\x15.context.ConnectionId\x1a\x0e.context.Empty\"\x00\x12\x43\n\x13GetConnectionEvents\x12\x0e.context.Empty\x1a\x18.context.ConnectionEvent\"\x00\x30\x01\x62\x06proto3' + serialized_pb=b'\n\rcontext.proto\x12\x07\x63ontext\x1a\x16kpi_sample_types.proto\"\x07\n\x05\x45mpty\"\x14\n\x04Uuid\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"F\n\x05\x45vent\x12\x11\n\ttimestamp\x18\x01 \x01(\x01\x12*\n\nevent_type\x18\x02 \x01(\x0e\x32\x16.context.EventTypeEnum\"0\n\tContextId\x12#\n\x0c\x63ontext_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xb6\x01\n\x07\x43ontext\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12)\n\x0ctopology_ids\x18\x02 \x03(\x0b\x32\x13.context.TopologyId\x12\'\n\x0bservice_ids\x18\x03 \x03(\x0b\x32\x12.context.ServiceId\x12/\n\ncontroller\x18\x04 \x01(\x0b\x32\x1b.context.TeraFlowController\"8\n\rContextIdList\x12\'\n\x0b\x63ontext_ids\x18\x01 \x03(\x0b\x32\x12.context.ContextId\"1\n\x0b\x43ontextList\x12\"\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32\x10.context.Context\"U\n\x0c\x43ontextEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\ncontext_id\x18\x02 \x01(\x0b\x32\x12.context.ContextId\"Z\n\nTopologyId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12$\n\rtopology_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"~\n\x08Topology\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12%\n\ndevice_ids\x18\x02 \x03(\x0b\x32\x11.context.DeviceId\x12!\n\x08link_ids\x18\x03 \x03(\x0b\x32\x0f.context.LinkId\";\n\x0eTopologyIdList\x12)\n\x0ctopology_ids\x18\x01 \x03(\x0b\x32\x13.context.TopologyId\"5\n\x0cTopologyList\x12%\n\ntopologies\x18\x01 \x03(\x0b\x32\x11.context.Topology\"X\n\rTopologyEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12(\n\x0btopology_id\x18\x02 \x01(\x0b\x32\x13.context.TopologyId\".\n\x08\x44\x65viceId\x12\"\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x9a\x02\n\x06\x44\x65vice\x12$\n\tdevice_id\x18\x01 \x01(\x0b\x32\x11.context.DeviceId\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12,\n\rdevice_config\x18\x03 \x01(\x0b\x32\x15.context.DeviceConfig\x12G\n\x19\x64\x65vice_operational_status\x18\x04 \x01(\x0e\x32$.context.DeviceOperationalStatusEnum\x12\x31\n\x0e\x64\x65vice_drivers\x18\x05 \x03(\x0e\x32\x19.context.DeviceDriverEnum\x12+\n\x10\x64\x65vice_endpoints\x18\x06 \x03(\x0b\x32\x11.context.EndPoint\"9\n\x0c\x44\x65viceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"5\n\x0c\x44\x65viceIdList\x12%\n\ndevice_ids\x18\x01 \x03(\x0b\x32\x11.context.DeviceId\".\n\nDeviceList\x12 \n\x07\x64\x65vices\x18\x01 \x03(\x0b\x32\x0f.context.Device\"R\n\x0b\x44\x65viceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"*\n\x06LinkId\x12 \n\tlink_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"X\n\x04Link\x12 \n\x07link_id\x18\x01 \x01(\x0b\x32\x0f.context.LinkId\x12.\n\x11link_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\"/\n\nLinkIdList\x12!\n\x08link_ids\x18\x01 \x03(\x0b\x32\x0f.context.LinkId\"(\n\x08LinkList\x12\x1c\n\x05links\x18\x01 \x03(\x0b\x32\r.context.Link\"L\n\tLinkEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12 \n\x07link_id\x18\x02 \x01(\x0b\x32\x0f.context.LinkId\"X\n\tServiceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12#\n\x0cservice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\xa6\x02\n\x07Service\x12&\n\nservice_id\x18\x01 \x01(\x0b\x32\x12.context.ServiceId\x12.\n\x0cservice_type\x18\x02 \x01(\x0e\x32\x18.context.ServiceTypeEnum\x12\x31\n\x14service_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12\x30\n\x13service_constraints\x18\x04 \x03(\x0b\x32\x13.context.Constraint\x12.\n\x0eservice_status\x18\x05 \x01(\x0b\x32\x16.context.ServiceStatus\x12.\n\x0eservice_config\x18\x06 \x01(\x0b\x32\x16.context.ServiceConfig\"C\n\rServiceStatus\x12\x32\n\x0eservice_status\x18\x01 \x01(\x0e\x32\x1a.context.ServiceStatusEnum\":\n\rServiceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"8\n\rServiceIdList\x12\'\n\x0bservice_ids\x18\x01 \x03(\x0b\x32\x12.context.ServiceId\"1\n\x0bServiceList\x12\"\n\x08services\x18\x01 \x03(\x0b\x32\x10.context.Service\"U\n\x0cServiceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\"T\n\x07SliceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12!\n\nslice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\x95\x02\n\x05Slice\x12\"\n\x08slice_id\x18\x01 \x01(\x0b\x32\x10.context.SliceId\x12/\n\x12slice_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\x12.\n\x11slice_constraints\x18\x03 \x03(\x0b\x32\x13.context.Constraint\x12-\n\x11slice_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\x12,\n\x12slice_subslice_ids\x18\x05 \x03(\x0b\x32\x10.context.SliceId\x12*\n\x0cslice_status\x18\x06 \x01(\x0b\x32\x14.context.SliceStatus\"=\n\x0bSliceStatus\x12.\n\x0cslice_status\x18\x01 \x01(\x0e\x32\x18.context.SliceStatusEnum\"2\n\x0bSliceIdList\x12#\n\tslice_ids\x18\x01 \x03(\x0b\x32\x10.context.SliceId\"+\n\tSliceList\x12\x1e\n\x06slices\x18\x01 \x03(\x0b\x32\x0e.context.Slice\"O\n\nSliceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12\"\n\x08slice_id\x18\x02 \x01(\x0b\x32\x10.context.SliceId\"6\n\x0c\x43onnectionId\x12&\n\x0f\x63onnection_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xc4\x01\n\nConnection\x12,\n\rconnection_id\x18\x01 \x01(\x0b\x32\x15.context.ConnectionId\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\x12\x33\n\x16path_hops_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12+\n\x0fsub_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\"A\n\x10\x43onnectionIdList\x12-\n\x0e\x63onnection_ids\x18\x01 \x03(\x0b\x32\x15.context.ConnectionId\":\n\x0e\x43onnectionList\x12(\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x13.context.Connection\"^\n\x0f\x43onnectionEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12,\n\rconnection_id\x18\x02 \x01(\x0b\x32\x15.context.ConnectionId\"\x82\x01\n\nEndPointId\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\x12$\n\rendpoint_uuid\x18\x03 \x01(\x0b\x32\r.context.Uuid\"\x86\x01\n\x08\x45ndPoint\x12(\n\x0b\x65ndpoint_id\x18\x01 \x01(\x0b\x32\x13.context.EndPointId\x12\x15\n\rendpoint_type\x18\x02 \x01(\t\x12\x39\n\x10kpi_sample_types\x18\x03 \x03(\x0e\x32\x1f.kpi_sample_types.KpiSampleType\"e\n\nConfigRule\x12)\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x19.context.ConfigActionEnum\x12\x14\n\x0cresource_key\x18\x02 \x01(\t\x12\x16\n\x0eresource_value\x18\x03 \x01(\t\"?\n\nConstraint\x12\x17\n\x0f\x63onstraint_type\x18\x01 \x01(\t\x12\x18\n\x10\x63onstraint_value\x18\x02 \x01(\t\"^\n\x12TeraFlowController\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x12\n\nip_address\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\"U\n\x14\x41uthenticationResult\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x15\n\rauthenticated\x18\x02 \x01(\x08*j\n\rEventTypeEnum\x12\x17\n\x13\x45VENTTYPE_UNDEFINED\x10\x00\x12\x14\n\x10\x45VENTTYPE_CREATE\x10\x01\x12\x14\n\x10\x45VENTTYPE_UPDATE\x10\x02\x12\x14\n\x10\x45VENTTYPE_REMOVE\x10\x03*\xc5\x01\n\x10\x44\x65viceDriverEnum\x12\x1a\n\x16\x44\x45VICEDRIVER_UNDEFINED\x10\x00\x12\x1b\n\x17\x44\x45VICEDRIVER_OPENCONFIG\x10\x01\x12\x1e\n\x1a\x44\x45VICEDRIVER_TRANSPORT_API\x10\x02\x12\x13\n\x0f\x44\x45VICEDRIVER_P4\x10\x03\x12&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOGY\x10\x04\x12\x1b\n\x17\x44\x45VICEDRIVER_ONF_TR_352\x10\x05*\x8f\x01\n\x1b\x44\x65viceOperationalStatusEnum\x12%\n!DEVICEOPERATIONALSTATUS_UNDEFINED\x10\x00\x12$\n DEVICEOPERATIONALSTATUS_DISABLED\x10\x01\x12#\n\x1f\x44\x45VICEOPERATIONALSTATUS_ENABLED\x10\x02*\x81\x01\n\x0fServiceTypeEnum\x12\x17\n\x13SERVICETYPE_UNKNOWN\x10\x00\x12\x14\n\x10SERVICETYPE_L3NM\x10\x01\x12\x14\n\x10SERVICETYPE_L2NM\x10\x02\x12)\n%SERVICETYPE_TAPI_CONNECTIVITY_SERVICE\x10\x03*\x88\x01\n\x11ServiceStatusEnum\x12\x1b\n\x17SERVICESTATUS_UNDEFINED\x10\x00\x12\x19\n\x15SERVICESTATUS_PLANNED\x10\x01\x12\x18\n\x14SERVICESTATUS_ACTIVE\x10\x02\x12!\n\x1dSERVICESTATUS_PENDING_REMOVAL\x10\x03*\x8b\x01\n\x0fSliceStatusEnum\x12\x19\n\x15SLICESTATUS_UNDEFINED\x10\x00\x12\x17\n\x13SLICESTATUS_PLANNED\x10\x01\x12\x14\n\x10SLICESTATUS_INIT\x10\x02\x12\x16\n\x12SLICESTATUS_ACTIVE\x10\x03\x12\x16\n\x12SLICESTATUS_DEINIT\x10\x04*]\n\x10\x43onfigActionEnum\x12\x1a\n\x16\x43ONFIGACTION_UNDEFINED\x10\x00\x12\x14\n\x10\x43ONFIGACTION_SET\x10\x01\x12\x17\n\x13\x43ONFIGACTION_DELETE\x10\x02\x32\xef\x12\n\x0e\x43ontextService\x12:\n\x0eListContextIds\x12\x0e.context.Empty\x1a\x16.context.ContextIdList\"\x00\x12\x36\n\x0cListContexts\x12\x0e.context.Empty\x1a\x14.context.ContextList\"\x00\x12\x34\n\nGetContext\x12\x12.context.ContextId\x1a\x10.context.Context\"\x00\x12\x34\n\nSetContext\x12\x10.context.Context\x1a\x12.context.ContextId\"\x00\x12\x35\n\rRemoveContext\x12\x12.context.ContextId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetContextEvents\x12\x0e.context.Empty\x1a\x15.context.ContextEvent\"\x00\x30\x01\x12@\n\x0fListTopologyIds\x12\x12.context.ContextId\x1a\x17.context.TopologyIdList\"\x00\x12=\n\x0eListTopologies\x12\x12.context.ContextId\x1a\x15.context.TopologyList\"\x00\x12\x37\n\x0bGetTopology\x12\x13.context.TopologyId\x1a\x11.context.Topology\"\x00\x12\x37\n\x0bSetTopology\x12\x11.context.Topology\x1a\x13.context.TopologyId\"\x00\x12\x37\n\x0eRemoveTopology\x12\x13.context.TopologyId\x1a\x0e.context.Empty\"\x00\x12?\n\x11GetTopologyEvents\x12\x0e.context.Empty\x1a\x16.context.TopologyEvent\"\x00\x30\x01\x12\x38\n\rListDeviceIds\x12\x0e.context.Empty\x1a\x15.context.DeviceIdList\"\x00\x12\x34\n\x0bListDevices\x12\x0e.context.Empty\x1a\x13.context.DeviceList\"\x00\x12\x31\n\tGetDevice\x12\x11.context.DeviceId\x1a\x0f.context.Device\"\x00\x12\x31\n\tSetDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0cRemoveDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x12;\n\x0fGetDeviceEvents\x12\x0e.context.Empty\x1a\x14.context.DeviceEvent\"\x00\x30\x01\x12\x34\n\x0bListLinkIds\x12\x0e.context.Empty\x1a\x13.context.LinkIdList\"\x00\x12\x30\n\tListLinks\x12\x0e.context.Empty\x1a\x11.context.LinkList\"\x00\x12+\n\x07GetLink\x12\x0f.context.LinkId\x1a\r.context.Link\"\x00\x12+\n\x07SetLink\x12\r.context.Link\x1a\x0f.context.LinkId\"\x00\x12/\n\nRemoveLink\x12\x0f.context.LinkId\x1a\x0e.context.Empty\"\x00\x12\x37\n\rGetLinkEvents\x12\x0e.context.Empty\x1a\x12.context.LinkEvent\"\x00\x30\x01\x12>\n\x0eListServiceIds\x12\x12.context.ContextId\x1a\x16.context.ServiceIdList\"\x00\x12:\n\x0cListServices\x12\x12.context.ContextId\x1a\x14.context.ServiceList\"\x00\x12\x34\n\nGetService\x12\x12.context.ServiceId\x1a\x10.context.Service\"\x00\x12\x34\n\nSetService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rRemoveService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetServiceEvents\x12\x0e.context.Empty\x1a\x15.context.ServiceEvent\"\x00\x30\x01\x12:\n\x0cListSliceIds\x12\x12.context.ContextId\x1a\x14.context.SliceIdList\"\x00\x12\x36\n\nListSlices\x12\x12.context.ContextId\x1a\x12.context.SliceList\"\x00\x12.\n\x08GetSlice\x12\x10.context.SliceId\x1a\x0e.context.Slice\"\x00\x12.\n\x08SetSlice\x12\x0e.context.Slice\x1a\x10.context.SliceId\"\x00\x12\x31\n\x0bRemoveSlice\x12\x10.context.SliceId\x1a\x0e.context.Empty\"\x00\x12\x39\n\x0eGetSliceEvents\x12\x0e.context.Empty\x1a\x13.context.SliceEvent\"\x00\x30\x01\x12\x44\n\x11ListConnectionIds\x12\x12.context.ServiceId\x1a\x19.context.ConnectionIdList\"\x00\x12@\n\x0fListConnections\x12\x12.context.ServiceId\x1a\x17.context.ConnectionList\"\x00\x12=\n\rGetConnection\x12\x15.context.ConnectionId\x1a\x13.context.Connection\"\x00\x12=\n\rSetConnection\x12\x13.context.Connection\x1a\x15.context.ConnectionId\"\x00\x12;\n\x10RemoveConnection\x12\x15.context.ConnectionId\x1a\x0e.context.Empty\"\x00\x12\x43\n\x13GetConnectionEvents\x12\x0e.context.Empty\x1a\x18.context.ConnectionEvent\"\x00\x30\x01\x62\x06proto3' , dependencies=[kpi__sample__types__pb2.DESCRIPTOR,]) @@ -55,8 +55,8 @@ _EVENTTYPEENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=3703, - serialized_end=3809, + serialized_start=4310, + serialized_end=4416, ) _sym_db.RegisterEnumDescriptor(_EVENTTYPEENUM) @@ -101,8 +101,8 @@ _DEVICEDRIVERENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=3812, - serialized_end=4009, + serialized_start=4419, + serialized_end=4616, ) _sym_db.RegisterEnumDescriptor(_DEVICEDRIVERENUM) @@ -132,8 +132,8 @@ _DEVICEOPERATIONALSTATUSENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4012, - serialized_end=4155, + serialized_start=4619, + serialized_end=4762, ) _sym_db.RegisterEnumDescriptor(_DEVICEOPERATIONALSTATUSENUM) @@ -168,8 +168,8 @@ _SERVICETYPEENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4158, - serialized_end=4287, + serialized_start=4765, + serialized_end=4894, ) _sym_db.RegisterEnumDescriptor(_SERVICETYPEENUM) @@ -204,12 +204,53 @@ _SERVICESTATUSENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4290, - serialized_end=4426, + serialized_start=4897, + serialized_end=5033, ) _sym_db.RegisterEnumDescriptor(_SERVICESTATUSENUM) ServiceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICESTATUSENUM) +_SLICESTATUSENUM = _descriptor.EnumDescriptor( + name='SliceStatusEnum', + full_name='context.SliceStatusEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_PLANNED', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_INIT', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_ACTIVE', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_DEINIT', index=4, number=4, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=5036, + serialized_end=5175, +) +_sym_db.RegisterEnumDescriptor(_SLICESTATUSENUM) + +SliceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SLICESTATUSENUM) _CONFIGACTIONENUM = _descriptor.EnumDescriptor( name='ConfigActionEnum', full_name='context.ConfigActionEnum', @@ -235,8 +276,8 @@ _CONFIGACTIONENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4428, - serialized_end=4521, + serialized_start=5177, + serialized_end=5270, ) _sym_db.RegisterEnumDescriptor(_CONFIGACTIONENUM) @@ -262,6 +303,11 @@ SERVICESTATUS_UNDEFINED = 0 SERVICESTATUS_PLANNED = 1 SERVICESTATUS_ACTIVE = 2 SERVICESTATUS_PENDING_REMOVAL = 3 +SLICESTATUS_UNDEFINED = 0 +SLICESTATUS_PLANNED = 1 +SLICESTATUS_INIT = 2 +SLICESTATUS_ACTIVE = 3 +SLICESTATUS_DEINIT = 4 CONFIGACTION_UNDEFINED = 0 CONFIGACTION_SET = 1 CONFIGACTION_DELETE = 2 @@ -1421,6 +1467,247 @@ _SERVICEEVENT = _descriptor.Descriptor( ) +_SLICEID = _descriptor.Descriptor( + name='SliceId', + full_name='context.SliceId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_id', full_name='context.SliceId.context_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_uuid', full_name='context.SliceId.slice_uuid', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2604, + serialized_end=2688, +) + + +_SLICE = _descriptor.Descriptor( + name='Slice', + full_name='context.Slice', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_id', full_name='context.Slice.slice_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_endpoint_ids', full_name='context.Slice.slice_endpoint_ids', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_constraints', full_name='context.Slice.slice_constraints', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_service_ids', full_name='context.Slice.slice_service_ids', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_subslice_ids', full_name='context.Slice.slice_subslice_ids', index=4, + number=5, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_status', full_name='context.Slice.slice_status', index=5, + number=6, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2691, + serialized_end=2968, +) + + +_SLICESTATUS = _descriptor.Descriptor( + name='SliceStatus', + full_name='context.SliceStatus', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_status', full_name='context.SliceStatus.slice_status', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2970, + serialized_end=3031, +) + + +_SLICEIDLIST = _descriptor.Descriptor( + name='SliceIdList', + full_name='context.SliceIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_ids', full_name='context.SliceIdList.slice_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3033, + serialized_end=3083, +) + + +_SLICELIST = _descriptor.Descriptor( + name='SliceList', + full_name='context.SliceList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slices', full_name='context.SliceList.slices', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3085, + serialized_end=3128, +) + + +_SLICEEVENT = _descriptor.Descriptor( + name='SliceEvent', + full_name='context.SliceEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.SliceEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_id', full_name='context.SliceEvent.slice_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3130, + serialized_end=3209, +) + + _CONNECTIONID = _descriptor.Descriptor( name='ConnectionId', full_name='context.ConnectionId', @@ -1448,8 +1735,8 @@ _CONNECTIONID = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2604, - serialized_end=2658, + serialized_start=3211, + serialized_end=3265, ) @@ -1501,8 +1788,8 @@ _CONNECTION = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2661, - serialized_end=2857, + serialized_start=3268, + serialized_end=3464, ) @@ -1533,8 +1820,8 @@ _CONNECTIONIDLIST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2859, - serialized_end=2924, + serialized_start=3466, + serialized_end=3531, ) @@ -1565,8 +1852,8 @@ _CONNECTIONLIST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2926, - serialized_end=2984, + serialized_start=3533, + serialized_end=3591, ) @@ -1604,8 +1891,8 @@ _CONNECTIONEVENT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2986, - serialized_end=3080, + serialized_start=3593, + serialized_end=3687, ) @@ -1650,8 +1937,8 @@ _ENDPOINTID = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3083, - serialized_end=3213, + serialized_start=3690, + serialized_end=3820, ) @@ -1696,8 +1983,8 @@ _ENDPOINT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3216, - serialized_end=3350, + serialized_start=3823, + serialized_end=3957, ) @@ -1742,8 +2029,8 @@ _CONFIGRULE = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3352, - serialized_end=3453, + serialized_start=3959, + serialized_end=4060, ) @@ -1781,8 +2068,8 @@ _CONSTRAINT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3455, - serialized_end=3518, + serialized_start=4062, + serialized_end=4125, ) @@ -1827,8 +2114,8 @@ _TERAFLOWCONTROLLER = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3520, - serialized_end=3614, + serialized_start=4127, + serialized_end=4221, ) @@ -1866,8 +2153,8 @@ _AUTHENTICATIONRESULT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3616, - serialized_end=3701, + serialized_start=4223, + serialized_end=4308, ) _EVENT.fields_by_name['event_type'].enum_type = _EVENTTYPEENUM @@ -1921,6 +2208,19 @@ _SERVICEIDLIST.fields_by_name['service_ids'].message_type = _SERVICEID _SERVICELIST.fields_by_name['services'].message_type = _SERVICE _SERVICEEVENT.fields_by_name['event'].message_type = _EVENT _SERVICEEVENT.fields_by_name['service_id'].message_type = _SERVICEID +_SLICEID.fields_by_name['context_id'].message_type = _CONTEXTID +_SLICEID.fields_by_name['slice_uuid'].message_type = _UUID +_SLICE.fields_by_name['slice_id'].message_type = _SLICEID +_SLICE.fields_by_name['slice_endpoint_ids'].message_type = _ENDPOINTID +_SLICE.fields_by_name['slice_constraints'].message_type = _CONSTRAINT +_SLICE.fields_by_name['slice_service_ids'].message_type = _SERVICEID +_SLICE.fields_by_name['slice_subslice_ids'].message_type = _SLICEID +_SLICE.fields_by_name['slice_status'].message_type = _SLICESTATUS +_SLICESTATUS.fields_by_name['slice_status'].enum_type = _SLICESTATUSENUM +_SLICEIDLIST.fields_by_name['slice_ids'].message_type = _SLICEID +_SLICELIST.fields_by_name['slices'].message_type = _SLICE +_SLICEEVENT.fields_by_name['event'].message_type = _EVENT +_SLICEEVENT.fields_by_name['slice_id'].message_type = _SLICEID _CONNECTIONID.fields_by_name['connection_uuid'].message_type = _UUID _CONNECTION.fields_by_name['connection_id'].message_type = _CONNECTIONID _CONNECTION.fields_by_name['service_id'].message_type = _SERVICEID @@ -1969,6 +2269,12 @@ DESCRIPTOR.message_types_by_name['ServiceConfig'] = _SERVICECONFIG DESCRIPTOR.message_types_by_name['ServiceIdList'] = _SERVICEIDLIST DESCRIPTOR.message_types_by_name['ServiceList'] = _SERVICELIST DESCRIPTOR.message_types_by_name['ServiceEvent'] = _SERVICEEVENT +DESCRIPTOR.message_types_by_name['SliceId'] = _SLICEID +DESCRIPTOR.message_types_by_name['Slice'] = _SLICE +DESCRIPTOR.message_types_by_name['SliceStatus'] = _SLICESTATUS +DESCRIPTOR.message_types_by_name['SliceIdList'] = _SLICEIDLIST +DESCRIPTOR.message_types_by_name['SliceList'] = _SLICELIST +DESCRIPTOR.message_types_by_name['SliceEvent'] = _SLICEEVENT DESCRIPTOR.message_types_by_name['ConnectionId'] = _CONNECTIONID DESCRIPTOR.message_types_by_name['Connection'] = _CONNECTION DESCRIPTOR.message_types_by_name['ConnectionIdList'] = _CONNECTIONIDLIST @@ -1985,6 +2291,7 @@ DESCRIPTOR.enum_types_by_name['DeviceDriverEnum'] = _DEVICEDRIVERENUM DESCRIPTOR.enum_types_by_name['DeviceOperationalStatusEnum'] = _DEVICEOPERATIONALSTATUSENUM DESCRIPTOR.enum_types_by_name['ServiceTypeEnum'] = _SERVICETYPEENUM DESCRIPTOR.enum_types_by_name['ServiceStatusEnum'] = _SERVICESTATUSENUM +DESCRIPTOR.enum_types_by_name['SliceStatusEnum'] = _SLICESTATUSENUM DESCRIPTOR.enum_types_by_name['ConfigActionEnum'] = _CONFIGACTIONENUM _sym_db.RegisterFileDescriptor(DESCRIPTOR) @@ -2205,6 +2512,48 @@ ServiceEvent = _reflection.GeneratedProtocolMessageType('ServiceEvent', (_messag }) _sym_db.RegisterMessage(ServiceEvent) +SliceId = _reflection.GeneratedProtocolMessageType('SliceId', (_message.Message,), { + 'DESCRIPTOR' : _SLICEID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceId) + }) +_sym_db.RegisterMessage(SliceId) + +Slice = _reflection.GeneratedProtocolMessageType('Slice', (_message.Message,), { + 'DESCRIPTOR' : _SLICE, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Slice) + }) +_sym_db.RegisterMessage(Slice) + +SliceStatus = _reflection.GeneratedProtocolMessageType('SliceStatus', (_message.Message,), { + 'DESCRIPTOR' : _SLICESTATUS, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceStatus) + }) +_sym_db.RegisterMessage(SliceStatus) + +SliceIdList = _reflection.GeneratedProtocolMessageType('SliceIdList', (_message.Message,), { + 'DESCRIPTOR' : _SLICEIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceIdList) + }) +_sym_db.RegisterMessage(SliceIdList) + +SliceList = _reflection.GeneratedProtocolMessageType('SliceList', (_message.Message,), { + 'DESCRIPTOR' : _SLICELIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceList) + }) +_sym_db.RegisterMessage(SliceList) + +SliceEvent = _reflection.GeneratedProtocolMessageType('SliceEvent', (_message.Message,), { + 'DESCRIPTOR' : _SLICEEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceEvent) + }) +_sym_db.RegisterMessage(SliceEvent) + ConnectionId = _reflection.GeneratedProtocolMessageType('ConnectionId', (_message.Message,), { 'DESCRIPTOR' : _CONNECTIONID, '__module__' : 'context_pb2' @@ -2291,8 +2640,8 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( index=0, serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_start=4524, - serialized_end=6617, + serialized_start=5273, + serialized_end=7688, methods=[ _descriptor.MethodDescriptor( name='ListContextIds', @@ -2594,10 +2943,70 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( serialized_options=None, create_key=_descriptor._internal_create_key, ), + _descriptor.MethodDescriptor( + name='ListSliceIds', + full_name='context.ContextService.ListSliceIds', + index=30, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SLICEIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListSlices', + full_name='context.ContextService.ListSlices', + index=31, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SLICELIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetSlice', + full_name='context.ContextService.GetSlice', + index=32, + containing_service=None, + input_type=_SLICEID, + output_type=_SLICE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetSlice', + full_name='context.ContextService.SetSlice', + index=33, + containing_service=None, + input_type=_SLICE, + output_type=_SLICEID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveSlice', + full_name='context.ContextService.RemoveSlice', + index=34, + containing_service=None, + input_type=_SLICEID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetSliceEvents', + full_name='context.ContextService.GetSliceEvents', + index=35, + containing_service=None, + input_type=_EMPTY, + output_type=_SLICEEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), _descriptor.MethodDescriptor( name='ListConnectionIds', full_name='context.ContextService.ListConnectionIds', - index=30, + index=36, containing_service=None, input_type=_SERVICEID, output_type=_CONNECTIONIDLIST, @@ -2607,7 +3016,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='ListConnections', full_name='context.ContextService.ListConnections', - index=31, + index=37, containing_service=None, input_type=_SERVICEID, output_type=_CONNECTIONLIST, @@ -2617,7 +3026,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='GetConnection', full_name='context.ContextService.GetConnection', - index=32, + index=38, containing_service=None, input_type=_CONNECTIONID, output_type=_CONNECTION, @@ -2627,7 +3036,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='SetConnection', full_name='context.ContextService.SetConnection', - index=33, + index=39, containing_service=None, input_type=_CONNECTION, output_type=_CONNECTIONID, @@ -2637,7 +3046,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='RemoveConnection', full_name='context.ContextService.RemoveConnection', - index=34, + index=40, containing_service=None, input_type=_CONNECTIONID, output_type=_EMPTY, @@ -2647,7 +3056,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='GetConnectionEvents', full_name='context.ContextService.GetConnectionEvents', - index=35, + index=41, containing_service=None, input_type=_EMPTY, output_type=_CONNECTIONEVENT, diff --git a/src/compute/proto/service_pb2.py b/src/compute/proto/service_pb2.py index 7a006915b8be39710a17faab075e382e322d918f..8e2806c7685e24ab90a3d59a19f1e4f99ebc9712 100644 --- a/src/compute/proto/service_pb2.py +++ b/src/compute/proto/service_pb2.py @@ -20,7 +20,7 @@ DESCRIPTOR = _descriptor.FileDescriptor( syntax='proto3', serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\rservice.proto\x12\x07service\x1a\rcontext.proto2\xfd\x01\n\x0eServiceService\x12\x37\n\rCreateService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x37\n\rUpdateService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rDeleteService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12\x42\n\x11GetConnectionList\x12\x12.context.ServiceId\x1a\x17.context.ConnectionList\"\x00\x62\x06proto3' + serialized_pb=b'\n\rservice.proto\x12\x07service\x1a\rcontext.proto2\xb9\x01\n\x0eServiceService\x12\x37\n\rCreateService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x37\n\rUpdateService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rDeleteService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x62\x06proto3' , dependencies=[context__pb2.DESCRIPTOR,]) @@ -38,7 +38,7 @@ _SERVICESERVICE = _descriptor.ServiceDescriptor( serialized_options=None, create_key=_descriptor._internal_create_key, serialized_start=42, - serialized_end=295, + serialized_end=227, methods=[ _descriptor.MethodDescriptor( name='CreateService', @@ -70,16 +70,6 @@ _SERVICESERVICE = _descriptor.ServiceDescriptor( serialized_options=None, create_key=_descriptor._internal_create_key, ), - _descriptor.MethodDescriptor( - name='GetConnectionList', - full_name='service.ServiceService.GetConnectionList', - index=3, - containing_service=None, - input_type=context__pb2._SERVICEID, - output_type=context__pb2._CONNECTIONLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), ]) _sym_db.RegisterServiceDescriptor(_SERVICESERVICE) diff --git a/src/compute/service/ComputeService.py b/src/compute/service/ComputeService.py index 1f523793d28526bdce1dd50cba7677aa04481171..f8476e102fcfbdd12480f8c40a797d6c84d70982 100644 --- a/src/compute/service/ComputeService.py +++ b/src/compute/service/ComputeService.py @@ -12,56 +12,17 @@ # See the License for the specific language governing permissions and # limitations under the License. -import grpc, logging -from concurrent import futures -from grpc_health.v1.health import HealthServicer, OVERALL_HEALTH -from grpc_health.v1.health_pb2 import HealthCheckResponse -from grpc_health.v1.health_pb2_grpc import add_HealthServicer_to_server +from common.Constants import ServiceNameEnum +from common.Settings import get_service_port_grpc +from common.tools.service.GenericGrpcService import GenericGrpcService from compute.proto.compute_pb2_grpc import add_ComputeServiceServicer_to_server from compute.service.ComputeServiceServicerImpl import ComputeServiceServicerImpl -from compute.Config import GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD - -BIND_ADDRESS = '0.0.0.0' -LOGGER = logging.getLogger(__name__) - -class ComputeService: - def __init__(self, address=BIND_ADDRESS, port=GRPC_SERVICE_PORT, max_workers=GRPC_MAX_WORKERS, - grace_period=GRPC_GRACE_PERIOD): - self.address = address - self.port = port - self.endpoint = None - self.max_workers = max_workers - self.grace_period = grace_period - self.compute_servicer = None - self.health_servicer = None - self.pool = None - self.server = None - - def start(self): - self.endpoint = '{:s}:{:s}'.format(str(self.address), str(self.port)) - LOGGER.debug('Starting Service (tentative endpoint: {:s}, max_workers: {:s})...'.format( - str(self.endpoint), str(self.max_workers))) - - self.pool = futures.ThreadPoolExecutor(max_workers=self.max_workers) - self.server = grpc.server(self.pool) # , interceptors=(tracer_interceptor,)) +class ComputeService(GenericGrpcService): + def __init__(self, cls_name: str = __name__) -> None: + port = get_service_port_grpc(ServiceNameEnum.COMPUTE) + super().__init__(port, cls_name=cls_name) self.compute_servicer = ComputeServiceServicerImpl() - add_ComputeServiceServicer_to_server(self.compute_servicer, self.server) - self.health_servicer = HealthServicer( - experimental_non_blocking=True, experimental_thread_pool=futures.ThreadPoolExecutor(max_workers=1)) - add_HealthServicer_to_server(self.health_servicer, self.server) - - port = self.server.add_insecure_port(self.endpoint) - self.endpoint = '{:s}:{:s}'.format(str(self.address), str(port)) - LOGGER.info('Listening on {:s}...'.format(str(self.endpoint))) - self.server.start() - self.health_servicer.set(OVERALL_HEALTH, HealthCheckResponse.SERVING) # pylint: disable=maybe-no-member - - LOGGER.debug('Service started') - - def stop(self): - LOGGER.debug('Stopping service (grace period {:s} seconds)...'.format(str(self.grace_period))) - self.health_servicer.enter_graceful_shutdown() - self.server.stop(self.grace_period) - LOGGER.debug('Service stopped') + def install_servicers(self): + add_ComputeServiceServicer_to_server(self.compute_servicer, self.server) diff --git a/src/compute/service/__main__.py b/src/compute/service/__main__.py index cf6f8241010d26d8aff9718b8bc531c2f7f43d22..345b2fdd6950ecda802e8bd1c86e1421b5c60d84 100644 --- a/src/compute/service/__main__.py +++ b/src/compute/service/__main__.py @@ -14,10 +14,10 @@ import logging, signal, sys, threading from prometheus_client import start_http_server -from common.Settings import get_setting, wait_for_environment_variables -from compute.Config import ( - GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD, LOG_LEVEL, RESTAPI_SERVICE_PORT, RESTAPI_BASE_URL, - METRICS_PORT) +from common.Constants import ServiceNameEnum +from common.Settings import ( + ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_log_level, get_metrics_port, + wait_for_environment_variables) from .ComputeService import ComputeService from .rest_server.RestServer import RestServer from .rest_server.nbi_plugins.ietf_l2vpn import register_ietf_l2vpn @@ -32,20 +32,13 @@ def signal_handler(signal, frame): # pylint: disable=redefined-outer-name def main(): global LOGGER # pylint: disable=global-statement - grpc_service_port = get_setting('COMPUTESERVICE_SERVICE_PORT_GRPC', default=GRPC_SERVICE_PORT ) - max_workers = get_setting('MAX_WORKERS', default=GRPC_MAX_WORKERS ) - grace_period = get_setting('GRACE_PERIOD', default=GRPC_GRACE_PERIOD ) - log_level = get_setting('LOG_LEVEL', default=LOG_LEVEL ) - restapi_service_port = get_setting('RESTAPI_SERVICE_PORT', default=RESTAPI_SERVICE_PORT) - restapi_base_url = get_setting('RESTAPI_BASE_URL', default=RESTAPI_BASE_URL ) - metrics_port = get_setting('METRICS_PORT', default=METRICS_PORT ) - + log_level = get_log_level() logging.basicConfig(level=log_level) LOGGER = logging.getLogger(__name__) wait_for_environment_variables([ - 'CONTEXTSERVICE_SERVICE_HOST', 'CONTEXTSERVICE_SERVICE_PORT_GRPC', - 'SERVICESERVICE_SERVICE_HOST', 'SERVICESERVICE_SERVICE_PORT_GRPC' + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_HOST ), + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC), ]) signal.signal(signal.SIGINT, signal_handler) @@ -54,13 +47,14 @@ def main(): LOGGER.info('Starting...') # Start metrics server + metrics_port = get_metrics_port() start_http_server(metrics_port) # Starting compute service - grpc_service = ComputeService(port=grpc_service_port, max_workers=max_workers, grace_period=grace_period) + grpc_service = ComputeService() grpc_service.start() - rest_server = RestServer(port=restapi_service_port, base_url=restapi_base_url) + rest_server = RestServer() register_ietf_l2vpn(rest_server) rest_server.start() diff --git a/src/compute/service/rest_server/RestServer.py b/src/compute/service/rest_server/RestServer.py index 26055f8dfa319ae715e96241a13860fd8283a5aa..d9b6cd9157a77f61f6e3349de690e3314a2b41d9 100644 --- a/src/compute/service/rest_server/RestServer.py +++ b/src/compute/service/rest_server/RestServer.py @@ -12,45 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -import logging, threading, time -from flask import Flask, request -from flask_restful import Api, Resource -from werkzeug.serving import make_server -from compute.Config import RESTAPI_BASE_URL, RESTAPI_SERVICE_PORT - -logging.getLogger('werkzeug').setLevel(logging.WARNING) - -BIND_ADDRESS = '0.0.0.0' -LOGGER = logging.getLogger(__name__) - -def log_request(response): - timestamp = time.strftime('[%Y-%b-%d %H:%M]') - LOGGER.info('%s %s %s %s %s', timestamp, request.remote_addr, request.method, request.full_path, response.status) - return response - -class RestServer(threading.Thread): - def __init__(self, host=BIND_ADDRESS, port=RESTAPI_SERVICE_PORT, base_url=RESTAPI_BASE_URL): - threading.Thread.__init__(self, daemon=True) - self.host = host - self.port = port - self.base_url = base_url - self.srv = None - self.ctx = None - self.app = Flask(__name__) - self.app.after_request(log_request) - self.api = Api(self.app, prefix=self.base_url) - - def add_resource(self, resource : Resource, *urls, **kwargs): - self.api.add_resource(resource, *urls, **kwargs) - - def run(self): - self.srv = make_server(self.host, self.port, self.app, threaded=True) - self.ctx = self.app.app_context() - self.ctx.push() - - endpoint = 'http://{:s}:{:s}{:s}'.format(str(self.host), str(self.port), str(self.base_url)) - LOGGER.info('Listening on {:s}...'.format(str(endpoint))) - self.srv.serve_forever() - - def shutdown(self): - self.srv.shutdown() +from common.Constants import ServiceNameEnum +from common.Settings import get_service_baseurl_http, get_service_port_http +from common.tools.service.GenericRestServer import GenericRestServer + +class RestServer(GenericRestServer): + def __init__(self, cls_name: str = __name__) -> None: + bind_port = get_service_port_http(ServiceNameEnum.COMPUTE) + base_url = get_service_baseurl_http(ServiceNameEnum.COMPUTE) + super().__init__(bind_port, base_url, cls_name=cls_name) diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/Constants.py b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/Constants.py index 9420517e1b253e6f9169ccabafe5f441662c9b04..b7f377254f3bec36ce407ee2e25f63adba22baa7 100644 --- a/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/Constants.py +++ b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/Constants.py @@ -25,4 +25,30 @@ BEARER_MAPPINGS = { 'R2-EMU:13/2/1': ('R2-EMU', '13/2/1', '12.12.12.1', '65000:120', 450, '3.4.2.1', 24), 'R3-INF:13/2/1': ('R3-INF', '13/2/1', '20.20.20.1', '65000:200', 500, '3.3.1.1', 24), 'R4-EMU:13/2/1': ('R4-EMU', '13/2/1', '22.22.22.1', '65000:220', 550, '3.4.1.1', 24), + + 'R1@D1:3/1': ('R1@D1', '3/1', '10.0.1.1', '65001:101', 100, '1.1.3.1', 24), + 'R1@D1:3/2': ('R1@D1', '3/2', '10.0.1.1', '65001:101', 100, '1.1.3.2', 24), + 'R1@D1:3/3': ('R1@D1', '3/3', '10.0.1.1', '65001:101', 100, '1.1.3.3', 24), + 'R2@D1:3/1': ('R2@D1', '3/1', '10.0.1.2', '65001:102', 100, '1.2.3.1', 24), + 'R2@D1:3/2': ('R2@D1', '3/2', '10.0.1.2', '65001:102', 100, '1.2.3.2', 24), + 'R2@D1:3/3': ('R2@D1', '3/3', '10.0.1.2', '65001:102', 100, '1.2.3.3', 24), + 'R3@D1:3/1': ('R3@D1', '3/1', '10.0.1.3', '65001:103', 100, '1.3.3.1', 24), + 'R3@D1:3/2': ('R3@D1', '3/2', '10.0.1.3', '65001:103', 100, '1.3.3.2', 24), + 'R3@D1:3/3': ('R3@D1', '3/3', '10.0.1.3', '65001:103', 100, '1.3.3.3', 24), + 'R4@D1:3/1': ('R4@D1', '3/1', '10.0.1.4', '65001:104', 100, '1.4.3.1', 24), + 'R4@D1:3/2': ('R4@D1', '3/2', '10.0.1.4', '65001:104', 100, '1.4.3.2', 24), + 'R4@D1:3/3': ('R4@D1', '3/3', '10.0.1.4', '65001:104', 100, '1.4.3.3', 24), + + 'R1@D2:3/1': ('R1@D2', '3/1', '10.0.2.1', '65002:101', 100, '2.1.3.1', 24), + 'R1@D2:3/2': ('R1@D2', '3/2', '10.0.2.1', '65002:101', 100, '2.1.3.2', 24), + 'R1@D2:3/3': ('R1@D2', '3/3', '10.0.2.1', '65002:101', 100, '2.1.3.3', 24), + 'R2@D2:3/1': ('R2@D2', '3/1', '10.0.2.2', '65002:102', 100, '2.2.3.1', 24), + 'R2@D2:3/2': ('R2@D2', '3/2', '10.0.2.2', '65002:102', 100, '2.2.3.2', 24), + 'R2@D2:3/3': ('R2@D2', '3/3', '10.0.2.2', '65002:102', 100, '2.2.3.3', 24), + 'R3@D2:3/1': ('R3@D2', '3/1', '10.0.2.3', '65002:103', 100, '2.3.3.1', 24), + 'R3@D2:3/2': ('R3@D2', '3/2', '10.0.2.3', '65002:103', 100, '2.3.3.2', 24), + 'R3@D2:3/3': ('R3@D2', '3/3', '10.0.2.3', '65002:103', 100, '2.3.3.3', 24), + 'R4@D2:3/1': ('R4@D2', '3/1', '10.0.2.4', '65002:104', 100, '2.4.3.1', 24), + 'R4@D2:3/2': ('R4@D2', '3/2', '10.0.2.4', '65002:104', 100, '2.4.3.2', 24), + 'R4@D2:3/3': ('R4@D2', '3/3', '10.0.2.4', '65002:104', 100, '2.4.3.3', 24), } diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_Service.py b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_Service.py index 6a91e6ae1b71bca5c7c26464d0bdb4f187f0381a..17ae49478f26a2884d54f95607aafc27c809425d 100644 --- a/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_Service.py +++ b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_Service.py @@ -17,44 +17,47 @@ from flask import request from flask.json import jsonify from flask_restful import Resource from common.Constants import DEFAULT_CONTEXT_UUID -from common.Settings import get_setting from context.client.ContextClient import ContextClient -from context.proto.context_pb2 import ServiceId +from context.proto.context_pb2 import ServiceId, SliceStatusEnum from service.client.ServiceClient import ServiceClient from service.proto.context_pb2 import ServiceStatusEnum from .tools.Authentication import HTTP_AUTH +from .tools.ContextMethods import get_service, get_slice from .tools.HttpStatusCodes import HTTP_GATEWAYTIMEOUT, HTTP_NOCONTENT, HTTP_OK, HTTP_SERVERERROR LOGGER = logging.getLogger(__name__) class L2VPN_Service(Resource): - def __init__(self) -> None: - super().__init__() - self.context_client = ContextClient( - get_setting('CONTEXTSERVICE_SERVICE_HOST'), get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC')) - self.service_client = ServiceClient( - get_setting('SERVICESERVICE_SERVICE_HOST'), get_setting('SERVICESERVICE_SERVICE_PORT_GRPC')) - @HTTP_AUTH.login_required def get(self, vpn_id : str): LOGGER.debug('VPN_Id: {:s}'.format(str(vpn_id))) LOGGER.debug('Request: {:s}'.format(str(request))) - # pylint: disable=no-member - service_id_request = ServiceId() - service_id_request.context_id.context_uuid.uuid = DEFAULT_CONTEXT_UUID - service_id_request.service_uuid.uuid = vpn_id - + response = jsonify({}) try: - service_reply = self.context_client.GetService(service_id_request) - if service_reply.service_id != service_id_request: # pylint: disable=no-member - raise Exception('Service retrieval failed. Wrong Service Id was returned') - service_ready_status = ServiceStatusEnum.SERVICESTATUS_ACTIVE - service_status = service_reply.service_status.service_status - response = jsonify({}) - response.status_code = HTTP_OK if service_status == service_ready_status else HTTP_GATEWAYTIMEOUT + context_client = ContextClient() + + target = get_service(context_client, vpn_id) + if target is not None: + if target.service_id.service_uuid.uuid != vpn_id: # pylint: disable=no-member + raise Exception('Service retrieval failed. Wrong Service Id was returned') + service_ready_status = ServiceStatusEnum.SERVICESTATUS_ACTIVE + service_status = target.service_status.service_status # pylint: disable=no-member + response.status_code = HTTP_OK if service_status == service_ready_status else HTTP_GATEWAYTIMEOUT + return response + + target = get_slice(context_client, vpn_id) + if target is not None: + if target.slice_id.slice_uuid.uuid != vpn_id: # pylint: disable=no-member + raise Exception('Slice retrieval failed. Wrong Slice Id was returned') + slice_ready_status = SliceStatusEnum.SLICESTATUS_ACTIVE + slice_status = target.slice_status.slice_status # pylint: disable=no-member + response.status_code = HTTP_OK if slice_status == slice_ready_status else HTTP_GATEWAYTIMEOUT + return response + + raise Exception('VPN({:s}) not found in database'.format(str(vpn_id))) except Exception as e: # pylint: disable=broad-except - LOGGER.exception('Something went wrong Retrieving Service {:s}'.format(str(request))) + LOGGER.exception('Something went wrong Retrieving VPN({:s})'.format(str(request))) response = jsonify({'error': str(e)}) response.status_code = HTTP_SERVERERROR return response @@ -70,7 +73,8 @@ class L2VPN_Service(Resource): service_id_request.service_uuid.uuid = vpn_id try: - self.service_client.DeleteService(service_id_request) + service_client = ServiceClient() + service_client.DeleteService(service_id_request) response = jsonify({}) response.status_code = HTTP_NOCONTENT except Exception as e: # pylint: disable=broad-except diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_Services.py b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_Services.py index 191166a74e53b5c9ae58d3c8cbb3f0e0b1ca8480..e0de1b7321d5618d3a7d33af4a59b47b12482e3a 100644 --- a/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_Services.py +++ b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_Services.py @@ -19,9 +19,10 @@ from flask.json import jsonify from flask_restful import Resource from werkzeug.exceptions import UnsupportedMediaType from common.Constants import DEFAULT_CONTEXT_UUID -from common.Settings import get_setting from service.client.ServiceClient import ServiceClient from service.proto.context_pb2 import Service, ServiceStatusEnum, ServiceTypeEnum +from slice.client.SliceClient import SliceClient +from slice.proto.context_pb2 import SliceStatusEnum, Slice from .schemas.vpn_service import SCHEMA_VPN_SERVICE from .tools.Authentication import HTTP_AUTH from .tools.HttpStatusCodes import HTTP_CREATED, HTTP_SERVERERROR @@ -30,11 +31,6 @@ from .tools.Validator import validate_message LOGGER = logging.getLogger(__name__) class L2VPN_Services(Resource): - def __init__(self) -> None: - super().__init__() - self.service_client = ServiceClient( - get_setting('SERVICESERVICE_SERVICE_HOST'), get_setting('SERVICESERVICE_SERVICE_PORT_GRPC')) - @HTTP_AUTH.login_required def get(self): return {} @@ -48,17 +44,31 @@ class L2VPN_Services(Resource): vpn_services : List[Dict] = request_data['ietf-l2vpn-svc:vpn-service'] for vpn_service in vpn_services: - # pylint: disable=no-member - service_request = Service() - service_request.service_id.context_id.context_uuid.uuid = DEFAULT_CONTEXT_UUID - service_request.service_id.service_uuid.uuid = vpn_service['vpn-id'] - service_request.service_type = ServiceTypeEnum.SERVICETYPE_L3NM - service_request.service_status.service_status = ServiceStatusEnum.SERVICESTATUS_PLANNED - try: - service_reply = self.service_client.CreateService(service_request) - if service_reply != service_request.service_id: # pylint: disable=no-member - raise Exception('Service creation failed. Wrong Service Id was returned') + vpn_service_type = vpn_service['vpn-svc-type'] + if vpn_service_type == 'vpws': + # pylint: disable=no-member + service_request = Service() + service_request.service_id.context_id.context_uuid.uuid = DEFAULT_CONTEXT_UUID + service_request.service_id.service_uuid.uuid = vpn_service['vpn-id'] + service_request.service_type = ServiceTypeEnum.SERVICETYPE_L3NM + service_request.service_status.service_status = ServiceStatusEnum.SERVICESTATUS_PLANNED + + service_client = ServiceClient() + service_reply = service_client.CreateService(service_request) + if service_reply != service_request.service_id: # pylint: disable=no-member + raise Exception('Service creation failed. Wrong Service Id was returned') + elif vpn_service_type == 'vpls': + # pylint: disable=no-member + slice_request = Slice() + slice_request.slice_id.context_id.context_uuid.uuid = DEFAULT_CONTEXT_UUID + slice_request.slice_id.slice_uuid.uuid = vpn_service['vpn-id'] + slice_request.slice_status.slice_status = SliceStatusEnum.SLICESTATUS_PLANNED + + slice_client = SliceClient() + slice_reply = slice_client.CreateSlice(slice_request) + if slice_reply != slice_request.slice_id: # pylint: disable=no-member + raise Exception('Slice creation failed. Wrong Slice Id was returned') response = jsonify({}) response.status_code = HTTP_CREATED diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_SiteNetworkAccesses.py b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_SiteNetworkAccesses.py index 6811dadac8bbc744bc1630adcfb88750765b11b8..3e7928067daac258431cc8c5b5ccac7257e1cbb8 100644 --- a/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_SiteNetworkAccesses.py +++ b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_SiteNetworkAccesses.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +from ctypes import Union import json, logging from typing import Dict from flask import request @@ -19,14 +20,15 @@ from flask.json import jsonify from flask.wrappers import Response from flask_restful import Resource from werkzeug.exceptions import UnsupportedMediaType -from common.Constants import DEFAULT_CONTEXT_UUID from common.Settings import get_setting from common.tools.grpc.Tools import grpc_message_to_json_string from context.client.ContextClient import ContextClient -from context.proto.context_pb2 import ConfigActionEnum, Service, ServiceId +from context.proto.context_pb2 import ConfigActionEnum, Service, Slice from service.client.ServiceClient import ServiceClient +from slice.client.SliceClient import SliceClient from .schemas.site_network_access import SCHEMA_SITE_NETWORK_ACCESS from .tools.Authentication import HTTP_AUTH +from .tools.ContextMethods import get_service, get_slice from .tools.HttpStatusCodes import HTTP_NOCONTENT, HTTP_SERVERERROR from .tools.Validator import validate_message from .Constants import BEARER_MAPPINGS, DEFAULT_ADDRESS_FAMILIES, DEFAULT_BGP_AS, DEFAULT_BGP_ROUTE_TARGET, DEFAULT_MTU @@ -44,26 +46,27 @@ def process_site_network_access(context_client : ContextClient, site_network_acc raise Exception(msg.format(str(bearer_reference))) device_uuid,endpoint_uuid,router_id,route_distinguisher,sub_if_index,address_ip,address_prefix = mapping - # pylint: disable=no-member - service_id = ServiceId() - service_id.context_id.context_uuid.uuid = DEFAULT_CONTEXT_UUID - service_id.service_uuid.uuid = vpn_id + target : Union[Service, Slice, None] = None + if target is None: target = get_service(context_client, vpn_id) + if target is None: target = get_slice (context_client, vpn_id) + if target is None: raise Exception('VPN({:s}) not found in database'.format(str(vpn_id))) - service_readonly = context_client.GetService(service_id) - service = Service() - service.CopyFrom(service_readonly) + # pylint: disable=no-member + endpoint_ids = target.service_endpoint_ids if isinstance(target, Service) else target.slice_endpoint_ids - for endpoint_id in service.service_endpoint_ids: # pylint: disable=no-member + for endpoint_id in endpoint_ids: if endpoint_id.device_id.device_uuid.uuid != device_uuid: continue if endpoint_id.endpoint_uuid.uuid != endpoint_uuid: continue break # found, do nothing else: # not found, add it - endpoint_id = service.service_endpoint_ids.add() # pylint: disable=no-member + endpoint_id = endpoint_ids.add() endpoint_id.device_id.device_uuid.uuid = device_uuid endpoint_id.endpoint_uuid.uuid = endpoint_uuid - for config_rule in service.service_config.config_rules: # pylint: disable=no-member + if isinstance(target, Slice): return target + + for config_rule in target.service_config.config_rules: # pylint: disable=no-member if config_rule.resource_key != '/settings': continue json_settings = json.loads(config_rule.resource_value) @@ -95,7 +98,7 @@ def process_site_network_access(context_client : ContextClient, site_network_acc break else: # not found, add it - config_rule = service.service_config.config_rules.add() # pylint: disable=no-member + config_rule = target.service_config.config_rules.add() # pylint: disable=no-member config_rule.action = ConfigActionEnum.CONFIGACTION_SET config_rule.resource_key = '/settings' config_rule.resource_value = json.dumps({ @@ -106,7 +109,7 @@ def process_site_network_access(context_client : ContextClient, site_network_acc }, sort_keys=True) endpoint_settings_key = '/device[{:s}]/endpoint[{:s}]/settings'.format(device_uuid, endpoint_uuid) - for config_rule in service.service_config.config_rules: # pylint: disable=no-member + for config_rule in target.service_config.config_rules: # pylint: disable=no-member if config_rule.resource_key != endpoint_settings_key: continue json_settings = json.loads(config_rule.resource_value) @@ -154,7 +157,7 @@ def process_site_network_access(context_client : ContextClient, site_network_acc break else: # not found, add it - config_rule = service.service_config.config_rules.add() # pylint: disable=no-member + config_rule = target.service_config.config_rules.add() # pylint: disable=no-member config_rule.action = ConfigActionEnum.CONFIGACTION_SET config_rule.resource_key = endpoint_settings_key config_rule.resource_value = json.dumps({ @@ -166,24 +169,34 @@ def process_site_network_access(context_client : ContextClient, site_network_acc 'address_prefix': address_prefix, }, sort_keys=True) - return service + return target def process_list_site_network_access( - context_client : ContextClient, service_client : ServiceClient, request_data : Dict) -> Response: + context_client : ContextClient, service_client : ServiceClient, slice_client : SliceClient, + request_data : Dict + ) -> Response: LOGGER.debug('Request: {:s}'.format(str(request_data))) validate_message(SCHEMA_SITE_NETWORK_ACCESS, request_data) errors = [] for site_network_access in request_data['ietf-l2vpn-svc:site-network-access']: + sna_request = process_site_network_access(context_client, site_network_access) + LOGGER.debug('sna_request = {:s}'.format(grpc_message_to_json_string(sna_request))) try: - service_request = process_site_network_access(context_client, site_network_access) - LOGGER.debug('service_request = {:s}'.format(grpc_message_to_json_string(service_request))) - service_reply = service_client.UpdateService(service_request) - if service_reply != service_request.service_id: # pylint: disable=no-member - raise Exception('Service update failed. Wrong Service Id was returned') + if isinstance(sna_request, Service): + sna_reply = service_client.UpdateService(sna_request) + if sna_reply != sna_request.service_id: # pylint: disable=no-member + raise Exception('Service update failed. Wrong Service Id was returned') + elif isinstance(sna_request, Slice): + sna_reply = slice_client.UpdateSlice(sna_request) + if sna_reply != sna_request.slice_id: # pylint: disable=no-member + raise Exception('Slice update failed. Wrong Slice Id was returned') + else: + raise NotImplementedError('Support for Class({:s}) not implemented'.format(str(type(sna_request)))) except Exception as e: # pylint: disable=broad-except - LOGGER.exception('Something went wrong Updating Service {:s}'.format(str(request))) + msg = 'Something went wrong Updating Service {:s}' + LOGGER.exception(msg.format(grpc_message_to_json_string(sna_request))) errors.append({'error': str(e)}) response = jsonify(errors) @@ -191,21 +204,20 @@ def process_list_site_network_access( return response class L2VPN_SiteNetworkAccesses(Resource): - def __init__(self) -> None: - super().__init__() - self.context_client = ContextClient( - get_setting('CONTEXTSERVICE_SERVICE_HOST'), get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC')) - self.service_client = ServiceClient( - get_setting('SERVICESERVICE_SERVICE_HOST'), get_setting('SERVICESERVICE_SERVICE_PORT_GRPC')) - @HTTP_AUTH.login_required def post(self, site_id : str): if not request.is_json: raise UnsupportedMediaType('JSON payload is required') LOGGER.debug('Site_Id: {:s}'.format(str(site_id))) - return process_list_site_network_access(self.context_client, self.service_client, request.json) + context_client = ContextClient() + service_client = ServiceClient() + slice_client = SliceClient() + return process_list_site_network_access(context_client, service_client, slice_client, request.json) @HTTP_AUTH.login_required def put(self, site_id : str): if not request.is_json: raise UnsupportedMediaType('JSON payload is required') LOGGER.debug('Site_Id: {:s}'.format(str(site_id))) - return process_list_site_network_access(self.context_client, self.service_client, request.json) + context_client = ContextClient() + service_client = ServiceClient() + slice_client = SliceClient() + return process_list_site_network_access(context_client, service_client, slice_client, request.json) diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/__init__.py b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/__init__.py index 79be6b7433a4e448febb37777cd0b310d5bf132d..c8b23bcee09bb7f16d75bde02e6f3a7f4ca66b4d 100644 --- a/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/__init__.py +++ b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/__init__.py @@ -21,7 +21,7 @@ from .L2VPN_Services import L2VPN_Services from .L2VPN_Service import L2VPN_Service from .L2VPN_SiteNetworkAccesses import L2VPN_SiteNetworkAccesses -URL_PREFIX = '/ietf-l2vpn-svc:l2vpn-svc' +URL_PREFIX = '/ietf-l2vpn-svc:l2vpn-svc' def _add_resource(rest_server : RestServer, resource : Resource, *urls, **kwargs): urls = [(URL_PREFIX + url) for url in urls] diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/schemas/vpn_service.py b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/schemas/vpn_service.py index b224b40737914fbf0c7ae87f08d62dc34836f2aa..9dd8eea3d711a2d5ea22ac8e0fc3e4d7140493b1 100644 --- a/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/schemas/vpn_service.py +++ b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/schemas/vpn_service.py @@ -36,7 +36,7 @@ SCHEMA_VPN_SERVICE = { 'required': ['vpn-id', 'vpn-svc-type', 'svc-topo', 'customer-name'], 'properties': { 'vpn-id': {'type': 'string', 'pattern': REGEX_UUID}, - 'vpn-svc-type': {'enum': ['vpws']}, + 'vpn-svc-type': {'enum': ['vpws', 'vpls']}, 'svc-topo': {'enum': ['any-to-any']}, 'customer-name': {'const': 'osm'}, }, diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/tools/ContextMethods.py b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/tools/ContextMethods.py new file mode 100644 index 0000000000000000000000000000000000000000..79e73a28d7bd68a2e0a7e7636c0c45ca5c4a9043 --- /dev/null +++ b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/tools/ContextMethods.py @@ -0,0 +1,39 @@ +import grpc, logging +from typing import Optional +from common.Constants import DEFAULT_CONTEXT_UUID +from context.client.ContextClient import ContextClient +from context.proto.context_pb2 import Service, ServiceId, Slice, SliceId + +LOGGER = logging.getLogger(__name__) + +def get_service( + context_client : ContextClient, service_uuid : str, context_uuid : str = DEFAULT_CONTEXT_UUID + ) -> Optional[Service]: + try: + # pylint: disable=no-member + service_id = ServiceId() + service_id.context_id.context_uuid.uuid = context_uuid + service_id.service_uuid.uuid = service_uuid + service_readonly = context_client.GetService(service_id) + service = Service() + service.CopyFrom(service_readonly) + return service + except grpc.RpcError: + #LOGGER.exception('Unable to get service({:s} / {:s})'.format(str(context_uuid), str(service_uuid))) + return None + +def get_slice( + context_client : ContextClient, slice_uuid : str, context_uuid : str = DEFAULT_CONTEXT_UUID + ) -> Optional[Slice]: + try: + # pylint: disable=no-member + slice_id = SliceId() + slice_id.context_id.context_uuid.uuid = context_uuid + slice_id.slice_uuid.uuid = slice_uuid + slice_readonly = context_client.GetSlice(slice_id) + slice_ = Slice() + slice_.CopyFrom(slice_readonly) + return slice_ + except grpc.RpcError: + #LOGGER.exception('Unable to get slice({:s} / {:s})'.format(str(context_uuid), str(slice_uuid))) + return None diff --git a/src/compute/tests/MockService_Dependencies.py b/src/compute/tests/MockService_Dependencies.py new file mode 100644 index 0000000000000000000000000000000000000000..8b0e4b3cc49d39a245b76ab5c4099f682ca4c92c --- /dev/null +++ b/src/compute/tests/MockService_Dependencies.py @@ -0,0 +1,58 @@ +# 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. + +import os +from typing import Union +from common.Constants import ServiceNameEnum +from common.Settings import ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name +from common.tests.MockServicerImpl_Context import MockServicerImpl_Context +from common.tests.MockServicerImpl_Service import MockServicerImpl_Service +from common.tests.MockServicerImpl_Slice import MockServicerImpl_Slice +from common.tools.service.GenericGrpcService import GenericGrpcService +from context.proto.context_pb2_grpc import add_ContextServiceServicer_to_server +from service.proto.service_pb2_grpc import add_ServiceServiceServicer_to_server +from slice.proto.slice_pb2_grpc import add_SliceServiceServicer_to_server + +LOCAL_HOST = '127.0.0.1' + +SERVICE_CONTEXT = ServiceNameEnum.CONTEXT +SERVICE_SERVICE = ServiceNameEnum.SERVICE +SERVICE_SLICE = ServiceNameEnum.SLICE + +class MockService_Dependencies(GenericGrpcService): + # Mock Service implementing Context, Service and Slice to simplify unitary tests of Compute + + def __init__(self, bind_port: Union[str, int]) -> None: + super().__init__(bind_port, LOCAL_HOST, enable_health_servicer=False, cls_name='MockService') + + # pylint: disable=attribute-defined-outside-init + def install_servicers(self): + self.context_servicer = MockServicerImpl_Context() + add_ContextServiceServicer_to_server(self.context_servicer, self.server) + + self.service_servicer = MockServicerImpl_Service() + add_ServiceServiceServicer_to_server(self.service_servicer, self.server) + + self.slice_servicer = MockServicerImpl_Slice() + add_SliceServiceServicer_to_server(self.slice_servicer, self.server) + + def configure_env_vars(self): + os.environ[get_env_var_name(SERVICE_CONTEXT, ENVVAR_SUFIX_SERVICE_HOST )] = str(self.bind_address) + os.environ[get_env_var_name(SERVICE_CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(self.bind_port) + + os.environ[get_env_var_name(SERVICE_SERVICE, ENVVAR_SUFIX_SERVICE_HOST )] = str(self.bind_address) + os.environ[get_env_var_name(SERVICE_SERVICE, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(self.bind_port) + + os.environ[get_env_var_name(SERVICE_SLICE, ENVVAR_SUFIX_SERVICE_HOST )] = str(self.bind_address) + os.environ[get_env_var_name(SERVICE_SLICE, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(self.bind_port) diff --git a/src/compute/tests/PrepareTestScenario.py b/src/compute/tests/PrepareTestScenario.py new file mode 100644 index 0000000000000000000000000000000000000000..d534a4a28280c80964096a9cb7291c498ebe6b93 --- /dev/null +++ b/src/compute/tests/PrepareTestScenario.py @@ -0,0 +1,52 @@ +# 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. + +import os, pytest, time +from common.Constants import ServiceNameEnum +from common.Settings import ( + ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_HTTP, get_env_var_name, get_service_port_http) +from compute.service.rest_server.RestServer import RestServer +from compute.service.rest_server.nbi_plugins.ietf_l2vpn import register_ietf_l2vpn +from compute.tests.MockService_Dependencies import MockService_Dependencies +from .mock_osm.MockOSM import MockOSM +from .Constants import WIM_MAPPING, WIM_USERNAME, WIM_PASSWORD + +LOCAL_HOST = '127.0.0.1' +MOCKSERVICE_PORT = 10000 +COMPUTE_SERVICE_PORT = MOCKSERVICE_PORT + get_service_port_http(ServiceNameEnum.COMPUTE) # avoid privileged ports +os.environ[get_env_var_name(ServiceNameEnum.COMPUTE, ENVVAR_SUFIX_SERVICE_HOST )] = str(LOCAL_HOST) +os.environ[get_env_var_name(ServiceNameEnum.COMPUTE, ENVVAR_SUFIX_SERVICE_PORT_HTTP)] = str(COMPUTE_SERVICE_PORT) + +@pytest.fixture(scope='session') +def mock_service(): + _service = MockService_Dependencies(MOCKSERVICE_PORT) + _service.configure_env_vars() + _service.start() + yield _service + _service.stop() + +@pytest.fixture(scope='session') +def compute_service_rest(mock_service): # pylint: disable=redefined-outer-name + _rest_server = RestServer() + register_ietf_l2vpn(_rest_server) + _rest_server.start() + time.sleep(1) # bring time for the server to start + yield _rest_server + _rest_server.shutdown() + _rest_server.join() + +@pytest.fixture(scope='session') +def osm_wim(compute_service_rest): # pylint: disable=redefined-outer-name + wim_url = 'http://{:s}:{:d}'.format(LOCAL_HOST, COMPUTE_SERVICE_PORT) + return MockOSM(wim_url, WIM_MAPPING, WIM_USERNAME, WIM_PASSWORD) diff --git a/src/compute/tests/mock_osm/WimconnectorIETFL2VPN.py b/src/compute/tests/mock_osm/WimconnectorIETFL2VPN.py index d5ce65a1e4fcc5c47f90fb35e21023b28cb3c8ee..b9639e8046593c1dbf4017cff963ceb7c51d0532 100644 --- a/src/compute/tests/mock_osm/WimconnectorIETFL2VPN.py +++ b/src/compute/tests/mock_osm/WimconnectorIETFL2VPN.py @@ -164,178 +164,183 @@ class WimconnectorIETFL2VPN(SdnConnectorBase): Raises: SdnConnectorException: In case of error. """ - if service_type == "ELINE": - if len(connection_points) > 2: - raise SdnConnectorError( - "Connections between more than 2 endpoints are not supported" + SETTINGS = { # min_endpoints, max_endpoints, vpn_service_type + 'ELINE': (2, 2, 'vpws'), # Virtual Private Wire Service + 'ELAN' : (2, None, 'vpls'), # Virtual Private LAN Service + } + settings = SETTINGS.get(service_type) + if settings is None: raise NotImplementedError('Unsupported service_type({:s})'.format(str(service_type))) + min_endpoints, max_endpoints, vpn_service_type = settings + + if max_endpoints is not None and len(connection_points) > max_endpoints: + msg = "Connections between more than {:d} endpoints are not supported for service_type {:s}" + raise SdnConnectorError(msg.format(max_endpoints, service_type)) + + if min_endpoints is not None and len(connection_points) < min_endpoints: + msg = "Connections must be of at least {:d} endpoints for service_type {:s}" + raise SdnConnectorError(msg.format(min_endpoints, service_type)) + + """First step, create the vpn service""" + uuid_l2vpn = str(uuid.uuid4()) + vpn_service = {} + vpn_service["vpn-id"] = uuid_l2vpn + vpn_service["vpn-svc-type"] = vpn_service_type + vpn_service["svc-topo"] = "any-to-any" + vpn_service["customer-name"] = "osm" + vpn_service_list = [] + vpn_service_list.append(vpn_service) + vpn_service_l = {"ietf-l2vpn-svc:vpn-service": vpn_service_list} + response_service_creation = None + conn_info = [] + self.logger.info("Sending vpn-service :{}".format(vpn_service_l)) + + try: + endpoint_service_creation = ( + "{}/restconf/data/ietf-l2vpn-svc:l2vpn-svc/vpn-services".format( + self.wim["wim_url"] ) + ) + response_service_creation = requests.post( + endpoint_service_creation, + headers=self.headers, + json=vpn_service_l, + auth=self.auth, + ) + except requests.exceptions.ConnectionError: + raise SdnConnectorError( + "Request to create service Timeout", http_code=408 + ) + + if response_service_creation.status_code == 409: + raise SdnConnectorError( + "Service already exists", + http_code=response_service_creation.status_code, + ) + elif response_service_creation.status_code != requests.codes.created: + raise SdnConnectorError( + "Request to create service not accepted", + http_code=response_service_creation.status_code, + ) + + """Second step, create the connections and vpn attachments""" + for connection_point in connection_points: + connection_point_wan_info = self.search_mapp(connection_point) + site_network_access = {} + connection = {} + + if connection_point["service_endpoint_encapsulation_type"] != "none": + if ( + connection_point["service_endpoint_encapsulation_type"] + == "dot1q" + ): + """The connection is a VLAN""" + connection["encapsulation-type"] = "dot1q-vlan-tagged" + tagged = {} + tagged_interf = {} + service_endpoint_encapsulation_info = connection_point[ + "service_endpoint_encapsulation_info" + ] + + if service_endpoint_encapsulation_info["vlan"] is None: + raise SdnConnectorError("VLAN must be provided") - if len(connection_points) < 2: - raise SdnConnectorError("Connections must be of at least 2 endpoints") - - """First step, create the vpn service""" - uuid_l2vpn = str(uuid.uuid4()) - vpn_service = {} - vpn_service["vpn-id"] = uuid_l2vpn - vpn_service["vpn-svc-type"] = "vpws" # Rename "vpn-scv-type" -> "vpn-svc-type" - vpn_service["svc-topo"] = "any-to-any" - vpn_service["customer-name"] = "osm" - vpn_service_list = [] - vpn_service_list.append(vpn_service) - vpn_service_l = {"ietf-l2vpn-svc:vpn-service": vpn_service_list} - response_service_creation = None - conn_info = [] - self.logger.info("Sending vpn-service :{}".format(vpn_service_l)) + tagged_interf["cvlan-id"] = service_endpoint_encapsulation_info[ + "vlan" + ] + tagged["dot1q-vlan-tagged"] = tagged_interf + connection["tagged-interface"] = tagged + else: + raise NotImplementedError("Encapsulation type not implemented") + + site_network_access["connection"] = connection + self.logger.info("Sending connection:{}".format(connection)) + vpn_attach = {} + vpn_attach["vpn-id"] = uuid_l2vpn + vpn_attach["site-role"] = vpn_service["svc-topo"] + "-role" + site_network_access["vpn-attachment"] = vpn_attach + self.logger.info("Sending vpn-attachement :{}".format(vpn_attach)) + uuid_sna = str(uuid.uuid4()) + site_network_access["network-access-id"] = uuid_sna + site_network_access["bearer"] = connection_point_wan_info[ + "service_mapping_info" + ]["bearer"] + site_network_accesses = {} + site_network_access_list = [] + site_network_access_list.append(site_network_access) + site_network_accesses[ + "ietf-l2vpn-svc:site-network-access" + ] = site_network_access_list + conn_info_d = {} + conn_info_d["site"] = connection_point_wan_info["service_mapping_info"][ + "site-id" + ] + conn_info_d["site-network-access-id"] = site_network_access[ + "network-access-id" + ] + conn_info_d["mapping"] = None + conn_info.append(conn_info_d) try: - endpoint_service_creation = ( - "{}/restconf/data/ietf-l2vpn-svc:l2vpn-svc/vpn-services".format( - self.wim["wim_url"] + endpoint_site_network_access_creation = ( + "{}/restconf/data/ietf-l2vpn-svc:l2vpn-svc/" + "sites/site={}/site-network-accesses/".format( + self.wim["wim_url"], + connection_point_wan_info["service_mapping_info"][ + "site-id" + ], ) ) - response_service_creation = requests.post( - endpoint_service_creation, + response_endpoint_site_network_access_creation = requests.post( + endpoint_site_network_access_creation, headers=self.headers, - json=vpn_service_l, + json=site_network_accesses, auth=self.auth, ) - except requests.exceptions.ConnectionError: - raise SdnConnectorError( - "Request to create service Timeout", http_code=408 - ) - if response_service_creation.status_code == 409: - raise SdnConnectorError( - "Service already exists", - http_code=response_service_creation.status_code, - ) - elif response_service_creation.status_code != requests.codes.created: - raise SdnConnectorError( - "Request to create service not accepted", - http_code=response_service_creation.status_code, - ) + if ( + response_endpoint_site_network_access_creation.status_code + == 409 + ): + self.delete_connectivity_service(vpn_service["vpn-id"]) + + raise SdnConnectorError( + "Site_Network_Access with ID '{}' already exists".format( + site_network_access["network-access-id"] + ), + http_code=response_endpoint_site_network_access_creation.status_code, + ) + elif ( + response_endpoint_site_network_access_creation.status_code + == 400 + ): + self.delete_connectivity_service(vpn_service["vpn-id"]) - """Second step, create the connections and vpn attachments""" - for connection_point in connection_points: - connection_point_wan_info = self.search_mapp(connection_point) - site_network_access = {} - connection = {} - - if connection_point["service_endpoint_encapsulation_type"] != "none": - if ( - connection_point["service_endpoint_encapsulation_type"] - == "dot1q" - ): - """The connection is a VLAN""" - connection["encapsulation-type"] = "dot1q-vlan-tagged" - tagged = {} - tagged_interf = {} - service_endpoint_encapsulation_info = connection_point[ - "service_endpoint_encapsulation_info" - ] - - if service_endpoint_encapsulation_info["vlan"] is None: - raise SdnConnectorError("VLAN must be provided") - - tagged_interf["cvlan-id"] = service_endpoint_encapsulation_info[ - "vlan" - ] - tagged["dot1q-vlan-tagged"] = tagged_interf - connection["tagged-interface"] = tagged - else: - raise NotImplementedError("Encapsulation type not implemented") - - site_network_access["connection"] = connection - self.logger.info("Sending connection:{}".format(connection)) - vpn_attach = {} - vpn_attach["vpn-id"] = uuid_l2vpn - vpn_attach["site-role"] = vpn_service["svc-topo"] + "-role" - site_network_access["vpn-attachment"] = vpn_attach - self.logger.info("Sending vpn-attachement :{}".format(vpn_attach)) - uuid_sna = str(uuid.uuid4()) - site_network_access["network-access-id"] = uuid_sna - site_network_access["bearer"] = connection_point_wan_info[ - "service_mapping_info" - ]["bearer"] - site_network_accesses = {} - site_network_access_list = [] - site_network_access_list.append(site_network_access) - site_network_accesses[ - "ietf-l2vpn-svc:site-network-access" - ] = site_network_access_list - conn_info_d = {} - conn_info_d["site"] = connection_point_wan_info["service_mapping_info"][ - "site-id" - ] - conn_info_d["site-network-access-id"] = site_network_access[ - "network-access-id" - ] - conn_info_d["mapping"] = None - conn_info.append(conn_info_d) - - try: - endpoint_site_network_access_creation = ( - "{}/restconf/data/ietf-l2vpn-svc:l2vpn-svc/" - "sites/site={}/site-network-accesses/".format( - self.wim["wim_url"], + raise SdnConnectorError( + "Site {} does not exist".format( connection_point_wan_info["service_mapping_info"][ "site-id" - ], - ) - ) - response_endpoint_site_network_access_creation = requests.post( - endpoint_site_network_access_creation, - headers=self.headers, - json=site_network_accesses, - auth=self.auth, + ] + ), + http_code=response_endpoint_site_network_access_creation.status_code, ) - - if ( - response_endpoint_site_network_access_creation.status_code - == 409 - ): - self.delete_connectivity_service(vpn_service["vpn-id"]) - - raise SdnConnectorError( - "Site_Network_Access with ID '{}' already exists".format( - site_network_access["network-access-id"] - ), - http_code=response_endpoint_site_network_access_creation.status_code, - ) - elif ( - response_endpoint_site_network_access_creation.status_code - == 400 - ): - self.delete_connectivity_service(vpn_service["vpn-id"]) - - raise SdnConnectorError( - "Site {} does not exist".format( - connection_point_wan_info["service_mapping_info"][ - "site-id" - ] - ), - http_code=response_endpoint_site_network_access_creation.status_code, - ) - elif ( - response_endpoint_site_network_access_creation.status_code - != requests.codes.created - and response_endpoint_site_network_access_creation.status_code - != requests.codes.no_content - ): - self.delete_connectivity_service(vpn_service["vpn-id"]) - - raise SdnConnectorError( - "Request no accepted", - http_code=response_endpoint_site_network_access_creation.status_code, - ) - except requests.exceptions.ConnectionError: + elif ( + response_endpoint_site_network_access_creation.status_code + != requests.codes.created + and response_endpoint_site_network_access_creation.status_code + != requests.codes.no_content + ): self.delete_connectivity_service(vpn_service["vpn-id"]) - raise SdnConnectorError("Request Timeout", http_code=408) + raise SdnConnectorError( + "Request no accepted", + http_code=response_endpoint_site_network_access_creation.status_code, + ) + except requests.exceptions.ConnectionError: + self.delete_connectivity_service(vpn_service["vpn-id"]) + + raise SdnConnectorError("Request Timeout", http_code=408) - return uuid_l2vpn, conn_info - else: - raise NotImplementedError + return uuid_l2vpn, conn_info def delete_connectivity_service(self, service_uuid, conn_info=None): """Disconnect multi-site endpoints previously connected diff --git a/src/compute/tests/test_unitary.py b/src/compute/tests/test_unitary.py index 2fa5869865213ccc39a759be2fd26ba16413fc3e..05c45c1b3554d21084a4a20cac6856b049fe7ca3 100644 --- a/src/compute/tests/test_unitary.py +++ b/src/compute/tests/test_unitary.py @@ -12,69 +12,16 @@ # See the License for the specific language governing permissions and # limitations under the License. -import logging, os, pytest, time -from common.tests.MockService import MockService -from common.tests.MockServicerImpl_Context import MockServicerImpl_Context -from common.tests.MockServicerImpl_Service import MockServicerImpl_Service -from compute.Config import RESTAPI_SERVICE_PORT, RESTAPI_BASE_URL -from compute.service.rest_server.RestServer import RestServer -from context.proto.context_pb2_grpc import add_ContextServiceServicer_to_server -from service.proto.service_pb2_grpc import add_ServiceServiceServicer_to_server +import logging from .mock_osm.MockOSM import MockOSM -from .Constants import ( - SERVICE_CONNECTION_POINTS_1, SERVICE_CONNECTION_POINTS_2, SERVICE_TYPE, WIM_MAPPING, WIM_USERNAME, WIM_PASSWORD) +from .Constants import SERVICE_CONNECTION_POINTS_1, SERVICE_CONNECTION_POINTS_2, SERVICE_TYPE +from .PrepareTestScenario import ( # pylint: disable=unused-import + # be careful, order of symbols is important here! + mock_service, compute_service_rest, osm_wim) LOGGER = logging.getLogger(__name__) LOGGER.setLevel(logging.DEBUG) -LOCALHOST = '127.0.0.1' -MOCKSERVER_GRPC_PORT = 10000 -COMPUTE_RESTAPI_PORT = 10000 + RESTAPI_SERVICE_PORT # avoid privileged ports - -class MockService_ContextService(MockService): - # Mock Server implementing Context and Service to simplify unitary tests of Compute - - def __init__(self, cls_name='MockService_Service'): - super().__init__(LOCALHOST, MOCKSERVER_GRPC_PORT, cls_name=cls_name) - - # pylint: disable=attribute-defined-outside-init - def install_servicers(self): - self.context_servicer = MockServicerImpl_Context() - add_ContextServiceServicer_to_server(self.context_servicer, self.server) - self.service_servicer = MockServicerImpl_Service() - add_ServiceServiceServicer_to_server(self.service_servicer, self.server) - -os.environ['CONTEXTSERVICE_SERVICE_HOST'] = LOCALHOST -os.environ['CONTEXTSERVICE_SERVICE_PORT_GRPC'] = str(MOCKSERVER_GRPC_PORT) -os.environ['SERVICESERVICE_SERVICE_HOST'] = LOCALHOST -os.environ['SERVICESERVICE_SERVICE_PORT_GRPC'] = str(MOCKSERVER_GRPC_PORT) - -# NBI Plugin IETF L2VPN requires environment variables CONTEXTSERVICE_SERVICE_HOST, CONTEXTSERVICE_SERVICE_PORT_GRPC, -# SERVICESERVICE_SERVICE_HOST, and SERVICESERVICE_SERVICE_PORT_GRPC to work properly. -# pylint: disable=wrong-import-position,ungrouped-imports -from compute.service.rest_server.nbi_plugins.ietf_l2vpn import register_ietf_l2vpn - -@pytest.fixture(scope='session') -def mockservice(): - _service = MockService_ContextService() - _service.start() - yield _service - _service.stop() - -@pytest.fixture(scope='session') -def compute_service_rest(mockservice): # pylint: disable=redefined-outer-name - _rest_server = RestServer(port=COMPUTE_RESTAPI_PORT, base_url=RESTAPI_BASE_URL) - register_ietf_l2vpn(_rest_server) - _rest_server.start() - time.sleep(1) # bring time for the server to start - yield _rest_server - _rest_server.shutdown() - _rest_server.join() - -@pytest.fixture(scope='session') -def osm_wim(compute_service_rest): # pylint: disable=redefined-outer-name - wim_url = 'http://{:s}:{:d}'.format(LOCALHOST, COMPUTE_RESTAPI_PORT) - return MockOSM(wim_url, WIM_MAPPING, WIM_USERNAME, WIM_PASSWORD) def test_compute_create_connectivity_service_rest_api(osm_wim : MockOSM): # pylint: disable=redefined-outer-name osm_wim.create_connectivity_service(SERVICE_TYPE, SERVICE_CONNECTION_POINTS_1) diff --git a/src/context/.gitlab-ci.yml b/src/context/.gitlab-ci.yml index c0cbef8d7d8e2165e5d2f64c79fa2e6215ef8b96..dc302cbd3aa7dbe197450c91a0e9c90714df6110 100644 --- a/src/context/.gitlab-ci.yml +++ b/src/context/.gitlab-ci.yml @@ -58,7 +58,6 @@ unit test context: - docker ps -a - docker logs $IMAGE_NAME - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml" - - docker exec -i $IMAGE_NAME bash -c "coverage xml -o /opt/results/${IMAGE_NAME}_coverage.xml" - docker exec -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing" coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' after_script: @@ -79,7 +78,6 @@ unit test context: when: always reports: junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml - cobertura: src/$IMAGE_NAME/tests/${IMAGE_NAME}_coverage.xml # Deployment of the service in Kubernetes Cluster deploy context: diff --git a/src/context/Config.py b/src/context/Config.py index 328610fc81561f60d97b8ef3080930c4affce20e..6f5d1dc0b347dc5db27a2cfae973a4e5bdf7b4cc 100644 --- a/src/context/Config.py +++ b/src/context/Config.py @@ -12,22 +12,5 @@ # See the License for the specific language governing permissions and # limitations under the License. -import logging - -# General settings -LOG_LEVEL = logging.INFO - -# gRPC settings -GRPC_SERVICE_PORT = 1010 -GRPC_MAX_WORKERS = 200 # multiple clients might keep connections alive for Get*Events() RPC methods -GRPC_GRACE_PERIOD = 60 - -# REST-API settings -RESTAPI_SERVICE_PORT = 8080 -RESTAPI_BASE_URL = '/api' - -# Prometheus settings -METRICS_PORT = 9192 - # Autopopulate the component with fake data for testing purposes? POPULATE_FAKE_DATA = False diff --git a/src/context/client/ContextClient.py b/src/context/client/ContextClient.py index bf58ea45db4ced7496657410f0c941584e4611e0..34214fac00d03f5d7595bf118b35026642ba9426 100644 --- a/src/context/client/ContextClient.py +++ b/src/context/client/ContextClient.py @@ -12,14 +12,17 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import Iterator import grpc, logging +from typing import Iterator +from common.Constants import ServiceNameEnum +from common.Settings import get_service_host, get_service_port_grpc from common.tools.client.RetryDecorator import retry, delay_exponential +from common.tools.grpc.Tools import grpc_message_to_json_string from context.proto.context_pb2 import ( Connection, ConnectionEvent, ConnectionId, ConnectionIdList, ConnectionList, Context, ContextEvent, ContextId, ContextIdList, ContextList, Device, DeviceEvent, DeviceId, DeviceIdList, DeviceList, Empty, Link, LinkEvent, - LinkId, LinkIdList, LinkList, Service, ServiceEvent, ServiceId, ServiceIdList, ServiceList, Topology, - TopologyEvent, TopologyId, TopologyIdList, TopologyList) + LinkId, LinkIdList, LinkList, Service, ServiceEvent, ServiceId, ServiceIdList, ServiceList, Slice, SliceEvent, + SliceId, SliceIdList, SliceList, Topology, TopologyEvent, TopologyId, TopologyIdList, TopologyList) from context.proto.context_pb2_grpc import ContextServiceStub LOGGER = logging.getLogger(__name__) @@ -28,9 +31,11 @@ DELAY_FUNCTION = delay_exponential(initial=0.01, increment=2.0, maximum=5.0) RETRY_DECORATOR = retry(max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') class ContextClient: - def __init__(self, address, port): - self.endpoint = '{:s}:{:s}'.format(str(address), str(port)) - LOGGER.debug('Creating channel to {:s}...'.format(self.endpoint)) + def __init__(self, host=None, port=None): + if not host: host = get_service_host(ServiceNameEnum.CONTEXT) + if not port: port = get_service_port_grpc(ServiceNameEnum.CONTEXT) + self.endpoint = '{:s}:{:s}'.format(str(host), str(port)) + LOGGER.debug('Creating channel to {:s}...'.format(str(self.endpoint))) self.channel = None self.stub = None self.connect() @@ -47,252 +52,294 @@ class ContextClient: @RETRY_DECORATOR def ListContextIds(self, request: Empty) -> ContextIdList: - LOGGER.debug('ListContextIds request: {:s}'.format(str(request))) + LOGGER.debug('ListContextIds request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.ListContextIds(request) - LOGGER.debug('ListContextIds result: {:s}'.format(str(response))) + LOGGER.debug('ListContextIds result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def ListContexts(self, request: Empty) -> ContextList: - LOGGER.debug('ListContexts request: {:s}'.format(str(request))) + LOGGER.debug('ListContexts request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.ListContexts(request) - LOGGER.debug('ListContexts result: {:s}'.format(str(response))) + LOGGER.debug('ListContexts result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def GetContext(self, request: ContextId) -> Context: - LOGGER.debug('GetContext request: {:s}'.format(str(request))) + LOGGER.debug('GetContext request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.GetContext(request) - LOGGER.debug('GetContext result: {:s}'.format(str(response))) + LOGGER.debug('GetContext result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def SetContext(self, request: Context) -> ContextId: - LOGGER.debug('SetContext request: {:s}'.format(str(request))) + LOGGER.debug('SetContext request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.SetContext(request) - LOGGER.debug('SetContext result: {:s}'.format(str(response))) + LOGGER.debug('SetContext result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def RemoveContext(self, request: ContextId) -> Empty: - LOGGER.debug('RemoveContext request: {:s}'.format(str(request))) + LOGGER.debug('RemoveContext request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.RemoveContext(request) - LOGGER.debug('RemoveContext result: {:s}'.format(str(response))) + LOGGER.debug('RemoveContext result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def GetContextEvents(self, request: Empty) -> Iterator[ContextEvent]: - LOGGER.debug('GetContextEvents request: {:s}'.format(str(request))) + LOGGER.debug('GetContextEvents request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.GetContextEvents(request) - LOGGER.debug('GetContextEvents result: {:s}'.format(str(response))) + LOGGER.debug('GetContextEvents result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def ListTopologyIds(self, request: ContextId) -> TopologyIdList: - LOGGER.debug('ListTopologyIds request: {:s}'.format(str(request))) + LOGGER.debug('ListTopologyIds request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.ListTopologyIds(request) - LOGGER.debug('ListTopologyIds result: {:s}'.format(str(response))) + LOGGER.debug('ListTopologyIds result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def ListTopologies(self, request: ContextId) -> TopologyList: - LOGGER.debug('ListTopologies request: {:s}'.format(str(request))) + LOGGER.debug('ListTopologies request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.ListTopologies(request) - LOGGER.debug('ListTopologies result: {:s}'.format(str(response))) + LOGGER.debug('ListTopologies result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def GetTopology(self, request: TopologyId) -> Topology: - LOGGER.debug('GetTopology request: {:s}'.format(str(request))) + LOGGER.debug('GetTopology request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.GetTopology(request) - LOGGER.debug('GetTopology result: {:s}'.format(str(response))) + LOGGER.debug('GetTopology result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def SetTopology(self, request: Topology) -> TopologyId: - LOGGER.debug('SetTopology request: {:s}'.format(str(request))) + LOGGER.debug('SetTopology request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.SetTopology(request) - LOGGER.debug('SetTopology result: {:s}'.format(str(response))) + LOGGER.debug('SetTopology result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def RemoveTopology(self, request: TopologyId) -> Empty: - LOGGER.debug('RemoveTopology request: {:s}'.format(str(request))) + LOGGER.debug('RemoveTopology request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.RemoveTopology(request) - LOGGER.debug('RemoveTopology result: {:s}'.format(str(response))) + LOGGER.debug('RemoveTopology result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def GetTopologyEvents(self, request: Empty) -> Iterator[TopologyEvent]: - LOGGER.debug('GetTopologyEvents request: {:s}'.format(str(request))) + LOGGER.debug('GetTopologyEvents request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.GetTopologyEvents(request) - LOGGER.debug('GetTopologyEvents result: {:s}'.format(str(response))) + LOGGER.debug('GetTopologyEvents result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def ListDeviceIds(self, request: Empty) -> DeviceIdList: - LOGGER.debug('ListDeviceIds request: {:s}'.format(str(request))) + LOGGER.debug('ListDeviceIds request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.ListDeviceIds(request) - LOGGER.debug('ListDeviceIds result: {:s}'.format(str(response))) + LOGGER.debug('ListDeviceIds result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def ListDevices(self, request: Empty) -> DeviceList: - LOGGER.debug('ListDevices request: {:s}'.format(str(request))) + LOGGER.debug('ListDevices request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.ListDevices(request) - LOGGER.debug('ListDevices result: {:s}'.format(str(response))) + LOGGER.debug('ListDevices result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def GetDevice(self, request: DeviceId) -> Device: - LOGGER.debug('GetDevice request: {:s}'.format(str(request))) + LOGGER.debug('GetDevice request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.GetDevice(request) - LOGGER.debug('GetDevice result: {:s}'.format(str(response))) + LOGGER.debug('GetDevice result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def SetDevice(self, request: Device) -> DeviceId: - LOGGER.debug('SetDevice request: {:s}'.format(str(request))) + LOGGER.debug('SetDevice request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.SetDevice(request) - LOGGER.debug('SetDevice result: {:s}'.format(str(response))) + LOGGER.debug('SetDevice result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def RemoveDevice(self, request: DeviceId) -> Empty: - LOGGER.debug('RemoveDevice request: {:s}'.format(str(request))) + LOGGER.debug('RemoveDevice request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.RemoveDevice(request) - LOGGER.debug('RemoveDevice result: {:s}'.format(str(response))) + LOGGER.debug('RemoveDevice result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def GetDeviceEvents(self, request: Empty) -> Iterator[DeviceEvent]: - LOGGER.debug('GetDeviceEvents request: {:s}'.format(str(request))) + LOGGER.debug('GetDeviceEvents request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.GetDeviceEvents(request) - LOGGER.debug('GetDeviceEvents result: {:s}'.format(str(response))) + LOGGER.debug('GetDeviceEvents result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def ListLinkIds(self, request: Empty) -> LinkIdList: - LOGGER.debug('ListLinkIds request: {:s}'.format(str(request))) + LOGGER.debug('ListLinkIds request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.ListLinkIds(request) - LOGGER.debug('ListLinkIds result: {:s}'.format(str(response))) + LOGGER.debug('ListLinkIds result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def ListLinks(self, request: Empty) -> LinkList: - LOGGER.debug('ListLinks request: {:s}'.format(str(request))) + LOGGER.debug('ListLinks request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.ListLinks(request) - LOGGER.debug('ListLinks result: {:s}'.format(str(response))) + LOGGER.debug('ListLinks result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def GetLink(self, request: LinkId) -> Link: - LOGGER.debug('GetLink request: {:s}'.format(str(request))) + LOGGER.debug('GetLink request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.GetLink(request) - LOGGER.debug('GetLink result: {:s}'.format(str(response))) + LOGGER.debug('GetLink result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def SetLink(self, request: Link) -> LinkId: - LOGGER.debug('SetLink request: {:s}'.format(str(request))) + LOGGER.debug('SetLink request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.SetLink(request) - LOGGER.debug('SetLink result: {:s}'.format(str(response))) + LOGGER.debug('SetLink result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def RemoveLink(self, request: LinkId) -> Empty: - LOGGER.debug('RemoveLink request: {:s}'.format(str(request))) + LOGGER.debug('RemoveLink request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.RemoveLink(request) - LOGGER.debug('RemoveLink result: {:s}'.format(str(response))) + LOGGER.debug('RemoveLink result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def GetLinkEvents(self, request: Empty) -> Iterator[LinkEvent]: - LOGGER.debug('GetLinkEvents request: {:s}'.format(str(request))) + LOGGER.debug('GetLinkEvents request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.GetLinkEvents(request) - LOGGER.debug('GetLinkEvents result: {:s}'.format(str(response))) + LOGGER.debug('GetLinkEvents result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def ListServiceIds(self, request: ContextId) -> ServiceIdList: - LOGGER.debug('ListServiceIds request: {:s}'.format(str(request))) + LOGGER.debug('ListServiceIds request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.ListServiceIds(request) - LOGGER.debug('ListServiceIds result: {:s}'.format(str(response))) + LOGGER.debug('ListServiceIds result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def ListServices(self, request: ContextId) -> ServiceList: - LOGGER.debug('ListServices request: {:s}'.format(str(request))) + LOGGER.debug('ListServices request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.ListServices(request) - LOGGER.debug('ListServices result: {:s}'.format(str(response))) + LOGGER.debug('ListServices result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def GetService(self, request: ServiceId) -> Service: - LOGGER.debug('GetService request: {:s}'.format(str(request))) + LOGGER.debug('GetService request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.GetService(request) - LOGGER.debug('GetService result: {:s}'.format(str(response))) + LOGGER.debug('GetService result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def SetService(self, request: Service) -> ServiceId: - LOGGER.debug('SetService request: {:s}'.format(str(request))) + LOGGER.debug('SetService request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.SetService(request) - LOGGER.debug('SetService result: {:s}'.format(str(response))) + LOGGER.debug('SetService result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def RemoveService(self, request: ServiceId) -> Empty: - LOGGER.debug('RemoveService request: {:s}'.format(str(request))) + LOGGER.debug('RemoveService request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.RemoveService(request) - LOGGER.debug('RemoveService result: {:s}'.format(str(response))) + LOGGER.debug('RemoveService result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def GetServiceEvents(self, request: Empty) -> Iterator[ServiceEvent]: - LOGGER.debug('GetServiceEvents request: {:s}'.format(str(request))) + LOGGER.debug('GetServiceEvents request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.GetServiceEvents(request) - LOGGER.debug('GetServiceEvents result: {:s}'.format(str(response))) + LOGGER.debug('GetServiceEvents result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def ListSliceIds(self, request: ContextId) -> SliceIdList: + LOGGER.debug('ListSliceIds request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.ListSliceIds(request) + LOGGER.debug('ListSliceIds result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def ListSlices(self, request: ContextId) -> SliceList: + LOGGER.debug('ListSlices request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.ListSlices(request) + LOGGER.debug('ListSlices result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def GetSlice(self, request: SliceId) -> Slice: + LOGGER.debug('GetSlice request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.GetSlice(request) + LOGGER.debug('GetSlice result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def SetSlice(self, request: Slice) -> SliceId: + LOGGER.debug('SetSlice request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.SetSlice(request) + LOGGER.debug('SetSlice result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def RemoveSlice(self, request: SliceId) -> Empty: + LOGGER.debug('RemoveSlice request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.RemoveSlice(request) + LOGGER.debug('RemoveSlice result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def GetSliceEvents(self, request: Empty) -> Iterator[SliceEvent]: + LOGGER.debug('GetSliceEvents request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.GetSliceEvents(request) + LOGGER.debug('GetSliceEvents result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def ListConnectionIds(self, request: ServiceId) -> ConnectionIdList: - LOGGER.debug('ListConnectionIds request: {:s}'.format(str(request))) + LOGGER.debug('ListConnectionIds request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.ListConnectionIds(request) - LOGGER.debug('ListConnectionIds result: {:s}'.format(str(response))) + LOGGER.debug('ListConnectionIds result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def ListConnections(self, request: ServiceId) -> ConnectionList: - LOGGER.debug('ListConnections request: {:s}'.format(str(request))) + LOGGER.debug('ListConnections request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.ListConnections(request) - LOGGER.debug('ListConnections result: {:s}'.format(str(response))) + LOGGER.debug('ListConnections result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def GetConnection(self, request: ConnectionId) -> Connection: - LOGGER.debug('GetConnection request: {:s}'.format(str(request))) + LOGGER.debug('GetConnection request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.GetConnection(request) - LOGGER.debug('GetConnection result: {:s}'.format(str(response))) + LOGGER.debug('GetConnection result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def SetConnection(self, request: Connection) -> ConnectionId: - LOGGER.debug('SetConnection request: {:s}'.format(str(request))) + LOGGER.debug('SetConnection request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.SetConnection(request) - LOGGER.debug('SetConnection result: {:s}'.format(str(response))) + LOGGER.debug('SetConnection result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def RemoveConnection(self, request: ConnectionId) -> Empty: - LOGGER.debug('RemoveConnection request: {:s}'.format(str(request))) + LOGGER.debug('RemoveConnection request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.RemoveConnection(request) - LOGGER.debug('RemoveConnection result: {:s}'.format(str(response))) + LOGGER.debug('RemoveConnection result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def GetConnectionEvents(self, request: Empty) -> Iterator[ConnectionEvent]: - LOGGER.debug('GetConnectionEvents request: {:s}'.format(str(request))) + LOGGER.debug('GetConnectionEvents request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.GetConnectionEvents(request) - LOGGER.debug('GetConnectionEvents result: {:s}'.format(str(response))) + LOGGER.debug('GetConnectionEvents result: {:s}'.format(grpc_message_to_json_string(response))) return response diff --git a/src/context/client/EventsCollector.py b/src/context/client/EventsCollector.py index 3022df0a6f4e56cdbf6444b90eeeb41b43277c53..f35b43eab40e7bf41334646ace6b4fa46beb5e10 100644 --- a/src/context/client/EventsCollector.py +++ b/src/context/client/EventsCollector.py @@ -32,6 +32,7 @@ class EventsCollector: self._device_stream = context_client_grpc.GetDeviceEvents(Empty()) self._link_stream = context_client_grpc.GetLinkEvents(Empty()) self._service_stream = context_client_grpc.GetServiceEvents(Empty()) + self._slice_stream = context_client_grpc.GetSliceEvents(Empty()) self._connection_stream = context_client_grpc.GetConnectionEvents(Empty()) self._context_thread = threading.Thread(target=self._collect, args=(self._context_stream ,), daemon=False) @@ -39,6 +40,7 @@ class EventsCollector: self._device_thread = threading.Thread(target=self._collect, args=(self._device_stream ,), daemon=False) self._link_thread = threading.Thread(target=self._collect, args=(self._link_stream ,), daemon=False) self._service_thread = threading.Thread(target=self._collect, args=(self._service_stream ,), daemon=False) + self._slice_thread = threading.Thread(target=self._collect, args=(self._slice_stream ,), daemon=False) self._connection_thread = threading.Thread(target=self._collect, args=(self._connection_stream,), daemon=False) def _collect(self, events_stream) -> None: @@ -57,6 +59,7 @@ class EventsCollector: self._device_thread.start() self._link_thread.start() self._service_thread.start() + self._slice_thread.start() self._connection_thread.start() def get_event(self, block : bool = True, timeout : float = 0.1): @@ -85,6 +88,7 @@ class EventsCollector: self._device_stream.cancel() self._link_stream.cancel() self._service_stream.cancel() + self._slice_stream.cancel() self._connection_stream.cancel() self._context_thread.join() @@ -92,4 +96,5 @@ class EventsCollector: self._device_thread.join() self._link_thread.join() self._service_thread.join() + self._slice_thread.join() self._connection_thread.join() diff --git a/src/context/genproto.sh b/src/context/genproto.sh index 8302d355019b0423f20b0ee426cf270c553c9b30..5c54cd7a2b8f090d520c2f500cfc966838f657ab 100755 --- a/src/context/genproto.sh +++ b/src/context/genproto.sh @@ -1,6 +1,6 @@ #!/bin/bash -eu # -# Copyright 2018 Google LLC +# 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. @@ -14,14 +14,27 @@ # See the License for the specific language governing permissions and # limitations under the License. -#!/bin/bash -e - # Make folder containing the script the root folder for its execution cd $(dirname $0) rm -rf proto/*.py rm -rf proto/__pycache__ -touch proto/__init__.py +tee proto/__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 python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto context.proto python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto kpi_sample_types.proto diff --git a/src/context/proto/context_pb2.py b/src/context/proto/context_pb2.py index 68602b16f264ceac9acc3ef6669b09d5984e72c2..50d501d3ac053ad644554331af26e3c40cd426a1 100644 --- a/src/context/proto/context_pb2.py +++ b/src/context/proto/context_pb2.py @@ -21,7 +21,7 @@ DESCRIPTOR = _descriptor.FileDescriptor( syntax='proto3', serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\rcontext.proto\x12\x07\x63ontext\x1a\x16kpi_sample_types.proto\"\x07\n\x05\x45mpty\"\x14\n\x04Uuid\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"F\n\x05\x45vent\x12\x11\n\ttimestamp\x18\x01 \x01(\x01\x12*\n\nevent_type\x18\x02 \x01(\x0e\x32\x16.context.EventTypeEnum\"0\n\tContextId\x12#\n\x0c\x63ontext_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xb6\x01\n\x07\x43ontext\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12)\n\x0ctopology_ids\x18\x02 \x03(\x0b\x32\x13.context.TopologyId\x12\'\n\x0bservice_ids\x18\x03 \x03(\x0b\x32\x12.context.ServiceId\x12/\n\ncontroller\x18\x04 \x01(\x0b\x32\x1b.context.TeraFlowController\"8\n\rContextIdList\x12\'\n\x0b\x63ontext_ids\x18\x01 \x03(\x0b\x32\x12.context.ContextId\"1\n\x0b\x43ontextList\x12\"\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32\x10.context.Context\"U\n\x0c\x43ontextEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\ncontext_id\x18\x02 \x01(\x0b\x32\x12.context.ContextId\"Z\n\nTopologyId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12$\n\rtopology_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"~\n\x08Topology\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12%\n\ndevice_ids\x18\x02 \x03(\x0b\x32\x11.context.DeviceId\x12!\n\x08link_ids\x18\x03 \x03(\x0b\x32\x0f.context.LinkId\";\n\x0eTopologyIdList\x12)\n\x0ctopology_ids\x18\x01 \x03(\x0b\x32\x13.context.TopologyId\"5\n\x0cTopologyList\x12%\n\ntopologies\x18\x01 \x03(\x0b\x32\x11.context.Topology\"X\n\rTopologyEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12(\n\x0btopology_id\x18\x02 \x01(\x0b\x32\x13.context.TopologyId\".\n\x08\x44\x65viceId\x12\"\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x9a\x02\n\x06\x44\x65vice\x12$\n\tdevice_id\x18\x01 \x01(\x0b\x32\x11.context.DeviceId\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12,\n\rdevice_config\x18\x03 \x01(\x0b\x32\x15.context.DeviceConfig\x12G\n\x19\x64\x65vice_operational_status\x18\x04 \x01(\x0e\x32$.context.DeviceOperationalStatusEnum\x12\x31\n\x0e\x64\x65vice_drivers\x18\x05 \x03(\x0e\x32\x19.context.DeviceDriverEnum\x12+\n\x10\x64\x65vice_endpoints\x18\x06 \x03(\x0b\x32\x11.context.EndPoint\"9\n\x0c\x44\x65viceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"5\n\x0c\x44\x65viceIdList\x12%\n\ndevice_ids\x18\x01 \x03(\x0b\x32\x11.context.DeviceId\".\n\nDeviceList\x12 \n\x07\x64\x65vices\x18\x01 \x03(\x0b\x32\x0f.context.Device\"R\n\x0b\x44\x65viceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"*\n\x06LinkId\x12 \n\tlink_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"X\n\x04Link\x12 \n\x07link_id\x18\x01 \x01(\x0b\x32\x0f.context.LinkId\x12.\n\x11link_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\"/\n\nLinkIdList\x12!\n\x08link_ids\x18\x01 \x03(\x0b\x32\x0f.context.LinkId\"(\n\x08LinkList\x12\x1c\n\x05links\x18\x01 \x03(\x0b\x32\r.context.Link\"L\n\tLinkEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12 \n\x07link_id\x18\x02 \x01(\x0b\x32\x0f.context.LinkId\"X\n\tServiceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12#\n\x0cservice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\xa6\x02\n\x07Service\x12&\n\nservice_id\x18\x01 \x01(\x0b\x32\x12.context.ServiceId\x12.\n\x0cservice_type\x18\x02 \x01(\x0e\x32\x18.context.ServiceTypeEnum\x12\x31\n\x14service_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12\x30\n\x13service_constraints\x18\x04 \x03(\x0b\x32\x13.context.Constraint\x12.\n\x0eservice_status\x18\x05 \x01(\x0b\x32\x16.context.ServiceStatus\x12.\n\x0eservice_config\x18\x06 \x01(\x0b\x32\x16.context.ServiceConfig\"C\n\rServiceStatus\x12\x32\n\x0eservice_status\x18\x01 \x01(\x0e\x32\x1a.context.ServiceStatusEnum\":\n\rServiceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"8\n\rServiceIdList\x12\'\n\x0bservice_ids\x18\x01 \x03(\x0b\x32\x12.context.ServiceId\"1\n\x0bServiceList\x12\"\n\x08services\x18\x01 \x03(\x0b\x32\x10.context.Service\"U\n\x0cServiceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\"6\n\x0c\x43onnectionId\x12&\n\x0f\x63onnection_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xc4\x01\n\nConnection\x12,\n\rconnection_id\x18\x01 \x01(\x0b\x32\x15.context.ConnectionId\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\x12\x33\n\x16path_hops_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12+\n\x0fsub_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\"A\n\x10\x43onnectionIdList\x12-\n\x0e\x63onnection_ids\x18\x01 \x03(\x0b\x32\x15.context.ConnectionId\":\n\x0e\x43onnectionList\x12(\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x13.context.Connection\"^\n\x0f\x43onnectionEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12,\n\rconnection_id\x18\x02 \x01(\x0b\x32\x15.context.ConnectionId\"\x82\x01\n\nEndPointId\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\x12$\n\rendpoint_uuid\x18\x03 \x01(\x0b\x32\r.context.Uuid\"\x86\x01\n\x08\x45ndPoint\x12(\n\x0b\x65ndpoint_id\x18\x01 \x01(\x0b\x32\x13.context.EndPointId\x12\x15\n\rendpoint_type\x18\x02 \x01(\t\x12\x39\n\x10kpi_sample_types\x18\x03 \x03(\x0e\x32\x1f.kpi_sample_types.KpiSampleType\"e\n\nConfigRule\x12)\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x19.context.ConfigActionEnum\x12\x14\n\x0cresource_key\x18\x02 \x01(\t\x12\x16\n\x0eresource_value\x18\x03 \x01(\t\"?\n\nConstraint\x12\x17\n\x0f\x63onstraint_type\x18\x01 \x01(\t\x12\x18\n\x10\x63onstraint_value\x18\x02 \x01(\t\"^\n\x12TeraFlowController\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x12\n\nip_address\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\"U\n\x14\x41uthenticationResult\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x15\n\rauthenticated\x18\x02 \x01(\x08*j\n\rEventTypeEnum\x12\x17\n\x13\x45VENTTYPE_UNDEFINED\x10\x00\x12\x14\n\x10\x45VENTTYPE_CREATE\x10\x01\x12\x14\n\x10\x45VENTTYPE_UPDATE\x10\x02\x12\x14\n\x10\x45VENTTYPE_REMOVE\x10\x03*\xc5\x01\n\x10\x44\x65viceDriverEnum\x12\x1a\n\x16\x44\x45VICEDRIVER_UNDEFINED\x10\x00\x12\x1b\n\x17\x44\x45VICEDRIVER_OPENCONFIG\x10\x01\x12\x1e\n\x1a\x44\x45VICEDRIVER_TRANSPORT_API\x10\x02\x12\x13\n\x0f\x44\x45VICEDRIVER_P4\x10\x03\x12&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOGY\x10\x04\x12\x1b\n\x17\x44\x45VICEDRIVER_ONF_TR_352\x10\x05*\x8f\x01\n\x1b\x44\x65viceOperationalStatusEnum\x12%\n!DEVICEOPERATIONALSTATUS_UNDEFINED\x10\x00\x12$\n DEVICEOPERATIONALSTATUS_DISABLED\x10\x01\x12#\n\x1f\x44\x45VICEOPERATIONALSTATUS_ENABLED\x10\x02*\x81\x01\n\x0fServiceTypeEnum\x12\x17\n\x13SERVICETYPE_UNKNOWN\x10\x00\x12\x14\n\x10SERVICETYPE_L3NM\x10\x01\x12\x14\n\x10SERVICETYPE_L2NM\x10\x02\x12)\n%SERVICETYPE_TAPI_CONNECTIVITY_SERVICE\x10\x03*\x88\x01\n\x11ServiceStatusEnum\x12\x1b\n\x17SERVICESTATUS_UNDEFINED\x10\x00\x12\x19\n\x15SERVICESTATUS_PLANNED\x10\x01\x12\x18\n\x14SERVICESTATUS_ACTIVE\x10\x02\x12!\n\x1dSERVICESTATUS_PENDING_REMOVAL\x10\x03*]\n\x10\x43onfigActionEnum\x12\x1a\n\x16\x43ONFIGACTION_UNDEFINED\x10\x00\x12\x14\n\x10\x43ONFIGACTION_SET\x10\x01\x12\x17\n\x13\x43ONFIGACTION_DELETE\x10\x02\x32\xad\x10\n\x0e\x43ontextService\x12:\n\x0eListContextIds\x12\x0e.context.Empty\x1a\x16.context.ContextIdList\"\x00\x12\x36\n\x0cListContexts\x12\x0e.context.Empty\x1a\x14.context.ContextList\"\x00\x12\x34\n\nGetContext\x12\x12.context.ContextId\x1a\x10.context.Context\"\x00\x12\x34\n\nSetContext\x12\x10.context.Context\x1a\x12.context.ContextId\"\x00\x12\x35\n\rRemoveContext\x12\x12.context.ContextId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetContextEvents\x12\x0e.context.Empty\x1a\x15.context.ContextEvent\"\x00\x30\x01\x12@\n\x0fListTopologyIds\x12\x12.context.ContextId\x1a\x17.context.TopologyIdList\"\x00\x12=\n\x0eListTopologies\x12\x12.context.ContextId\x1a\x15.context.TopologyList\"\x00\x12\x37\n\x0bGetTopology\x12\x13.context.TopologyId\x1a\x11.context.Topology\"\x00\x12\x37\n\x0bSetTopology\x12\x11.context.Topology\x1a\x13.context.TopologyId\"\x00\x12\x37\n\x0eRemoveTopology\x12\x13.context.TopologyId\x1a\x0e.context.Empty\"\x00\x12?\n\x11GetTopologyEvents\x12\x0e.context.Empty\x1a\x16.context.TopologyEvent\"\x00\x30\x01\x12\x38\n\rListDeviceIds\x12\x0e.context.Empty\x1a\x15.context.DeviceIdList\"\x00\x12\x34\n\x0bListDevices\x12\x0e.context.Empty\x1a\x13.context.DeviceList\"\x00\x12\x31\n\tGetDevice\x12\x11.context.DeviceId\x1a\x0f.context.Device\"\x00\x12\x31\n\tSetDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0cRemoveDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x12;\n\x0fGetDeviceEvents\x12\x0e.context.Empty\x1a\x14.context.DeviceEvent\"\x00\x30\x01\x12\x34\n\x0bListLinkIds\x12\x0e.context.Empty\x1a\x13.context.LinkIdList\"\x00\x12\x30\n\tListLinks\x12\x0e.context.Empty\x1a\x11.context.LinkList\"\x00\x12+\n\x07GetLink\x12\x0f.context.LinkId\x1a\r.context.Link\"\x00\x12+\n\x07SetLink\x12\r.context.Link\x1a\x0f.context.LinkId\"\x00\x12/\n\nRemoveLink\x12\x0f.context.LinkId\x1a\x0e.context.Empty\"\x00\x12\x37\n\rGetLinkEvents\x12\x0e.context.Empty\x1a\x12.context.LinkEvent\"\x00\x30\x01\x12>\n\x0eListServiceIds\x12\x12.context.ContextId\x1a\x16.context.ServiceIdList\"\x00\x12:\n\x0cListServices\x12\x12.context.ContextId\x1a\x14.context.ServiceList\"\x00\x12\x34\n\nGetService\x12\x12.context.ServiceId\x1a\x10.context.Service\"\x00\x12\x34\n\nSetService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rRemoveService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetServiceEvents\x12\x0e.context.Empty\x1a\x15.context.ServiceEvent\"\x00\x30\x01\x12\x44\n\x11ListConnectionIds\x12\x12.context.ServiceId\x1a\x19.context.ConnectionIdList\"\x00\x12@\n\x0fListConnections\x12\x12.context.ServiceId\x1a\x17.context.ConnectionList\"\x00\x12=\n\rGetConnection\x12\x15.context.ConnectionId\x1a\x13.context.Connection\"\x00\x12=\n\rSetConnection\x12\x13.context.Connection\x1a\x15.context.ConnectionId\"\x00\x12;\n\x10RemoveConnection\x12\x15.context.ConnectionId\x1a\x0e.context.Empty\"\x00\x12\x43\n\x13GetConnectionEvents\x12\x0e.context.Empty\x1a\x18.context.ConnectionEvent\"\x00\x30\x01\x62\x06proto3' + serialized_pb=b'\n\rcontext.proto\x12\x07\x63ontext\x1a\x16kpi_sample_types.proto\"\x07\n\x05\x45mpty\"\x14\n\x04Uuid\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"F\n\x05\x45vent\x12\x11\n\ttimestamp\x18\x01 \x01(\x01\x12*\n\nevent_type\x18\x02 \x01(\x0e\x32\x16.context.EventTypeEnum\"0\n\tContextId\x12#\n\x0c\x63ontext_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xb6\x01\n\x07\x43ontext\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12)\n\x0ctopology_ids\x18\x02 \x03(\x0b\x32\x13.context.TopologyId\x12\'\n\x0bservice_ids\x18\x03 \x03(\x0b\x32\x12.context.ServiceId\x12/\n\ncontroller\x18\x04 \x01(\x0b\x32\x1b.context.TeraFlowController\"8\n\rContextIdList\x12\'\n\x0b\x63ontext_ids\x18\x01 \x03(\x0b\x32\x12.context.ContextId\"1\n\x0b\x43ontextList\x12\"\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32\x10.context.Context\"U\n\x0c\x43ontextEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\ncontext_id\x18\x02 \x01(\x0b\x32\x12.context.ContextId\"Z\n\nTopologyId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12$\n\rtopology_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"~\n\x08Topology\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12%\n\ndevice_ids\x18\x02 \x03(\x0b\x32\x11.context.DeviceId\x12!\n\x08link_ids\x18\x03 \x03(\x0b\x32\x0f.context.LinkId\";\n\x0eTopologyIdList\x12)\n\x0ctopology_ids\x18\x01 \x03(\x0b\x32\x13.context.TopologyId\"5\n\x0cTopologyList\x12%\n\ntopologies\x18\x01 \x03(\x0b\x32\x11.context.Topology\"X\n\rTopologyEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12(\n\x0btopology_id\x18\x02 \x01(\x0b\x32\x13.context.TopologyId\".\n\x08\x44\x65viceId\x12\"\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x9a\x02\n\x06\x44\x65vice\x12$\n\tdevice_id\x18\x01 \x01(\x0b\x32\x11.context.DeviceId\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12,\n\rdevice_config\x18\x03 \x01(\x0b\x32\x15.context.DeviceConfig\x12G\n\x19\x64\x65vice_operational_status\x18\x04 \x01(\x0e\x32$.context.DeviceOperationalStatusEnum\x12\x31\n\x0e\x64\x65vice_drivers\x18\x05 \x03(\x0e\x32\x19.context.DeviceDriverEnum\x12+\n\x10\x64\x65vice_endpoints\x18\x06 \x03(\x0b\x32\x11.context.EndPoint\"9\n\x0c\x44\x65viceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"5\n\x0c\x44\x65viceIdList\x12%\n\ndevice_ids\x18\x01 \x03(\x0b\x32\x11.context.DeviceId\".\n\nDeviceList\x12 \n\x07\x64\x65vices\x18\x01 \x03(\x0b\x32\x0f.context.Device\"R\n\x0b\x44\x65viceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"*\n\x06LinkId\x12 \n\tlink_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"X\n\x04Link\x12 \n\x07link_id\x18\x01 \x01(\x0b\x32\x0f.context.LinkId\x12.\n\x11link_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\"/\n\nLinkIdList\x12!\n\x08link_ids\x18\x01 \x03(\x0b\x32\x0f.context.LinkId\"(\n\x08LinkList\x12\x1c\n\x05links\x18\x01 \x03(\x0b\x32\r.context.Link\"L\n\tLinkEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12 \n\x07link_id\x18\x02 \x01(\x0b\x32\x0f.context.LinkId\"X\n\tServiceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12#\n\x0cservice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\xa6\x02\n\x07Service\x12&\n\nservice_id\x18\x01 \x01(\x0b\x32\x12.context.ServiceId\x12.\n\x0cservice_type\x18\x02 \x01(\x0e\x32\x18.context.ServiceTypeEnum\x12\x31\n\x14service_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12\x30\n\x13service_constraints\x18\x04 \x03(\x0b\x32\x13.context.Constraint\x12.\n\x0eservice_status\x18\x05 \x01(\x0b\x32\x16.context.ServiceStatus\x12.\n\x0eservice_config\x18\x06 \x01(\x0b\x32\x16.context.ServiceConfig\"C\n\rServiceStatus\x12\x32\n\x0eservice_status\x18\x01 \x01(\x0e\x32\x1a.context.ServiceStatusEnum\":\n\rServiceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"8\n\rServiceIdList\x12\'\n\x0bservice_ids\x18\x01 \x03(\x0b\x32\x12.context.ServiceId\"1\n\x0bServiceList\x12\"\n\x08services\x18\x01 \x03(\x0b\x32\x10.context.Service\"U\n\x0cServiceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\"T\n\x07SliceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12!\n\nslice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\x95\x02\n\x05Slice\x12\"\n\x08slice_id\x18\x01 \x01(\x0b\x32\x10.context.SliceId\x12/\n\x12slice_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\x12.\n\x11slice_constraints\x18\x03 \x03(\x0b\x32\x13.context.Constraint\x12-\n\x11slice_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\x12,\n\x12slice_subslice_ids\x18\x05 \x03(\x0b\x32\x10.context.SliceId\x12*\n\x0cslice_status\x18\x06 \x01(\x0b\x32\x14.context.SliceStatus\"=\n\x0bSliceStatus\x12.\n\x0cslice_status\x18\x01 \x01(\x0e\x32\x18.context.SliceStatusEnum\"2\n\x0bSliceIdList\x12#\n\tslice_ids\x18\x01 \x03(\x0b\x32\x10.context.SliceId\"+\n\tSliceList\x12\x1e\n\x06slices\x18\x01 \x03(\x0b\x32\x0e.context.Slice\"O\n\nSliceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12\"\n\x08slice_id\x18\x02 \x01(\x0b\x32\x10.context.SliceId\"6\n\x0c\x43onnectionId\x12&\n\x0f\x63onnection_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xc4\x01\n\nConnection\x12,\n\rconnection_id\x18\x01 \x01(\x0b\x32\x15.context.ConnectionId\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\x12\x33\n\x16path_hops_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12+\n\x0fsub_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\"A\n\x10\x43onnectionIdList\x12-\n\x0e\x63onnection_ids\x18\x01 \x03(\x0b\x32\x15.context.ConnectionId\":\n\x0e\x43onnectionList\x12(\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x13.context.Connection\"^\n\x0f\x43onnectionEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12,\n\rconnection_id\x18\x02 \x01(\x0b\x32\x15.context.ConnectionId\"\x82\x01\n\nEndPointId\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\x12$\n\rendpoint_uuid\x18\x03 \x01(\x0b\x32\r.context.Uuid\"\x86\x01\n\x08\x45ndPoint\x12(\n\x0b\x65ndpoint_id\x18\x01 \x01(\x0b\x32\x13.context.EndPointId\x12\x15\n\rendpoint_type\x18\x02 \x01(\t\x12\x39\n\x10kpi_sample_types\x18\x03 \x03(\x0e\x32\x1f.kpi_sample_types.KpiSampleType\"e\n\nConfigRule\x12)\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x19.context.ConfigActionEnum\x12\x14\n\x0cresource_key\x18\x02 \x01(\t\x12\x16\n\x0eresource_value\x18\x03 \x01(\t\"?\n\nConstraint\x12\x17\n\x0f\x63onstraint_type\x18\x01 \x01(\t\x12\x18\n\x10\x63onstraint_value\x18\x02 \x01(\t\"^\n\x12TeraFlowController\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x12\n\nip_address\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\"U\n\x14\x41uthenticationResult\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x15\n\rauthenticated\x18\x02 \x01(\x08*j\n\rEventTypeEnum\x12\x17\n\x13\x45VENTTYPE_UNDEFINED\x10\x00\x12\x14\n\x10\x45VENTTYPE_CREATE\x10\x01\x12\x14\n\x10\x45VENTTYPE_UPDATE\x10\x02\x12\x14\n\x10\x45VENTTYPE_REMOVE\x10\x03*\xc5\x01\n\x10\x44\x65viceDriverEnum\x12\x1a\n\x16\x44\x45VICEDRIVER_UNDEFINED\x10\x00\x12\x1b\n\x17\x44\x45VICEDRIVER_OPENCONFIG\x10\x01\x12\x1e\n\x1a\x44\x45VICEDRIVER_TRANSPORT_API\x10\x02\x12\x13\n\x0f\x44\x45VICEDRIVER_P4\x10\x03\x12&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOGY\x10\x04\x12\x1b\n\x17\x44\x45VICEDRIVER_ONF_TR_352\x10\x05*\x8f\x01\n\x1b\x44\x65viceOperationalStatusEnum\x12%\n!DEVICEOPERATIONALSTATUS_UNDEFINED\x10\x00\x12$\n DEVICEOPERATIONALSTATUS_DISABLED\x10\x01\x12#\n\x1f\x44\x45VICEOPERATIONALSTATUS_ENABLED\x10\x02*\x81\x01\n\x0fServiceTypeEnum\x12\x17\n\x13SERVICETYPE_UNKNOWN\x10\x00\x12\x14\n\x10SERVICETYPE_L3NM\x10\x01\x12\x14\n\x10SERVICETYPE_L2NM\x10\x02\x12)\n%SERVICETYPE_TAPI_CONNECTIVITY_SERVICE\x10\x03*\x88\x01\n\x11ServiceStatusEnum\x12\x1b\n\x17SERVICESTATUS_UNDEFINED\x10\x00\x12\x19\n\x15SERVICESTATUS_PLANNED\x10\x01\x12\x18\n\x14SERVICESTATUS_ACTIVE\x10\x02\x12!\n\x1dSERVICESTATUS_PENDING_REMOVAL\x10\x03*\x8b\x01\n\x0fSliceStatusEnum\x12\x19\n\x15SLICESTATUS_UNDEFINED\x10\x00\x12\x17\n\x13SLICESTATUS_PLANNED\x10\x01\x12\x14\n\x10SLICESTATUS_INIT\x10\x02\x12\x16\n\x12SLICESTATUS_ACTIVE\x10\x03\x12\x16\n\x12SLICESTATUS_DEINIT\x10\x04*]\n\x10\x43onfigActionEnum\x12\x1a\n\x16\x43ONFIGACTION_UNDEFINED\x10\x00\x12\x14\n\x10\x43ONFIGACTION_SET\x10\x01\x12\x17\n\x13\x43ONFIGACTION_DELETE\x10\x02\x32\xef\x12\n\x0e\x43ontextService\x12:\n\x0eListContextIds\x12\x0e.context.Empty\x1a\x16.context.ContextIdList\"\x00\x12\x36\n\x0cListContexts\x12\x0e.context.Empty\x1a\x14.context.ContextList\"\x00\x12\x34\n\nGetContext\x12\x12.context.ContextId\x1a\x10.context.Context\"\x00\x12\x34\n\nSetContext\x12\x10.context.Context\x1a\x12.context.ContextId\"\x00\x12\x35\n\rRemoveContext\x12\x12.context.ContextId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetContextEvents\x12\x0e.context.Empty\x1a\x15.context.ContextEvent\"\x00\x30\x01\x12@\n\x0fListTopologyIds\x12\x12.context.ContextId\x1a\x17.context.TopologyIdList\"\x00\x12=\n\x0eListTopologies\x12\x12.context.ContextId\x1a\x15.context.TopologyList\"\x00\x12\x37\n\x0bGetTopology\x12\x13.context.TopologyId\x1a\x11.context.Topology\"\x00\x12\x37\n\x0bSetTopology\x12\x11.context.Topology\x1a\x13.context.TopologyId\"\x00\x12\x37\n\x0eRemoveTopology\x12\x13.context.TopologyId\x1a\x0e.context.Empty\"\x00\x12?\n\x11GetTopologyEvents\x12\x0e.context.Empty\x1a\x16.context.TopologyEvent\"\x00\x30\x01\x12\x38\n\rListDeviceIds\x12\x0e.context.Empty\x1a\x15.context.DeviceIdList\"\x00\x12\x34\n\x0bListDevices\x12\x0e.context.Empty\x1a\x13.context.DeviceList\"\x00\x12\x31\n\tGetDevice\x12\x11.context.DeviceId\x1a\x0f.context.Device\"\x00\x12\x31\n\tSetDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0cRemoveDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x12;\n\x0fGetDeviceEvents\x12\x0e.context.Empty\x1a\x14.context.DeviceEvent\"\x00\x30\x01\x12\x34\n\x0bListLinkIds\x12\x0e.context.Empty\x1a\x13.context.LinkIdList\"\x00\x12\x30\n\tListLinks\x12\x0e.context.Empty\x1a\x11.context.LinkList\"\x00\x12+\n\x07GetLink\x12\x0f.context.LinkId\x1a\r.context.Link\"\x00\x12+\n\x07SetLink\x12\r.context.Link\x1a\x0f.context.LinkId\"\x00\x12/\n\nRemoveLink\x12\x0f.context.LinkId\x1a\x0e.context.Empty\"\x00\x12\x37\n\rGetLinkEvents\x12\x0e.context.Empty\x1a\x12.context.LinkEvent\"\x00\x30\x01\x12>\n\x0eListServiceIds\x12\x12.context.ContextId\x1a\x16.context.ServiceIdList\"\x00\x12:\n\x0cListServices\x12\x12.context.ContextId\x1a\x14.context.ServiceList\"\x00\x12\x34\n\nGetService\x12\x12.context.ServiceId\x1a\x10.context.Service\"\x00\x12\x34\n\nSetService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rRemoveService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetServiceEvents\x12\x0e.context.Empty\x1a\x15.context.ServiceEvent\"\x00\x30\x01\x12:\n\x0cListSliceIds\x12\x12.context.ContextId\x1a\x14.context.SliceIdList\"\x00\x12\x36\n\nListSlices\x12\x12.context.ContextId\x1a\x12.context.SliceList\"\x00\x12.\n\x08GetSlice\x12\x10.context.SliceId\x1a\x0e.context.Slice\"\x00\x12.\n\x08SetSlice\x12\x0e.context.Slice\x1a\x10.context.SliceId\"\x00\x12\x31\n\x0bRemoveSlice\x12\x10.context.SliceId\x1a\x0e.context.Empty\"\x00\x12\x39\n\x0eGetSliceEvents\x12\x0e.context.Empty\x1a\x13.context.SliceEvent\"\x00\x30\x01\x12\x44\n\x11ListConnectionIds\x12\x12.context.ServiceId\x1a\x19.context.ConnectionIdList\"\x00\x12@\n\x0fListConnections\x12\x12.context.ServiceId\x1a\x17.context.ConnectionList\"\x00\x12=\n\rGetConnection\x12\x15.context.ConnectionId\x1a\x13.context.Connection\"\x00\x12=\n\rSetConnection\x12\x13.context.Connection\x1a\x15.context.ConnectionId\"\x00\x12;\n\x10RemoveConnection\x12\x15.context.ConnectionId\x1a\x0e.context.Empty\"\x00\x12\x43\n\x13GetConnectionEvents\x12\x0e.context.Empty\x1a\x18.context.ConnectionEvent\"\x00\x30\x01\x62\x06proto3' , dependencies=[kpi__sample__types__pb2.DESCRIPTOR,]) @@ -55,8 +55,8 @@ _EVENTTYPEENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=3703, - serialized_end=3809, + serialized_start=4310, + serialized_end=4416, ) _sym_db.RegisterEnumDescriptor(_EVENTTYPEENUM) @@ -101,8 +101,8 @@ _DEVICEDRIVERENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=3812, - serialized_end=4009, + serialized_start=4419, + serialized_end=4616, ) _sym_db.RegisterEnumDescriptor(_DEVICEDRIVERENUM) @@ -132,8 +132,8 @@ _DEVICEOPERATIONALSTATUSENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4012, - serialized_end=4155, + serialized_start=4619, + serialized_end=4762, ) _sym_db.RegisterEnumDescriptor(_DEVICEOPERATIONALSTATUSENUM) @@ -168,8 +168,8 @@ _SERVICETYPEENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4158, - serialized_end=4287, + serialized_start=4765, + serialized_end=4894, ) _sym_db.RegisterEnumDescriptor(_SERVICETYPEENUM) @@ -204,12 +204,53 @@ _SERVICESTATUSENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4290, - serialized_end=4426, + serialized_start=4897, + serialized_end=5033, ) _sym_db.RegisterEnumDescriptor(_SERVICESTATUSENUM) ServiceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICESTATUSENUM) +_SLICESTATUSENUM = _descriptor.EnumDescriptor( + name='SliceStatusEnum', + full_name='context.SliceStatusEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_PLANNED', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_INIT', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_ACTIVE', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_DEINIT', index=4, number=4, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=5036, + serialized_end=5175, +) +_sym_db.RegisterEnumDescriptor(_SLICESTATUSENUM) + +SliceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SLICESTATUSENUM) _CONFIGACTIONENUM = _descriptor.EnumDescriptor( name='ConfigActionEnum', full_name='context.ConfigActionEnum', @@ -235,8 +276,8 @@ _CONFIGACTIONENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4428, - serialized_end=4521, + serialized_start=5177, + serialized_end=5270, ) _sym_db.RegisterEnumDescriptor(_CONFIGACTIONENUM) @@ -262,6 +303,11 @@ SERVICESTATUS_UNDEFINED = 0 SERVICESTATUS_PLANNED = 1 SERVICESTATUS_ACTIVE = 2 SERVICESTATUS_PENDING_REMOVAL = 3 +SLICESTATUS_UNDEFINED = 0 +SLICESTATUS_PLANNED = 1 +SLICESTATUS_INIT = 2 +SLICESTATUS_ACTIVE = 3 +SLICESTATUS_DEINIT = 4 CONFIGACTION_UNDEFINED = 0 CONFIGACTION_SET = 1 CONFIGACTION_DELETE = 2 @@ -1421,6 +1467,247 @@ _SERVICEEVENT = _descriptor.Descriptor( ) +_SLICEID = _descriptor.Descriptor( + name='SliceId', + full_name='context.SliceId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_id', full_name='context.SliceId.context_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_uuid', full_name='context.SliceId.slice_uuid', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2604, + serialized_end=2688, +) + + +_SLICE = _descriptor.Descriptor( + name='Slice', + full_name='context.Slice', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_id', full_name='context.Slice.slice_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_endpoint_ids', full_name='context.Slice.slice_endpoint_ids', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_constraints', full_name='context.Slice.slice_constraints', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_service_ids', full_name='context.Slice.slice_service_ids', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_subslice_ids', full_name='context.Slice.slice_subslice_ids', index=4, + number=5, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_status', full_name='context.Slice.slice_status', index=5, + number=6, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2691, + serialized_end=2968, +) + + +_SLICESTATUS = _descriptor.Descriptor( + name='SliceStatus', + full_name='context.SliceStatus', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_status', full_name='context.SliceStatus.slice_status', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2970, + serialized_end=3031, +) + + +_SLICEIDLIST = _descriptor.Descriptor( + name='SliceIdList', + full_name='context.SliceIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_ids', full_name='context.SliceIdList.slice_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3033, + serialized_end=3083, +) + + +_SLICELIST = _descriptor.Descriptor( + name='SliceList', + full_name='context.SliceList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slices', full_name='context.SliceList.slices', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3085, + serialized_end=3128, +) + + +_SLICEEVENT = _descriptor.Descriptor( + name='SliceEvent', + full_name='context.SliceEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.SliceEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_id', full_name='context.SliceEvent.slice_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3130, + serialized_end=3209, +) + + _CONNECTIONID = _descriptor.Descriptor( name='ConnectionId', full_name='context.ConnectionId', @@ -1448,8 +1735,8 @@ _CONNECTIONID = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2604, - serialized_end=2658, + serialized_start=3211, + serialized_end=3265, ) @@ -1501,8 +1788,8 @@ _CONNECTION = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2661, - serialized_end=2857, + serialized_start=3268, + serialized_end=3464, ) @@ -1533,8 +1820,8 @@ _CONNECTIONIDLIST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2859, - serialized_end=2924, + serialized_start=3466, + serialized_end=3531, ) @@ -1565,8 +1852,8 @@ _CONNECTIONLIST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2926, - serialized_end=2984, + serialized_start=3533, + serialized_end=3591, ) @@ -1604,8 +1891,8 @@ _CONNECTIONEVENT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2986, - serialized_end=3080, + serialized_start=3593, + serialized_end=3687, ) @@ -1650,8 +1937,8 @@ _ENDPOINTID = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3083, - serialized_end=3213, + serialized_start=3690, + serialized_end=3820, ) @@ -1696,8 +1983,8 @@ _ENDPOINT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3216, - serialized_end=3350, + serialized_start=3823, + serialized_end=3957, ) @@ -1742,8 +2029,8 @@ _CONFIGRULE = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3352, - serialized_end=3453, + serialized_start=3959, + serialized_end=4060, ) @@ -1781,8 +2068,8 @@ _CONSTRAINT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3455, - serialized_end=3518, + serialized_start=4062, + serialized_end=4125, ) @@ -1827,8 +2114,8 @@ _TERAFLOWCONTROLLER = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3520, - serialized_end=3614, + serialized_start=4127, + serialized_end=4221, ) @@ -1866,8 +2153,8 @@ _AUTHENTICATIONRESULT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3616, - serialized_end=3701, + serialized_start=4223, + serialized_end=4308, ) _EVENT.fields_by_name['event_type'].enum_type = _EVENTTYPEENUM @@ -1921,6 +2208,19 @@ _SERVICEIDLIST.fields_by_name['service_ids'].message_type = _SERVICEID _SERVICELIST.fields_by_name['services'].message_type = _SERVICE _SERVICEEVENT.fields_by_name['event'].message_type = _EVENT _SERVICEEVENT.fields_by_name['service_id'].message_type = _SERVICEID +_SLICEID.fields_by_name['context_id'].message_type = _CONTEXTID +_SLICEID.fields_by_name['slice_uuid'].message_type = _UUID +_SLICE.fields_by_name['slice_id'].message_type = _SLICEID +_SLICE.fields_by_name['slice_endpoint_ids'].message_type = _ENDPOINTID +_SLICE.fields_by_name['slice_constraints'].message_type = _CONSTRAINT +_SLICE.fields_by_name['slice_service_ids'].message_type = _SERVICEID +_SLICE.fields_by_name['slice_subslice_ids'].message_type = _SLICEID +_SLICE.fields_by_name['slice_status'].message_type = _SLICESTATUS +_SLICESTATUS.fields_by_name['slice_status'].enum_type = _SLICESTATUSENUM +_SLICEIDLIST.fields_by_name['slice_ids'].message_type = _SLICEID +_SLICELIST.fields_by_name['slices'].message_type = _SLICE +_SLICEEVENT.fields_by_name['event'].message_type = _EVENT +_SLICEEVENT.fields_by_name['slice_id'].message_type = _SLICEID _CONNECTIONID.fields_by_name['connection_uuid'].message_type = _UUID _CONNECTION.fields_by_name['connection_id'].message_type = _CONNECTIONID _CONNECTION.fields_by_name['service_id'].message_type = _SERVICEID @@ -1969,6 +2269,12 @@ DESCRIPTOR.message_types_by_name['ServiceConfig'] = _SERVICECONFIG DESCRIPTOR.message_types_by_name['ServiceIdList'] = _SERVICEIDLIST DESCRIPTOR.message_types_by_name['ServiceList'] = _SERVICELIST DESCRIPTOR.message_types_by_name['ServiceEvent'] = _SERVICEEVENT +DESCRIPTOR.message_types_by_name['SliceId'] = _SLICEID +DESCRIPTOR.message_types_by_name['Slice'] = _SLICE +DESCRIPTOR.message_types_by_name['SliceStatus'] = _SLICESTATUS +DESCRIPTOR.message_types_by_name['SliceIdList'] = _SLICEIDLIST +DESCRIPTOR.message_types_by_name['SliceList'] = _SLICELIST +DESCRIPTOR.message_types_by_name['SliceEvent'] = _SLICEEVENT DESCRIPTOR.message_types_by_name['ConnectionId'] = _CONNECTIONID DESCRIPTOR.message_types_by_name['Connection'] = _CONNECTION DESCRIPTOR.message_types_by_name['ConnectionIdList'] = _CONNECTIONIDLIST @@ -1985,6 +2291,7 @@ DESCRIPTOR.enum_types_by_name['DeviceDriverEnum'] = _DEVICEDRIVERENUM DESCRIPTOR.enum_types_by_name['DeviceOperationalStatusEnum'] = _DEVICEOPERATIONALSTATUSENUM DESCRIPTOR.enum_types_by_name['ServiceTypeEnum'] = _SERVICETYPEENUM DESCRIPTOR.enum_types_by_name['ServiceStatusEnum'] = _SERVICESTATUSENUM +DESCRIPTOR.enum_types_by_name['SliceStatusEnum'] = _SLICESTATUSENUM DESCRIPTOR.enum_types_by_name['ConfigActionEnum'] = _CONFIGACTIONENUM _sym_db.RegisterFileDescriptor(DESCRIPTOR) @@ -2205,6 +2512,48 @@ ServiceEvent = _reflection.GeneratedProtocolMessageType('ServiceEvent', (_messag }) _sym_db.RegisterMessage(ServiceEvent) +SliceId = _reflection.GeneratedProtocolMessageType('SliceId', (_message.Message,), { + 'DESCRIPTOR' : _SLICEID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceId) + }) +_sym_db.RegisterMessage(SliceId) + +Slice = _reflection.GeneratedProtocolMessageType('Slice', (_message.Message,), { + 'DESCRIPTOR' : _SLICE, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Slice) + }) +_sym_db.RegisterMessage(Slice) + +SliceStatus = _reflection.GeneratedProtocolMessageType('SliceStatus', (_message.Message,), { + 'DESCRIPTOR' : _SLICESTATUS, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceStatus) + }) +_sym_db.RegisterMessage(SliceStatus) + +SliceIdList = _reflection.GeneratedProtocolMessageType('SliceIdList', (_message.Message,), { + 'DESCRIPTOR' : _SLICEIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceIdList) + }) +_sym_db.RegisterMessage(SliceIdList) + +SliceList = _reflection.GeneratedProtocolMessageType('SliceList', (_message.Message,), { + 'DESCRIPTOR' : _SLICELIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceList) + }) +_sym_db.RegisterMessage(SliceList) + +SliceEvent = _reflection.GeneratedProtocolMessageType('SliceEvent', (_message.Message,), { + 'DESCRIPTOR' : _SLICEEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceEvent) + }) +_sym_db.RegisterMessage(SliceEvent) + ConnectionId = _reflection.GeneratedProtocolMessageType('ConnectionId', (_message.Message,), { 'DESCRIPTOR' : _CONNECTIONID, '__module__' : 'context_pb2' @@ -2291,8 +2640,8 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( index=0, serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_start=4524, - serialized_end=6617, + serialized_start=5273, + serialized_end=7688, methods=[ _descriptor.MethodDescriptor( name='ListContextIds', @@ -2594,10 +2943,70 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( serialized_options=None, create_key=_descriptor._internal_create_key, ), + _descriptor.MethodDescriptor( + name='ListSliceIds', + full_name='context.ContextService.ListSliceIds', + index=30, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SLICEIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListSlices', + full_name='context.ContextService.ListSlices', + index=31, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SLICELIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetSlice', + full_name='context.ContextService.GetSlice', + index=32, + containing_service=None, + input_type=_SLICEID, + output_type=_SLICE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetSlice', + full_name='context.ContextService.SetSlice', + index=33, + containing_service=None, + input_type=_SLICE, + output_type=_SLICEID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveSlice', + full_name='context.ContextService.RemoveSlice', + index=34, + containing_service=None, + input_type=_SLICEID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetSliceEvents', + full_name='context.ContextService.GetSliceEvents', + index=35, + containing_service=None, + input_type=_EMPTY, + output_type=_SLICEEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), _descriptor.MethodDescriptor( name='ListConnectionIds', full_name='context.ContextService.ListConnectionIds', - index=30, + index=36, containing_service=None, input_type=_SERVICEID, output_type=_CONNECTIONIDLIST, @@ -2607,7 +3016,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='ListConnections', full_name='context.ContextService.ListConnections', - index=31, + index=37, containing_service=None, input_type=_SERVICEID, output_type=_CONNECTIONLIST, @@ -2617,7 +3026,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='GetConnection', full_name='context.ContextService.GetConnection', - index=32, + index=38, containing_service=None, input_type=_CONNECTIONID, output_type=_CONNECTION, @@ -2627,7 +3036,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='SetConnection', full_name='context.ContextService.SetConnection', - index=33, + index=39, containing_service=None, input_type=_CONNECTION, output_type=_CONNECTIONID, @@ -2637,7 +3046,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='RemoveConnection', full_name='context.ContextService.RemoveConnection', - index=34, + index=40, containing_service=None, input_type=_CONNECTIONID, output_type=_EMPTY, @@ -2647,7 +3056,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='GetConnectionEvents', full_name='context.ContextService.GetConnectionEvents', - index=35, + index=41, containing_service=None, input_type=_EMPTY, output_type=_CONNECTIONEVENT, diff --git a/src/context/proto/context_pb2_grpc.py b/src/context/proto/context_pb2_grpc.py index 14397184e3a46f0f8be7fd9bf3fb7210520afe74..8b30e91f318cc3113dd098803037a3b2871af9e2 100644 --- a/src/context/proto/context_pb2_grpc.py +++ b/src/context/proto/context_pb2_grpc.py @@ -164,6 +164,36 @@ class ContextServiceStub(object): request_serializer=context__pb2.Empty.SerializeToString, response_deserializer=context__pb2.ServiceEvent.FromString, ) + self.ListSliceIds = channel.unary_unary( + '/context.ContextService/ListSliceIds', + request_serializer=context__pb2.ContextId.SerializeToString, + response_deserializer=context__pb2.SliceIdList.FromString, + ) + self.ListSlices = channel.unary_unary( + '/context.ContextService/ListSlices', + request_serializer=context__pb2.ContextId.SerializeToString, + response_deserializer=context__pb2.SliceList.FromString, + ) + self.GetSlice = channel.unary_unary( + '/context.ContextService/GetSlice', + request_serializer=context__pb2.SliceId.SerializeToString, + response_deserializer=context__pb2.Slice.FromString, + ) + self.SetSlice = channel.unary_unary( + '/context.ContextService/SetSlice', + request_serializer=context__pb2.Slice.SerializeToString, + response_deserializer=context__pb2.SliceId.FromString, + ) + self.RemoveSlice = channel.unary_unary( + '/context.ContextService/RemoveSlice', + request_serializer=context__pb2.SliceId.SerializeToString, + response_deserializer=context__pb2.Empty.FromString, + ) + self.GetSliceEvents = channel.unary_stream( + '/context.ContextService/GetSliceEvents', + request_serializer=context__pb2.Empty.SerializeToString, + response_deserializer=context__pb2.SliceEvent.FromString, + ) self.ListConnectionIds = channel.unary_unary( '/context.ContextService/ListConnectionIds', request_serializer=context__pb2.ServiceId.SerializeToString, @@ -379,6 +409,42 @@ class ContextServiceServicer(object): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def ListSliceIds(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ListSlices(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetSlice(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def SetSlice(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def RemoveSlice(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetSliceEvents(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def ListConnectionIds(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) @@ -568,6 +634,36 @@ def add_ContextServiceServicer_to_server(servicer, server): request_deserializer=context__pb2.Empty.FromString, response_serializer=context__pb2.ServiceEvent.SerializeToString, ), + 'ListSliceIds': grpc.unary_unary_rpc_method_handler( + servicer.ListSliceIds, + request_deserializer=context__pb2.ContextId.FromString, + response_serializer=context__pb2.SliceIdList.SerializeToString, + ), + 'ListSlices': grpc.unary_unary_rpc_method_handler( + servicer.ListSlices, + request_deserializer=context__pb2.ContextId.FromString, + response_serializer=context__pb2.SliceList.SerializeToString, + ), + 'GetSlice': grpc.unary_unary_rpc_method_handler( + servicer.GetSlice, + request_deserializer=context__pb2.SliceId.FromString, + response_serializer=context__pb2.Slice.SerializeToString, + ), + 'SetSlice': grpc.unary_unary_rpc_method_handler( + servicer.SetSlice, + request_deserializer=context__pb2.Slice.FromString, + response_serializer=context__pb2.SliceId.SerializeToString, + ), + 'RemoveSlice': grpc.unary_unary_rpc_method_handler( + servicer.RemoveSlice, + request_deserializer=context__pb2.SliceId.FromString, + response_serializer=context__pb2.Empty.SerializeToString, + ), + 'GetSliceEvents': grpc.unary_stream_rpc_method_handler( + servicer.GetSliceEvents, + request_deserializer=context__pb2.Empty.FromString, + response_serializer=context__pb2.SliceEvent.SerializeToString, + ), 'ListConnectionIds': grpc.unary_unary_rpc_method_handler( servicer.ListConnectionIds, request_deserializer=context__pb2.ServiceId.FromString, @@ -1118,6 +1214,108 @@ class ContextService(object): options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + @staticmethod + def ListSliceIds(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/context.ContextService/ListSliceIds', + context__pb2.ContextId.SerializeToString, + context__pb2.SliceIdList.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def ListSlices(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/context.ContextService/ListSlices', + context__pb2.ContextId.SerializeToString, + context__pb2.SliceList.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def GetSlice(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/context.ContextService/GetSlice', + context__pb2.SliceId.SerializeToString, + context__pb2.Slice.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def SetSlice(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/context.ContextService/SetSlice', + context__pb2.Slice.SerializeToString, + context__pb2.SliceId.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def RemoveSlice(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/context.ContextService/RemoveSlice', + context__pb2.SliceId.SerializeToString, + context__pb2.Empty.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def GetSliceEvents(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_stream(request, target, '/context.ContextService/GetSliceEvents', + context__pb2.Empty.SerializeToString, + context__pb2.SliceEvent.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + @staticmethod def ListConnectionIds(request, target, diff --git a/src/context/service/Populate.py b/src/context/service/Populate.py index f4630182d864a891095caa6689dde9f656ea1c0e..ace630900d82fc36a82d290f12e466018dc82587 100644 --- a/src/context/service/Populate.py +++ b/src/context/service/Populate.py @@ -20,8 +20,8 @@ from context.tests.Objects import ( LINK_R1_R2, LINK_R1_R2_ID, LINK_R1_R3, LINK_R1_R3_ID, LINK_R2_R3, LINK_R2_R3_ID, SERVICE_R1_R2, SERVICE_R1_R3, SERVICE_R2_R3) -def populate(address, port): - client = ContextClient(address=address, port=port) +def populate(host=None, port=None): + client = ContextClient(host=host, port=port) client.SetContext(Context(**CONTEXT)) client.SetTopology(Topology(**TOPOLOGY)) diff --git a/src/context/service/__main__.py b/src/context/service/__main__.py index 180a1f44cb6a37b487e6bce0a13706952ff73bc2..53754caf4f9d2621ed8a6fdfd325d42f77f44a4f 100644 --- a/src/context/service/__main__.py +++ b/src/context/service/__main__.py @@ -14,17 +14,15 @@ import logging, signal, sys, threading from prometheus_client import start_http_server -from common.Settings import get_setting +from common.Settings import get_log_level, get_metrics_port, get_setting from common.orm.Database import Database from common.orm.Factory import get_database_backend from common.message_broker.Factory import get_messagebroker_backend from common.message_broker.MessageBroker import MessageBroker -from context.Config import ( - GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD, LOG_LEVEL, POPULATE_FAKE_DATA, RESTAPI_SERVICE_PORT, - RESTAPI_BASE_URL, METRICS_PORT) +from context.Config import POPULATE_FAKE_DATA from .grpc_server.ContextService import ContextService from .rest_server.Resources import RESOURCES -from .rest_server.Server import Server +from .rest_server.RestServer import RestServer from .Populate import populate terminate = threading.Event() @@ -37,16 +35,7 @@ def signal_handler(signal, frame): # pylint: disable=redefined-outer-name def main(): global LOGGER # pylint: disable=global-statement - grpc_service_port = get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC', default=GRPC_SERVICE_PORT ) - max_workers = get_setting('MAX_WORKERS', default=GRPC_MAX_WORKERS ) - grace_period = get_setting('GRACE_PERIOD', default=GRPC_GRACE_PERIOD ) - log_level = get_setting('LOG_LEVEL', default=LOG_LEVEL ) - restapi_service_port = get_setting('CONTEXTSERVICE_SERVICE_PORT_HTTP', default=RESTAPI_SERVICE_PORT) - restapi_base_url = get_setting('RESTAPI_BASE_URL', default=RESTAPI_BASE_URL ) - metrics_port = get_setting('METRICS_PORT', default=METRICS_PORT ) - populate_fake_data = get_setting('POPULATE_FAKE_DATA', default=POPULATE_FAKE_DATA ) - if isinstance(populate_fake_data, str): populate_fake_data = (populate_fake_data.upper() in {'T', '1', 'TRUE'}) - + log_level = get_log_level() logging.basicConfig(level=log_level) LOGGER = logging.getLogger(__name__) @@ -56,6 +45,7 @@ def main(): LOGGER.info('Starting...') # Start metrics server + metrics_port = get_metrics_port() start_http_server(metrics_port) # Get database instance @@ -65,18 +55,19 @@ def main(): messagebroker = MessageBroker(get_messagebroker_backend()) # Starting context service - grpc_service = ContextService( - database, messagebroker, port=grpc_service_port, max_workers=max_workers, grace_period=grace_period) + grpc_service = ContextService(database, messagebroker) grpc_service.start() - rest_server = Server(port=restapi_service_port, base_url=restapi_base_url) + rest_server = RestServer() for endpoint_name, resource_class, resource_url in RESOURCES: rest_server.add_resource(resource_class, resource_url, endpoint=endpoint_name, resource_class_args=(database,)) rest_server.start() + populate_fake_data = get_setting('POPULATE_FAKE_DATA', default=POPULATE_FAKE_DATA) + if isinstance(populate_fake_data, str): populate_fake_data = (populate_fake_data.upper() in {'T', '1', 'TRUE'}) if populate_fake_data: LOGGER.info('Populating fake data...') - populate('127.0.0.1', grpc_service_port) + populate(host='127.0.0.1', port=grpc_service.bind_port) LOGGER.info('Fake Data populated') # Wait for Ctrl+C or termination signal diff --git a/src/context/service/database/RelationModels.py b/src/context/service/database/RelationModels.py index 20e0fc4501f5c81ef4d600dde5067ee5a5f26331..98b077a774616f69f4ae6a620e53a1592bb4f6e2 100644 --- a/src/context/service/database/RelationModels.py +++ b/src/context/service/database/RelationModels.py @@ -21,6 +21,7 @@ from .DeviceModel import DeviceModel from .EndPointModel import EndPointModel from .LinkModel import LinkModel from .ServiceModel import ServiceModel +from .SliceModel import SliceModel from .TopologyModel import TopologyModel LOGGER = logging.getLogger(__name__) @@ -40,6 +41,21 @@ class ServiceEndPointModel(Model): # pylint: disable=abstract-method service_fk = ForeignKeyField(ServiceModel) endpoint_fk = ForeignKeyField(EndPointModel) +class SliceEndPointModel(Model): # pylint: disable=abstract-method + pk = PrimaryKeyField() + slice_fk = ForeignKeyField(SliceModel) + endpoint_fk = ForeignKeyField(EndPointModel) + +class SliceServiceModel(Model): # pylint: disable=abstract-method + pk = PrimaryKeyField() + slice_fk = ForeignKeyField(SliceModel) + service_fk = ForeignKeyField(ServiceModel) + +class SliceSubSliceModel(Model): # pylint: disable=abstract-method + pk = PrimaryKeyField() + slice_fk = ForeignKeyField(SliceModel) + sub_slice_fk = ForeignKeyField(SliceModel) + class TopologyDeviceModel(Model): # pylint: disable=abstract-method pk = PrimaryKeyField() topology_fk = ForeignKeyField(TopologyModel) diff --git a/src/context/service/database/SliceModel.py b/src/context/service/database/SliceModel.py new file mode 100644 index 0000000000000000000000000000000000000000..5b560a94864edb7fa9f501ad03377aa167036efc --- /dev/null +++ b/src/context/service/database/SliceModel.py @@ -0,0 +1,85 @@ +# 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. + +import functools, logging, operator +from enum import Enum +from typing import Dict, List +from common.orm.fields.EnumeratedField import EnumeratedField +from common.orm.fields.ForeignKeyField import ForeignKeyField +from common.orm.fields.PrimaryKeyField import PrimaryKeyField +from common.orm.fields.StringField import StringField +from common.orm.model.Model import Model +from common.orm.HighLevel import get_related_objects +from context.proto.context_pb2 import SliceStatusEnum +from .ConstraintModel import ConstraintsModel +from .ContextModel import ContextModel +from .Tools import grpc_to_enum + +LOGGER = logging.getLogger(__name__) + +class ORM_SliceStatusEnum(Enum): + UNDEFINED = SliceStatusEnum.SLICESTATUS_UNDEFINED + PLANNED = SliceStatusEnum.SLICESTATUS_PLANNED + INIT = SliceStatusEnum.SLICESTATUS_INIT + ACTIVE = SliceStatusEnum.SLICESTATUS_ACTIVE + DEINIT = SliceStatusEnum.SLICESTATUS_DEINIT + +grpc_to_enum__slice_status = functools.partial( + grpc_to_enum, SliceStatusEnum, ORM_SliceStatusEnum) + +class SliceModel(Model): + pk = PrimaryKeyField() + context_fk = ForeignKeyField(ContextModel) + slice_uuid = StringField(required=True, allow_empty=False) + slice_constraints_fk = ForeignKeyField(ConstraintsModel) + slice_status = EnumeratedField(ORM_SliceStatusEnum, required=True) + + def dump_id(self) -> Dict: + context_id = ContextModel(self.database, self.context_fk).dump_id() + return { + 'context_id': context_id, + 'slice_uuid': {'uuid': self.slice_uuid}, + } + + def dump_endpoint_ids(self) -> List[Dict]: + from .RelationModels import SliceEndPointModel # pylint: disable=import-outside-toplevel + db_endpoints = get_related_objects(self, SliceEndPointModel, 'endpoint_fk') + return [db_endpoint.dump_id() for db_endpoint in sorted(db_endpoints, key=operator.attrgetter('pk'))] + + def dump_constraints(self) -> List[Dict]: + return ConstraintsModel(self.database, self.slice_constraints_fk).dump() + + def dump_service_ids(self) -> List[Dict]: + from .RelationModels import SliceServiceModel # pylint: disable=import-outside-toplevel + db_services = get_related_objects(self, SliceServiceModel, 'service_fk') + return [db_service.dump_id() for db_service in sorted(db_services, key=operator.attrgetter('pk'))] + + def dump_subslice_ids(self) -> List[Dict]: + from .RelationModels import SliceSubSliceModel # pylint: disable=import-outside-toplevel + db_subslices = get_related_objects(self, SliceSubSliceModel, 'sub_slice_fk') + return [db_subslice.dump_id() for db_subslice in sorted(db_subslices, key=operator.attrgetter('pk'))] + + def dump( # pylint: disable=arguments-differ + self, include_endpoint_ids=True, include_constraints=True, include_service_ids=True, + include_subslice_ids=True + ) -> Dict: + result = { + 'slice_id': self.dump_id(), + 'slice_status': {'slice_status': self.slice_status.value}, + } + if include_endpoint_ids: result['slice_endpoint_ids'] = self.dump_endpoint_ids() + if include_constraints: result['slice_constraints'] = self.dump_constraints() + if include_service_ids: result['slice_service_ids'] = self.dump_service_ids() + if include_subslice_ids: result['slice_subslice_ids'] = self.dump_subslice_ids() + return result diff --git a/src/context/service/grpc_server/Constants.py b/src/context/service/grpc_server/Constants.py index b9676397cf2568ad27ba755b6d0a175af0670518..9d7c886c725d22308f33dc274234ad17f595633d 100644 --- a/src/context/service/grpc_server/Constants.py +++ b/src/context/service/grpc_server/Constants.py @@ -12,13 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. +TOPIC_CONNECTION = 'connection' TOPIC_CONTEXT = 'context' TOPIC_TOPOLOGY = 'topology' TOPIC_DEVICE = 'device' TOPIC_LINK = 'link' TOPIC_SERVICE = 'service' -TOPIC_CONNECTION = 'connection' +TOPIC_SLICE = 'slice' -TOPICS = {TOPIC_CONTEXT, TOPIC_TOPOLOGY, TOPIC_DEVICE, TOPIC_LINK, TOPIC_SERVICE, TOPIC_CONNECTION} +TOPICS = {TOPIC_CONNECTION, TOPIC_CONTEXT, TOPIC_TOPOLOGY, TOPIC_DEVICE, TOPIC_LINK, TOPIC_SERVICE, TOPIC_SLICE} CONSUME_TIMEOUT = 0.5 # seconds diff --git a/src/context/service/grpc_server/ContextService.py b/src/context/service/grpc_server/ContextService.py index 87ca94a70aa2e1733b8ec443c70a4623d2e0c471..c338b0f0d499e3c9a2a32a8ca77e386333af0456 100644 --- a/src/context/service/grpc_server/ContextService.py +++ b/src/context/service/grpc_server/ContextService.py @@ -12,61 +12,22 @@ # See the License for the specific language governing permissions and # limitations under the License. -import grpc -import logging -from concurrent import futures -from grpc_health.v1.health import HealthServicer, OVERALL_HEALTH -from grpc_health.v1.health_pb2 import HealthCheckResponse -from grpc_health.v1.health_pb2_grpc import add_HealthServicer_to_server -from context.Config import GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD +from common.Constants import ServiceNameEnum +from common.Settings import get_service_port_grpc +from common.message_broker.MessageBroker import MessageBroker +from common.orm.Database import Database +from common.tools.service.GenericGrpcService import GenericGrpcService from context.proto.context_pb2_grpc import add_ContextServiceServicer_to_server from .ContextServiceServicerImpl import ContextServiceServicerImpl -BIND_ADDRESS = '0.0.0.0' -LOGGER = logging.getLogger(__name__) +# Custom gRPC settings +GRPC_MAX_WORKERS = 200 # multiple clients might keep connections alive for Get*Events() RPC methods -class ContextService: - def __init__( - self, database, messagebroker, address=BIND_ADDRESS, port=GRPC_SERVICE_PORT, max_workers=GRPC_MAX_WORKERS, - grace_period=GRPC_GRACE_PERIOD): +class ContextService(GenericGrpcService): + def __init__(self, database : Database, messagebroker : MessageBroker, cls_name: str = __name__) -> None: + port = get_service_port_grpc(ServiceNameEnum.CONTEXT) + super().__init__(port, max_workers=GRPC_MAX_WORKERS, cls_name=cls_name) + self.context_servicer = ContextServiceServicerImpl(database, messagebroker) - self.database = database - self.messagebroker = messagebroker - self.address = address - self.port = port - self.endpoint = None - self.max_workers = max_workers - self.grace_period = grace_period - self.context_servicer = None - self.health_servicer = None - self.pool = None - self.server = None - - def start(self): - self.endpoint = '{:s}:{:s}'.format(str(self.address), str(self.port)) - LOGGER.info('Starting Service (tentative endpoint: {:s}, max_workers: {:s})...'.format( - str(self.endpoint), str(self.max_workers))) - - self.pool = futures.ThreadPoolExecutor(max_workers=self.max_workers) - self.server = grpc.server(self.pool) # , interceptors=(tracer_interceptor,)) - - self.context_servicer = ContextServiceServicerImpl(self.database, self.messagebroker) + def install_servicers(self): add_ContextServiceServicer_to_server(self.context_servicer, self.server) - - self.health_servicer = HealthServicer( - experimental_non_blocking=True, experimental_thread_pool=futures.ThreadPoolExecutor(max_workers=1)) - add_HealthServicer_to_server(self.health_servicer, self.server) - - port = self.server.add_insecure_port(self.endpoint) - self.endpoint = '{:s}:{:s}'.format(str(self.address), str(port)) - LOGGER.info('Listening on {:s}...'.format(str(self.endpoint))) - self.server.start() - self.health_servicer.set(OVERALL_HEALTH, HealthCheckResponse.SERVING) # pylint: disable=maybe-no-member - - LOGGER.debug('Service started') - - def stop(self): - LOGGER.debug('Stopping service (grace period {:s} seconds)...'.format(str(self.grace_period))) - self.health_servicer.enter_graceful_shutdown() - self.server.stop(self.grace_period) - LOGGER.debug('Service stopped') diff --git a/src/context/service/grpc_server/ContextServiceServicerImpl.py b/src/context/service/grpc_server/ContextServiceServicerImpl.py index 8e40592159a26ac853c9fa4af69f8064a2e55104..9218d550f824b22f3f90b042363acf433dfe0e59 100644 --- a/src/context/service/grpc_server/ContextServiceServicerImpl.py +++ b/src/context/service/grpc_server/ContextServiceServicerImpl.py @@ -24,8 +24,8 @@ from common.rpc_method_wrapper.ServiceExceptions import InvalidArgumentException from context.proto.context_pb2 import ( Connection, ConnectionEvent, ConnectionId, ConnectionIdList, ConnectionList, Context, ContextEvent, ContextId, ContextIdList, ContextList, Device, DeviceEvent, DeviceId, DeviceIdList, DeviceList, Empty, EventTypeEnum, Link, - LinkEvent, LinkId, LinkIdList, LinkList, Service, ServiceEvent, ServiceId, ServiceIdList, ServiceList, Topology, - TopologyEvent, TopologyId, TopologyIdList, TopologyList) + LinkEvent, LinkId, LinkIdList, LinkList, Service, ServiceEvent, ServiceId, ServiceIdList, ServiceList, Slice, SliceEvent, + SliceId, SliceIdList, SliceList, Topology, TopologyEvent, TopologyId, TopologyIdList, TopologyList) from context.proto.context_pb2_grpc import ContextServiceServicer from context.service.database.ConfigModel import ConfigModel, ConfigRuleModel, grpc_config_rules_to_raw, update_config from context.service.database.ConnectionModel import ConnectionModel, PathHopModel, PathModel, set_path @@ -37,12 +37,13 @@ from context.service.database.EndPointModel import EndPointModel, KpiSampleTypeM from context.service.database.Events import notify_event from context.service.database.LinkModel import LinkModel from context.service.database.RelationModels import ( - ConnectionSubServiceModel, LinkEndPointModel, ServiceEndPointModel, TopologyDeviceModel, TopologyLinkModel) + ConnectionSubServiceModel, LinkEndPointModel, ServiceEndPointModel, SliceEndPointModel, SliceServiceModel, SliceSubSliceModel, TopologyDeviceModel, TopologyLinkModel) from context.service.database.ServiceModel import ( ServiceModel, grpc_to_enum__service_status, grpc_to_enum__service_type) +from context.service.database.SliceModel import SliceModel, grpc_to_enum__slice_status from context.service.database.TopologyModel import TopologyModel from .Constants import ( - CONSUME_TIMEOUT, TOPIC_CONNECTION, TOPIC_CONTEXT, TOPIC_DEVICE, TOPIC_LINK, TOPIC_SERVICE, TOPIC_TOPOLOGY) + CONSUME_TIMEOUT, TOPIC_CONNECTION, TOPIC_CONTEXT, TOPIC_DEVICE, TOPIC_LINK, TOPIC_SERVICE, TOPIC_SLICE, TOPIC_TOPOLOGY) LOGGER = logging.getLogger(__name__) @@ -54,6 +55,7 @@ METHOD_NAMES = [ 'ListDeviceIds', 'ListDevices', 'GetDevice', 'SetDevice', 'RemoveDevice', 'GetDeviceEvents', 'ListLinkIds', 'ListLinks', 'GetLink', 'SetLink', 'RemoveLink', 'GetLinkEvents', 'ListServiceIds', 'ListServices', 'GetService', 'SetService', 'RemoveService', 'GetServiceEvents', + 'ListSliceIds', 'ListSlices', 'GetSlice', 'SetSlice', 'RemoveSlice', 'GetSliceEvents', ] METRICS = create_metrics(SERVICE_NAME, METHOD_NAMES) @@ -183,7 +185,8 @@ class ContextServiceServicerImpl(ContextServiceServicer): topology_uuid = request.topology_id.topology_uuid.uuid str_topology_key = key_to_str([context_uuid, topology_uuid]) result : Tuple[TopologyModel, bool] = update_or_create_object( - self.database, TopologyModel, str_topology_key, {'context_fk': db_context, 'topology_uuid': topology_uuid}) + self.database, TopologyModel, str_topology_key, { + 'context_fk': db_context, 'topology_uuid': topology_uuid}) db_topology,updated = result for device_id in request.device_ids: @@ -403,7 +406,8 @@ class ContextServiceServicerImpl(ContextServiceServicer): str_topology_key = key_to_str([endpoint_topology_context_uuid, endpoint_topology_uuid]) db_topology : TopologyModel = get_object(self.database, TopologyModel, str_topology_key) str_topology_device_key = key_to_str([str_topology_key, endpoint_device_uuid], separator='--') - get_object(self.database, TopologyDeviceModel, str_topology_device_key) # check device is in topology + # check device is in topology + get_object(self.database, TopologyDeviceModel, str_topology_device_key) str_endpoint_key = key_to_str([str_endpoint_key, str_topology_key], separator=':') db_endpoint : EndPointModel = get_object(self.database, EndPointModel, str_endpoint_key) @@ -491,7 +495,8 @@ class ContextServiceServicerImpl(ContextServiceServicer): raise InvalidArgumentException( 'request.service_endpoint_ids[{:d}].topology_id.context_id.context_uuid.uuid'.format(i), endpoint_topology_context_uuid, - ['should be == {:s}({:s})'.format('request.service_id.context_id.context_uuid.uuid', context_uuid)]) + ['should be == {:s}({:s})'.format( + 'request.service_id.context_id.context_uuid.uuid', context_uuid)]) service_uuid = request.service_id.service_uuid.uuid str_service_key = key_to_str([context_uuid, service_uuid]) @@ -574,6 +579,148 @@ class ContextServiceServicerImpl(ContextServiceServicer): yield ServiceEvent(**json.loads(message.content)) + # ----- Slice ---------------------------------------------------------------------------------------------------- + + @safe_and_metered_rpc_method(METRICS, LOGGER) + def ListSliceIds(self, request: ContextId, context : grpc.ServicerContext) -> SliceIdList: + with self.lock: + db_context : ContextModel = get_object(self.database, ContextModel, request.context_uuid.uuid) + db_slices : Set[SliceModel] = get_related_objects(db_context, SliceModel) + db_slices = sorted(db_slices, key=operator.attrgetter('pk')) + return SliceIdList(slice_ids=[db_slice.dump_id() for db_slice in db_slices]) + + @safe_and_metered_rpc_method(METRICS, LOGGER) + def ListSlices(self, request: ContextId, context : grpc.ServicerContext) -> SliceList: + with self.lock: + db_context : ContextModel = get_object(self.database, ContextModel, request.context_uuid.uuid) + db_slices : Set[SliceModel] = get_related_objects(db_context, SliceModel) + db_slices = sorted(db_slices, key=operator.attrgetter('pk')) + return SliceList(slices=[db_slice.dump() for db_slice in db_slices]) + + @safe_and_metered_rpc_method(METRICS, LOGGER) + def GetSlice(self, request: SliceId, context : grpc.ServicerContext) -> Slice: + with self.lock: + str_key = key_to_str([request.context_id.context_uuid.uuid, request.slice_uuid.uuid]) + db_slice : SliceModel = get_object(self.database, SliceModel, str_key) + return Slice(**db_slice.dump( + include_endpoint_ids=True, include_constraints=True, include_service_ids=True, + include_subslice_ids=True)) + + @safe_and_metered_rpc_method(METRICS, LOGGER) + def SetSlice(self, request: Slice, context : grpc.ServicerContext) -> SliceId: + with self.lock: + context_uuid = request.slice_id.context_id.context_uuid.uuid + db_context : ContextModel = get_object(self.database, ContextModel, context_uuid) + + for i,endpoint_id in enumerate(request.slice_endpoint_ids): + endpoint_topology_context_uuid = endpoint_id.topology_id.context_id.context_uuid.uuid + if len(endpoint_topology_context_uuid) > 0 and context_uuid != endpoint_topology_context_uuid: + raise InvalidArgumentException( + 'request.slice_endpoint_ids[{:d}].topology_id.context_id.context_uuid.uuid'.format(i), + endpoint_topology_context_uuid, + ['should be == {:s}({:s})'.format( + 'request.slice_id.context_id.context_uuid.uuid', context_uuid)]) + + slice_uuid = request.slice_id.slice_uuid.uuid + str_slice_key = key_to_str([context_uuid, slice_uuid]) + + constraints_result = set_constraints( + self.database, str_slice_key, 'constraints', request.slice_constraints) + db_constraints = constraints_result[0][0] + + result : Tuple[SliceModel, bool] = update_or_create_object(self.database, SliceModel, str_slice_key, { + 'context_fk' : db_context, + 'slice_uuid' : slice_uuid, + 'slice_constraints_fk': db_constraints, + 'slice_status' : grpc_to_enum__slice_status(request.slice_status.slice_status), + }) + db_slice, updated = result + + for i,endpoint_id in enumerate(request.slice_endpoint_ids): + endpoint_uuid = endpoint_id.endpoint_uuid.uuid + endpoint_device_uuid = endpoint_id.device_id.device_uuid.uuid + endpoint_topology_uuid = endpoint_id.topology_id.topology_uuid.uuid + endpoint_topology_context_uuid = endpoint_id.topology_id.context_id.context_uuid.uuid + + str_endpoint_key = key_to_str([endpoint_device_uuid, endpoint_uuid]) + if len(endpoint_topology_context_uuid) > 0 and len(endpoint_topology_uuid) > 0: + str_topology_key = key_to_str([endpoint_topology_context_uuid, endpoint_topology_uuid]) + str_endpoint_key = key_to_str([str_endpoint_key, str_topology_key], separator=':') + + db_endpoint : EndPointModel = get_object(self.database, EndPointModel, str_endpoint_key) + + str_slice_endpoint_key = key_to_str([slice_uuid, str_endpoint_key], separator='--') + result : Tuple[SliceEndPointModel, bool] = get_or_create_object( + self.database, SliceEndPointModel, str_slice_endpoint_key, { + 'slice_fk': db_slice, 'endpoint_fk': db_endpoint}) + #db_slice_endpoint, slice_endpoint_created = result + + for i,service_id in enumerate(request.slice_service_ids): + service_uuid = service_id.service_uuid.uuid + service_context_uuid = service_id.context_id.context_uuid.uuid + str_service_key = key_to_str([service_context_uuid, service_uuid]) + db_service : ServiceModel = get_object(self.database, ServiceModel, str_service_key) + + str_slice_service_key = key_to_str([str_slice_key, str_service_key], separator='--') + result : Tuple[SliceServiceModel, bool] = get_or_create_object( + self.database, SliceServiceModel, str_slice_service_key, { + 'slice_fk': db_slice, 'service_fk': db_service}) + #db_slice_service, slice_service_created = result + + for i,subslice_id in enumerate(request.slice_subslice_ids): + subslice_uuid = subslice_id.slice_uuid.uuid + subslice_context_uuid = subslice_id.context_id.context_uuid.uuid + str_subslice_key = key_to_str([subslice_context_uuid, subslice_uuid]) + db_subslice : SliceModel = get_object(self.database, SliceModel, str_subslice_key) + + str_slice_subslice_key = key_to_str([str_slice_key, str_subslice_key], separator='--') + result : Tuple[SliceSubSliceModel, bool] = get_or_create_object( + self.database, SliceSubSliceModel, str_slice_subslice_key, { + 'slice_fk': db_slice, 'sub_slice_fk': db_subslice}) + #db_slice_subslice, slice_subslice_created = result + + event_type = EventTypeEnum.EVENTTYPE_UPDATE if updated else EventTypeEnum.EVENTTYPE_CREATE + dict_slice_id = db_slice.dump_id() + notify_event(self.messagebroker, TOPIC_SLICE, event_type, {'slice_id': dict_slice_id}) + return SliceId(**dict_slice_id) + + @safe_and_metered_rpc_method(METRICS, LOGGER) + def RemoveSlice(self, request: SliceId, context : grpc.ServicerContext) -> Empty: + with self.lock: + context_uuid = request.context_id.context_uuid.uuid + slice_uuid = request.slice_uuid.uuid + db_slice = SliceModel(self.database, key_to_str([context_uuid, slice_uuid]), auto_load=False) + found = db_slice.load() + if not found: return Empty() + + dict_slice_id = db_slice.dump_id() + + for db_slice_endpoint_pk,_ in db_slice.references(SliceEndPointModel): + SliceEndPointModel(self.database, db_slice_endpoint_pk).delete() + + db_constraints = ConstraintsModel(self.database, db_slice.slice_constraints_fk) + for db_constraint_pk,_ in db_constraints.references(ConstraintModel): + ConstraintModel(self.database, db_constraint_pk).delete() + + for db_slice_service_pk,_ in db_slice.references(SliceServiceModel): + SliceServiceModel(self.database, db_slice_service_pk).delete() + + for db_slice_subslice_pk,_ in db_slice.references(SliceSubSliceModel): + SliceSubSliceModel(self.database, db_slice_subslice_pk).delete() + + db_slice.delete() + db_constraints.delete() + + event_type = EventTypeEnum.EVENTTYPE_REMOVE + notify_event(self.messagebroker, TOPIC_SLICE, event_type, {'slice_id': dict_slice_id}) + return Empty() + + @safe_and_metered_rpc_method(METRICS, LOGGER) + def GetSliceEvents(self, request: Empty, context : grpc.ServicerContext) -> Iterator[SliceEvent]: + for message in self.messagebroker.consume({TOPIC_SLICE}, consume_timeout=CONSUME_TIMEOUT): + yield SliceEvent(**json.loads(message.content)) + + # ----- Connection ------------------------------------------------------------------------------------------------- @safe_and_metered_rpc_method(METRICS, LOGGER) diff --git a/src/context/service/rest_server/Resources.py b/src/context/service/rest_server/Resources.py index 966c62f968a32bfc06abeb0d69f612725fce8d5e..95c06d83cf1b708e2420e3f6ecff140bcb098598 100644 --- a/src/context/service/rest_server/Resources.py +++ b/src/context/service/rest_server/Resources.py @@ -17,7 +17,7 @@ from flask.json import jsonify from flask_restful import Resource from common.orm.Database import Database from common.tools.grpc.Tools import grpc_message_to_json -from context.proto.context_pb2 import ConnectionId, ContextId, DeviceId, Empty, LinkId, ServiceId, TopologyId +from context.proto.context_pb2 import ConnectionId, ContextId, DeviceId, Empty, LinkId, ServiceId, SliceId, TopologyId from context.service.grpc_server.ContextServiceServicerImpl import ContextServiceServicerImpl def format_grpc_to_json(grpc_reply): @@ -49,6 +49,12 @@ def grpc_service_id(context_uuid, service_uuid): 'service_uuid': {'uuid': service_uuid} }) +def grpc_slice_id(context_uuid, slice_uuid): + return SliceId(**{ + 'context_id': {'context_uuid': {'uuid': context_uuid}}, + 'slice_uuid': {'uuid': slice_uuid} + }) + def grpc_topology_id(context_uuid, topology_uuid): return TopologyId(**{ 'context_id': {'context_uuid': {'uuid': context_uuid}}, @@ -97,6 +103,18 @@ class Service(_Resource): def get(self, context_uuid : str, service_uuid : str): return format_grpc_to_json(self.servicer.GetService(grpc_service_id(context_uuid, service_uuid), None)) +class SliceIds(_Resource): + def get(self, context_uuid : str): + return format_grpc_to_json(self.servicer.ListSliceIds(grpc_context_id(context_uuid), None)) + +class Slices(_Resource): + def get(self, context_uuid : str): + return format_grpc_to_json(self.servicer.ListSlices(grpc_context_id(context_uuid), None)) + +class Slice(_Resource): + def get(self, context_uuid : str, slice_uuid : str): + return format_grpc_to_json(self.servicer.GetSlice(grpc_slice_id(context_uuid, slice_uuid), None)) + class DeviceIds(_Resource): def get(self): return format_grpc_to_json(self.servicer.ListDeviceIds(Empty(), None)) @@ -141,7 +159,7 @@ class DumpText(Resource): def get(self): db_entries = self.database.dump() num_entries = len(db_entries) - response = ['----- Database Dump [{:3d} entries] -------------------------'.format(len(db_entries))] + response = ['----- Database Dump [{:3d} entries] -------------------------'.format(num_entries)] for db_entry in db_entries: response.append(' [{:>4s}] {:40s} :: {:s}'.format(*db_entry)) # pragma: no cover response.append('-----------------------------------------------------------') @@ -185,6 +203,10 @@ RESOURCES = [ ('api.services', Services, '/context/<string:context_uuid>/services'), ('api.service', Service, '/context/<string:context_uuid>/service/<path:service_uuid>'), + ('api.slice_ids', SliceIds, '/context/<string:context_uuid>/slice_ids'), + ('api.slices', Slices, '/context/<string:context_uuid>/slices'), + ('api.slice', Slice, '/context/<string:context_uuid>/slice/<path:slice_uuid>'), + ('api.device_ids', DeviceIds, '/device_ids'), ('api.devices', Devices, '/devices'), ('api.device', Device, '/device/<string:device_uuid>'), diff --git a/src/context/service/rest_server/RestServer.py b/src/context/service/rest_server/RestServer.py new file mode 100644 index 0000000000000000000000000000000000000000..289e92a3c1b74e207a261b133130a551c3c55918 --- /dev/null +++ b/src/context/service/rest_server/RestServer.py @@ -0,0 +1,23 @@ +# 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. + +from common.Constants import ServiceNameEnum +from common.Settings import get_service_baseurl_http, get_service_port_http +from common.tools.service.GenericRestServer import GenericRestServer + +class RestServer(GenericRestServer): + def __init__(self, cls_name: str = __name__) -> None: + bind_port = get_service_port_http(ServiceNameEnum.CONTEXT) + base_url = get_service_baseurl_http(ServiceNameEnum.CONTEXT) + super().__init__(bind_port, base_url, cls_name=cls_name) diff --git a/src/context/service/rest_server/Server.py b/src/context/service/rest_server/Server.py deleted file mode 100644 index ac4888d41bd9a84c57fc2d2f308bde4558787cbc..0000000000000000000000000000000000000000 --- a/src/context/service/rest_server/Server.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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. - -import logging, threading -from flask import Flask -from flask_restful import Api -from werkzeug.serving import make_server -from context.Config import RESTAPI_BASE_URL, RESTAPI_SERVICE_PORT - -logging.getLogger('werkzeug').setLevel(logging.WARNING) - -BIND_ADDRESS = '0.0.0.0' -LOGGER = logging.getLogger(__name__) - -class Server(threading.Thread): - def __init__(self, host=BIND_ADDRESS, port=RESTAPI_SERVICE_PORT, base_url=RESTAPI_BASE_URL): - threading.Thread.__init__(self, daemon=True) - self.host = host - self.port = port - self.base_url = base_url - self.srv = None - self.ctx = None - self.app = Flask(__name__) - self.api = Api(self.app, prefix=self.base_url) - - def add_resource(self, resource, *urls, **kwargs): - self.api.add_resource(resource, *urls, **kwargs) - - def run(self): - self.srv = make_server(self.host, self.port, self.app, threaded=True) - self.ctx = self.app.app_context() - self.ctx.push() - - endpoint = 'http://{:s}:{:s}{:s}'.format(str(self.host), str(self.port), str(self.base_url)) - LOGGER.info('Listening on {:s}...'.format(str(endpoint))) - self.srv.serve_forever() - - def shutdown(self): - self.srv.shutdown() diff --git a/src/context/tests/test_unitary.py b/src/context/tests/test_unitary.py index 10f44d9ad87a71d5935151f4ae724e9d04b5d5ce..0705477aece433cc7d796921afbd40e6d4df05eb 100644 --- a/src/context/tests/test_unitary.py +++ b/src/context/tests/test_unitary.py @@ -15,7 +15,8 @@ # pylint: disable=too-many-lines import copy, grpc, logging, os, pytest, requests, time, urllib from typing import Tuple -from common.Constants import DEFAULT_CONTEXT_UUID, DEFAULT_TOPOLOGY_UUID +from common.Constants import DEFAULT_CONTEXT_UUID, DEFAULT_TOPOLOGY_UUID, ServiceNameEnum +from common.Settings import ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, ENVVAR_SUFIX_SERVICE_PORT_HTTP, get_env_var_name, get_service_baseurl_http, get_service_port_grpc, get_service_port_http from common.orm.Database import Database from common.orm.Factory import get_database_backend, BackendEnum as DatabaseBackendEnum from common.message_broker.Factory import get_messagebroker_backend, BackendEnum as MessageBrokerBackendEnum @@ -25,8 +26,6 @@ from common.type_checkers.Assertions import ( validate_contexts, validate_device, validate_device_ids, validate_devices, validate_link, validate_link_ids, validate_links, validate_service, validate_service_ids, validate_services, validate_topologies, validate_topology, validate_topology_ids) -from context.Config import ( - GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD, RESTAPI_SERVICE_PORT, RESTAPI_BASE_URL) from context.client.ContextClient import ContextClient from context.client.EventsCollector import EventsCollector from context.proto.context_pb2 import ( @@ -37,7 +36,7 @@ from context.service.database.Tools import ( FASTHASHER_DATA_ACCEPTED_FORMAT, FASTHASHER_ITEM_ACCEPTED_FORMAT, fast_hasher) from context.service.grpc_server.ContextService import ContextService from context.service.Populate import populate -from context.service.rest_server.Server import Server as RestServer +from context.service.rest_server.RestServer import RestServer from context.service.rest_server.Resources import RESOURCES from .Objects import ( CONNECTION_R1_R3, CONNECTION_R1_R3_ID, CONNECTION_R1_R3_UUID, CONTEXT, CONTEXT_ID, DEVICE_R1, DEVICE_R1_ID, @@ -48,10 +47,15 @@ from .Objects import ( LOGGER = logging.getLogger(__name__) LOGGER.setLevel(logging.DEBUG) -GRPC_PORT = 10000 + GRPC_SERVICE_PORT # avoid privileged ports -RESTAPI_PORT = 10000 + RESTAPI_SERVICE_PORT # avoid privileged ports +LOCAL_HOST = '127.0.0.1' +GRPC_PORT = 10000 + get_service_port_grpc(ServiceNameEnum.CONTEXT) # avoid privileged ports +HTTP_PORT = 10000 + get_service_port_http(ServiceNameEnum.CONTEXT) # avoid privileged ports -DEFAULT_REDIS_SERVICE_HOST = '127.0.0.1' +os.environ[get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_HOST )] = str(LOCAL_HOST) +os.environ[get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(GRPC_PORT) +os.environ[get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_HTTP)] = str(HTTP_PORT) + +DEFAULT_REDIS_SERVICE_HOST = LOCAL_HOST DEFAULT_REDIS_SERVICE_PORT = 6379 DEFAULT_REDIS_DATABASE_ID = 0 @@ -78,9 +82,7 @@ def context_db_mb(request) -> Tuple[Database, MessageBroker]: @pytest.fixture(scope='session') def context_service_grpc(context_db_mb : Tuple[Database, MessageBroker]): # pylint: disable=redefined-outer-name - _service = ContextService( - context_db_mb[0], context_db_mb[1], port=GRPC_PORT, max_workers=GRPC_MAX_WORKERS, - grace_period=GRPC_GRACE_PERIOD) + _service = ContextService(context_db_mb[0], context_db_mb[1]) _service.start() yield _service _service.stop() @@ -88,7 +90,7 @@ def context_service_grpc(context_db_mb : Tuple[Database, MessageBroker]): # pyli @pytest.fixture(scope='session') def context_service_rest(context_db_mb : Tuple[Database, MessageBroker]): # pylint: disable=redefined-outer-name database = context_db_mb[0] - _rest_server = RestServer(port=RESTAPI_PORT, base_url=RESTAPI_BASE_URL) + _rest_server = RestServer() for endpoint_name, resource_class, resource_url in RESOURCES: _rest_server.add_resource(resource_class, resource_url, endpoint=endpoint_name, resource_class_args=(database,)) _rest_server.start() @@ -99,12 +101,13 @@ def context_service_rest(context_db_mb : Tuple[Database, MessageBroker]): # pyli @pytest.fixture(scope='session') def context_client_grpc(context_service_grpc : ContextService): # pylint: disable=redefined-outer-name - _client = ContextClient(address='127.0.0.1', port=GRPC_PORT) + _client = ContextClient() yield _client _client.close() def do_rest_request(url : str): - request_url = 'http://127.0.0.1:{:s}{:s}{:s}'.format(str(RESTAPI_PORT), str(RESTAPI_BASE_URL), url) + base_url = get_service_baseurl_http(ServiceNameEnum.CONTEXT) + request_url = 'http://{:s}:{:s}{:s}{:s}'.format(str(LOCAL_HOST), str(HTTP_PORT), str(base_url), url) LOGGER.warning('Request: GET {:s}'.format(str(request_url))) reply = requests.get(request_url) LOGGER.warning('Reply: {:s}'.format(str(reply.text))) @@ -1172,7 +1175,7 @@ def test_rest_populate_database( ): database = context_db_mb[0] database.clear_all() - populate('127.0.0.1', GRPC_PORT) + populate(LOCAL_HOST, GRPC_PORT) def test_rest_get_context_ids(context_service_rest : RestServer): # pylint: disable=redefined-outer-name reply = do_rest_request('/context_ids') diff --git a/src/dbscanserving/.gitlab-ci.yml b/src/dbscanserving/.gitlab-ci.yml index 1e499fae232ff805fe3f70d1b1c586a9c9a8de5f..fd0d66bac25bbb5417a9f90415f3d0732312516b 100644 --- a/src/dbscanserving/.gitlab-ci.yml +++ b/src/dbscanserving/.gitlab-ci.yml @@ -56,7 +56,6 @@ unit test dbscanserving: - docker ps -a - docker logs $IMAGE_NAME - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml" - - docker exec -i $IMAGE_NAME bash -c "coverage xml -o /opt/results/${IMAGE_NAME}_coverage.xml" - docker exec -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing" coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' after_script: @@ -76,7 +75,6 @@ unit test dbscanserving: when: always reports: junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml - cobertura: src/$IMAGE_NAME/tests/${IMAGE_NAME}_coverage.xml # Deployment of the dbscanserving service in Kubernetes Cluster diff --git a/src/dbscanserving/genproto.sh b/src/dbscanserving/genproto.sh index d44156c2f327fe2344cb17d59fa51b3ead9bc43b..6c480c673d4081a4e7db1c2ff9741208794ddedd 100755 --- a/src/dbscanserving/genproto.sh +++ b/src/dbscanserving/genproto.sh @@ -1,6 +1,6 @@ #!/bin/bash -eu # -# Copyright 2018 Google LLC +# 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. @@ -14,14 +14,27 @@ # See the License for the specific language governing permissions and # limitations under the License. -#!/bin/bash -e - # Make folder containing the script the root folder for its execution cd $(dirname $0) rm -rf proto/*.py rm -rf proto/__pycache__ -touch proto/__init__.py +tee proto/__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 # building current service protos python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto dbscanserving.proto diff --git a/src/dbscanserving/proto/dbscanserving_pb2.py b/src/dbscanserving/proto/dbscanserving_pb2.py index b5e464db4db39c2d3f6a5530c5d702e4bf25b8a0..f2d6c37c7c567394d3b12392a1fa4e0f748f6625 100644 --- a/src/dbscanserving/proto/dbscanserving_pb2.py +++ b/src/dbscanserving/proto/dbscanserving_pb2.py @@ -20,7 +20,7 @@ DESCRIPTOR = _descriptor.FileDescriptor( syntax='proto3', serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x13\x64\x62scanserving.proto\x12\rdbscanserving\"\x1a\n\x06Sample\x12\x10\n\x08\x66\x65\x61tures\x18\x01 \x03(\x02\"\xd6\x01\n\x10\x44\x65tectionRequest\x12\x0b\n\x03\x65ps\x18\x01 \x01(\x02\x12\x13\n\x0bmin_samples\x18\x02 \x01(\x05\x12%\n\x06metric\x18\x03 \x01(\x0e\x32\x15.dbscanserving.Metric\x12\x13\n\x0bnum_samples\x18\x04 \x01(\x05\x12\x14\n\x0cnum_features\x18\x05 \x01(\x05\x12&\n\x07samples\x18\x06 \x03(\x0b\x32\x15.dbscanserving.Sample\x12\x17\n\nidentifier\x18\x07 \x01(\x05H\x00\x88\x01\x01\x42\r\n\x0b_identifier\",\n\x11\x44\x65tectionResponse\x12\x17\n\x0f\x63luster_indices\x18\x01 \x03(\x05*\x17\n\x06Metric\x12\r\n\tEUCLIDEAN\x10\x00\x32W\n\x08\x44\x65tector\x12K\n\x06\x44\x65tect\x12\x1f.dbscanserving.DetectionRequest\x1a .dbscanserving.DetectionResponseb\x06proto3' + serialized_pb=b'\n\x13\x64\x62scanserving.proto\x12\rdbscanserving\"\x1a\n\x06Sample\x12\x10\n\x08\x66\x65\x61tures\x18\x01 \x03(\x02\"\xc2\x01\n\x10\x44\x65tectionRequest\x12\x0b\n\x03\x65ps\x18\x01 \x01(\x02\x12\x13\n\x0bmin_samples\x18\x02 \x01(\x05\x12%\n\x06metric\x18\x03 \x01(\x0e\x32\x15.dbscanserving.Metric\x12\x13\n\x0bnum_samples\x18\x04 \x01(\x05\x12\x14\n\x0cnum_features\x18\x05 \x01(\x05\x12&\n\x07samples\x18\x06 \x03(\x0b\x32\x15.dbscanserving.Sample\x12\x12\n\nidentifier\x18\x07 \x01(\x05\",\n\x11\x44\x65tectionResponse\x12\x17\n\x0f\x63luster_indices\x18\x01 \x03(\x05*\x17\n\x06Metric\x12\r\n\tEUCLIDEAN\x10\x00\x32W\n\x08\x44\x65tector\x12K\n\x06\x44\x65tect\x12\x1f.dbscanserving.DetectionRequest\x1a .dbscanserving.DetectionResponseb\x06proto3' ) _METRIC = _descriptor.EnumDescriptor( @@ -38,8 +38,8 @@ _METRIC = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=329, - serialized_end=352, + serialized_start=309, + serialized_end=332, ) _sym_db.RegisterEnumDescriptor(_METRIC) @@ -148,14 +148,9 @@ _DETECTIONREQUEST = _descriptor.Descriptor( syntax='proto3', extension_ranges=[], oneofs=[ - _descriptor.OneofDescriptor( - name='_identifier', full_name='dbscanserving.DetectionRequest._identifier', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), ], serialized_start=67, - serialized_end=281, + serialized_end=261, ) @@ -186,15 +181,12 @@ _DETECTIONRESPONSE = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=283, - serialized_end=327, + serialized_start=263, + serialized_end=307, ) _DETECTIONREQUEST.fields_by_name['metric'].enum_type = _METRIC _DETECTIONREQUEST.fields_by_name['samples'].message_type = _SAMPLE -_DETECTIONREQUEST.oneofs_by_name['_identifier'].fields.append( - _DETECTIONREQUEST.fields_by_name['identifier']) -_DETECTIONREQUEST.fields_by_name['identifier'].containing_oneof = _DETECTIONREQUEST.oneofs_by_name['_identifier'] DESCRIPTOR.message_types_by_name['Sample'] = _SAMPLE DESCRIPTOR.message_types_by_name['DetectionRequest'] = _DETECTIONREQUEST DESCRIPTOR.message_types_by_name['DetectionResponse'] = _DETECTIONRESPONSE @@ -231,8 +223,8 @@ _DETECTOR = _descriptor.ServiceDescriptor( index=0, serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_start=354, - serialized_end=441, + serialized_start=334, + serialized_end=421, methods=[ _descriptor.MethodDescriptor( name='Detect', diff --git a/src/device/.gitlab-ci.yml b/src/device/.gitlab-ci.yml index aa2f9114a8c1507397171286e79d4daf8c348899..4e337f37e17006cee0943dfadce6d933b656c4bf 100644 --- a/src/device/.gitlab-ci.yml +++ b/src/device/.gitlab-ci.yml @@ -54,8 +54,7 @@ unit test device: - sleep 5 - docker ps -a - docker logs $IMAGE_NAME - - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml" - - docker exec -i $IMAGE_NAME bash -c "coverage xml -o /opt/results/${IMAGE_NAME}_coverage.xml" + - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary_emulated.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml" - docker exec -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing" coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' after_script: @@ -75,7 +74,6 @@ unit test device: when: always reports: junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml - cobertura: src/$IMAGE_NAME/tests/${IMAGE_NAME}_coverage.xml # Deployment of the service in Kubernetes Cluster deploy device: diff --git a/src/device/Config.py b/src/device/Config.py index 415ae7b01ced740a0dc09f215ae71ad553a2672e..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/device/Config.py +++ b/src/device/Config.py @@ -12,21 +12,3 @@ # See the License for the specific language governing permissions and # limitations under the License. -import logging - -# General settings -LOG_LEVEL = logging.WARNING - -# gRPC settings -GRPC_SERVICE_PORT = 2020 -GRPC_MAX_WORKERS = 10 -GRPC_GRACE_PERIOD = 60 - -# Prometheus settings -METRICS_PORT = 9192 - -# Dependency micro-service connection settings -CONTEXT_SERVICE_HOST = '127.0.0.1' -CONTEXT_SERVICE_PORT = 1010 -MONITORING_SERVICE_HOST = '127.0.0.1' -MONITORING_SERVICE_PORT = 7070 diff --git a/src/device/client/DeviceClient.py b/src/device/client/DeviceClient.py index 2a9512411a2d9e55e4c5b0fa75d48fc54d810713..7fe54cb23babee7a2f3bc9d21082732d924f5eff 100644 --- a/src/device/client/DeviceClient.py +++ b/src/device/client/DeviceClient.py @@ -13,7 +13,10 @@ # limitations under the License. import grpc, logging +from common.Constants import ServiceNameEnum +from common.Settings import get_service_host, get_service_port_grpc from common.tools.client.RetryDecorator import retry, delay_exponential +from common.tools.grpc.Tools import grpc_message_to_json_string from device.proto.context_pb2 import Device, DeviceConfig, DeviceId, Empty from device.proto.device_pb2 import MonitoringSettings from device.proto.device_pb2_grpc import DeviceServiceStub @@ -24,8 +27,10 @@ DELAY_FUNCTION = delay_exponential(initial=0.01, increment=2.0, maximum=5.0) RETRY_DECORATOR = retry(max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') class DeviceClient: - def __init__(self, address, port): - self.endpoint = '{:s}:{:s}'.format(str(address), str(port)) + def __init__(self, host=None, port=None): + if not host: host = get_service_host(ServiceNameEnum.DEVICE) + if not port: port = get_service_port_grpc(ServiceNameEnum.DEVICE) + self.endpoint = '{:s}:{:s}'.format(str(host), str(port)) LOGGER.debug('Creating channel to {:s}...'.format(str(self.endpoint))) self.channel = None self.stub = None @@ -37,41 +42,41 @@ class DeviceClient: self.stub = DeviceServiceStub(self.channel) def close(self): - if(self.channel is not None): self.channel.close() + if self.channel is not None: self.channel.close() self.channel = None self.stub = None @RETRY_DECORATOR def AddDevice(self, request : Device) -> DeviceId: - LOGGER.debug('AddDevice request: {:s}'.format(str(request))) + LOGGER.debug('AddDevice request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.AddDevice(request) - LOGGER.debug('AddDevice result: {:s}'.format(str(response))) + LOGGER.debug('AddDevice result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def ConfigureDevice(self, request : Device) -> DeviceId: - LOGGER.debug('ConfigureDevice request: {:s}'.format(str(request))) + LOGGER.debug('ConfigureDevice request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.ConfigureDevice(request) - LOGGER.debug('ConfigureDevice result: {:s}'.format(str(response))) + LOGGER.debug('ConfigureDevice result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def DeleteDevice(self, request : DeviceId) -> Empty: - LOGGER.debug('DeleteDevice request: {:s}'.format(str(request))) + LOGGER.debug('DeleteDevice request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.DeleteDevice(request) - LOGGER.debug('DeleteDevice result: {:s}'.format(str(response))) + LOGGER.debug('DeleteDevice result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def GetInitialConfig(self, request : DeviceId) -> DeviceConfig: - LOGGER.debug('GetInitialConfig request: {:s}'.format(str(request))) + LOGGER.debug('GetInitialConfig request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.GetInitialConfig(request) - LOGGER.debug('GetInitialConfig result: {:s}'.format(str(response))) + LOGGER.debug('GetInitialConfig result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def MonitorDeviceKpi(self, request : MonitoringSettings) -> Empty: - LOGGER.debug('MonitorDeviceKpi request: {:s}'.format(str(request))) + LOGGER.debug('MonitorDeviceKpi request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.MonitorDeviceKpi(request) - LOGGER.debug('MonitorDeviceKpi result: {:s}'.format(str(response))) + LOGGER.debug('MonitorDeviceKpi result: {:s}'.format(grpc_message_to_json_string(response))) return response diff --git a/src/device/genproto.sh b/src/device/genproto.sh index 31632fb894f3ede9582063d81b1911fe2551d96d..49b1d10ad23742fda1549e264ef0fa741112c6fc 100755 --- a/src/device/genproto.sh +++ b/src/device/genproto.sh @@ -1,6 +1,6 @@ #!/bin/bash -eu # -# Copyright 2018 Google LLC +# 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. @@ -14,14 +14,27 @@ # See the License for the specific language governing permissions and # limitations under the License. -#!/bin/bash -e - # Make folder containing the script the root folder for its execution cd $(dirname $0) rm -rf proto/*.py rm -rf proto/__pycache__ -touch proto/__init__.py +tee proto/__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 python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto context.proto python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto device.proto diff --git a/src/device/proto/context_pb2.py b/src/device/proto/context_pb2.py index 68602b16f264ceac9acc3ef6669b09d5984e72c2..50d501d3ac053ad644554331af26e3c40cd426a1 100644 --- a/src/device/proto/context_pb2.py +++ b/src/device/proto/context_pb2.py @@ -21,7 +21,7 @@ DESCRIPTOR = _descriptor.FileDescriptor( syntax='proto3', serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\rcontext.proto\x12\x07\x63ontext\x1a\x16kpi_sample_types.proto\"\x07\n\x05\x45mpty\"\x14\n\x04Uuid\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"F\n\x05\x45vent\x12\x11\n\ttimestamp\x18\x01 \x01(\x01\x12*\n\nevent_type\x18\x02 \x01(\x0e\x32\x16.context.EventTypeEnum\"0\n\tContextId\x12#\n\x0c\x63ontext_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xb6\x01\n\x07\x43ontext\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12)\n\x0ctopology_ids\x18\x02 \x03(\x0b\x32\x13.context.TopologyId\x12\'\n\x0bservice_ids\x18\x03 \x03(\x0b\x32\x12.context.ServiceId\x12/\n\ncontroller\x18\x04 \x01(\x0b\x32\x1b.context.TeraFlowController\"8\n\rContextIdList\x12\'\n\x0b\x63ontext_ids\x18\x01 \x03(\x0b\x32\x12.context.ContextId\"1\n\x0b\x43ontextList\x12\"\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32\x10.context.Context\"U\n\x0c\x43ontextEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\ncontext_id\x18\x02 \x01(\x0b\x32\x12.context.ContextId\"Z\n\nTopologyId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12$\n\rtopology_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"~\n\x08Topology\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12%\n\ndevice_ids\x18\x02 \x03(\x0b\x32\x11.context.DeviceId\x12!\n\x08link_ids\x18\x03 \x03(\x0b\x32\x0f.context.LinkId\";\n\x0eTopologyIdList\x12)\n\x0ctopology_ids\x18\x01 \x03(\x0b\x32\x13.context.TopologyId\"5\n\x0cTopologyList\x12%\n\ntopologies\x18\x01 \x03(\x0b\x32\x11.context.Topology\"X\n\rTopologyEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12(\n\x0btopology_id\x18\x02 \x01(\x0b\x32\x13.context.TopologyId\".\n\x08\x44\x65viceId\x12\"\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x9a\x02\n\x06\x44\x65vice\x12$\n\tdevice_id\x18\x01 \x01(\x0b\x32\x11.context.DeviceId\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12,\n\rdevice_config\x18\x03 \x01(\x0b\x32\x15.context.DeviceConfig\x12G\n\x19\x64\x65vice_operational_status\x18\x04 \x01(\x0e\x32$.context.DeviceOperationalStatusEnum\x12\x31\n\x0e\x64\x65vice_drivers\x18\x05 \x03(\x0e\x32\x19.context.DeviceDriverEnum\x12+\n\x10\x64\x65vice_endpoints\x18\x06 \x03(\x0b\x32\x11.context.EndPoint\"9\n\x0c\x44\x65viceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"5\n\x0c\x44\x65viceIdList\x12%\n\ndevice_ids\x18\x01 \x03(\x0b\x32\x11.context.DeviceId\".\n\nDeviceList\x12 \n\x07\x64\x65vices\x18\x01 \x03(\x0b\x32\x0f.context.Device\"R\n\x0b\x44\x65viceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"*\n\x06LinkId\x12 \n\tlink_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"X\n\x04Link\x12 \n\x07link_id\x18\x01 \x01(\x0b\x32\x0f.context.LinkId\x12.\n\x11link_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\"/\n\nLinkIdList\x12!\n\x08link_ids\x18\x01 \x03(\x0b\x32\x0f.context.LinkId\"(\n\x08LinkList\x12\x1c\n\x05links\x18\x01 \x03(\x0b\x32\r.context.Link\"L\n\tLinkEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12 \n\x07link_id\x18\x02 \x01(\x0b\x32\x0f.context.LinkId\"X\n\tServiceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12#\n\x0cservice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\xa6\x02\n\x07Service\x12&\n\nservice_id\x18\x01 \x01(\x0b\x32\x12.context.ServiceId\x12.\n\x0cservice_type\x18\x02 \x01(\x0e\x32\x18.context.ServiceTypeEnum\x12\x31\n\x14service_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12\x30\n\x13service_constraints\x18\x04 \x03(\x0b\x32\x13.context.Constraint\x12.\n\x0eservice_status\x18\x05 \x01(\x0b\x32\x16.context.ServiceStatus\x12.\n\x0eservice_config\x18\x06 \x01(\x0b\x32\x16.context.ServiceConfig\"C\n\rServiceStatus\x12\x32\n\x0eservice_status\x18\x01 \x01(\x0e\x32\x1a.context.ServiceStatusEnum\":\n\rServiceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"8\n\rServiceIdList\x12\'\n\x0bservice_ids\x18\x01 \x03(\x0b\x32\x12.context.ServiceId\"1\n\x0bServiceList\x12\"\n\x08services\x18\x01 \x03(\x0b\x32\x10.context.Service\"U\n\x0cServiceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\"6\n\x0c\x43onnectionId\x12&\n\x0f\x63onnection_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xc4\x01\n\nConnection\x12,\n\rconnection_id\x18\x01 \x01(\x0b\x32\x15.context.ConnectionId\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\x12\x33\n\x16path_hops_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12+\n\x0fsub_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\"A\n\x10\x43onnectionIdList\x12-\n\x0e\x63onnection_ids\x18\x01 \x03(\x0b\x32\x15.context.ConnectionId\":\n\x0e\x43onnectionList\x12(\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x13.context.Connection\"^\n\x0f\x43onnectionEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12,\n\rconnection_id\x18\x02 \x01(\x0b\x32\x15.context.ConnectionId\"\x82\x01\n\nEndPointId\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\x12$\n\rendpoint_uuid\x18\x03 \x01(\x0b\x32\r.context.Uuid\"\x86\x01\n\x08\x45ndPoint\x12(\n\x0b\x65ndpoint_id\x18\x01 \x01(\x0b\x32\x13.context.EndPointId\x12\x15\n\rendpoint_type\x18\x02 \x01(\t\x12\x39\n\x10kpi_sample_types\x18\x03 \x03(\x0e\x32\x1f.kpi_sample_types.KpiSampleType\"e\n\nConfigRule\x12)\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x19.context.ConfigActionEnum\x12\x14\n\x0cresource_key\x18\x02 \x01(\t\x12\x16\n\x0eresource_value\x18\x03 \x01(\t\"?\n\nConstraint\x12\x17\n\x0f\x63onstraint_type\x18\x01 \x01(\t\x12\x18\n\x10\x63onstraint_value\x18\x02 \x01(\t\"^\n\x12TeraFlowController\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x12\n\nip_address\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\"U\n\x14\x41uthenticationResult\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x15\n\rauthenticated\x18\x02 \x01(\x08*j\n\rEventTypeEnum\x12\x17\n\x13\x45VENTTYPE_UNDEFINED\x10\x00\x12\x14\n\x10\x45VENTTYPE_CREATE\x10\x01\x12\x14\n\x10\x45VENTTYPE_UPDATE\x10\x02\x12\x14\n\x10\x45VENTTYPE_REMOVE\x10\x03*\xc5\x01\n\x10\x44\x65viceDriverEnum\x12\x1a\n\x16\x44\x45VICEDRIVER_UNDEFINED\x10\x00\x12\x1b\n\x17\x44\x45VICEDRIVER_OPENCONFIG\x10\x01\x12\x1e\n\x1a\x44\x45VICEDRIVER_TRANSPORT_API\x10\x02\x12\x13\n\x0f\x44\x45VICEDRIVER_P4\x10\x03\x12&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOGY\x10\x04\x12\x1b\n\x17\x44\x45VICEDRIVER_ONF_TR_352\x10\x05*\x8f\x01\n\x1b\x44\x65viceOperationalStatusEnum\x12%\n!DEVICEOPERATIONALSTATUS_UNDEFINED\x10\x00\x12$\n DEVICEOPERATIONALSTATUS_DISABLED\x10\x01\x12#\n\x1f\x44\x45VICEOPERATIONALSTATUS_ENABLED\x10\x02*\x81\x01\n\x0fServiceTypeEnum\x12\x17\n\x13SERVICETYPE_UNKNOWN\x10\x00\x12\x14\n\x10SERVICETYPE_L3NM\x10\x01\x12\x14\n\x10SERVICETYPE_L2NM\x10\x02\x12)\n%SERVICETYPE_TAPI_CONNECTIVITY_SERVICE\x10\x03*\x88\x01\n\x11ServiceStatusEnum\x12\x1b\n\x17SERVICESTATUS_UNDEFINED\x10\x00\x12\x19\n\x15SERVICESTATUS_PLANNED\x10\x01\x12\x18\n\x14SERVICESTATUS_ACTIVE\x10\x02\x12!\n\x1dSERVICESTATUS_PENDING_REMOVAL\x10\x03*]\n\x10\x43onfigActionEnum\x12\x1a\n\x16\x43ONFIGACTION_UNDEFINED\x10\x00\x12\x14\n\x10\x43ONFIGACTION_SET\x10\x01\x12\x17\n\x13\x43ONFIGACTION_DELETE\x10\x02\x32\xad\x10\n\x0e\x43ontextService\x12:\n\x0eListContextIds\x12\x0e.context.Empty\x1a\x16.context.ContextIdList\"\x00\x12\x36\n\x0cListContexts\x12\x0e.context.Empty\x1a\x14.context.ContextList\"\x00\x12\x34\n\nGetContext\x12\x12.context.ContextId\x1a\x10.context.Context\"\x00\x12\x34\n\nSetContext\x12\x10.context.Context\x1a\x12.context.ContextId\"\x00\x12\x35\n\rRemoveContext\x12\x12.context.ContextId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetContextEvents\x12\x0e.context.Empty\x1a\x15.context.ContextEvent\"\x00\x30\x01\x12@\n\x0fListTopologyIds\x12\x12.context.ContextId\x1a\x17.context.TopologyIdList\"\x00\x12=\n\x0eListTopologies\x12\x12.context.ContextId\x1a\x15.context.TopologyList\"\x00\x12\x37\n\x0bGetTopology\x12\x13.context.TopologyId\x1a\x11.context.Topology\"\x00\x12\x37\n\x0bSetTopology\x12\x11.context.Topology\x1a\x13.context.TopologyId\"\x00\x12\x37\n\x0eRemoveTopology\x12\x13.context.TopologyId\x1a\x0e.context.Empty\"\x00\x12?\n\x11GetTopologyEvents\x12\x0e.context.Empty\x1a\x16.context.TopologyEvent\"\x00\x30\x01\x12\x38\n\rListDeviceIds\x12\x0e.context.Empty\x1a\x15.context.DeviceIdList\"\x00\x12\x34\n\x0bListDevices\x12\x0e.context.Empty\x1a\x13.context.DeviceList\"\x00\x12\x31\n\tGetDevice\x12\x11.context.DeviceId\x1a\x0f.context.Device\"\x00\x12\x31\n\tSetDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0cRemoveDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x12;\n\x0fGetDeviceEvents\x12\x0e.context.Empty\x1a\x14.context.DeviceEvent\"\x00\x30\x01\x12\x34\n\x0bListLinkIds\x12\x0e.context.Empty\x1a\x13.context.LinkIdList\"\x00\x12\x30\n\tListLinks\x12\x0e.context.Empty\x1a\x11.context.LinkList\"\x00\x12+\n\x07GetLink\x12\x0f.context.LinkId\x1a\r.context.Link\"\x00\x12+\n\x07SetLink\x12\r.context.Link\x1a\x0f.context.LinkId\"\x00\x12/\n\nRemoveLink\x12\x0f.context.LinkId\x1a\x0e.context.Empty\"\x00\x12\x37\n\rGetLinkEvents\x12\x0e.context.Empty\x1a\x12.context.LinkEvent\"\x00\x30\x01\x12>\n\x0eListServiceIds\x12\x12.context.ContextId\x1a\x16.context.ServiceIdList\"\x00\x12:\n\x0cListServices\x12\x12.context.ContextId\x1a\x14.context.ServiceList\"\x00\x12\x34\n\nGetService\x12\x12.context.ServiceId\x1a\x10.context.Service\"\x00\x12\x34\n\nSetService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rRemoveService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetServiceEvents\x12\x0e.context.Empty\x1a\x15.context.ServiceEvent\"\x00\x30\x01\x12\x44\n\x11ListConnectionIds\x12\x12.context.ServiceId\x1a\x19.context.ConnectionIdList\"\x00\x12@\n\x0fListConnections\x12\x12.context.ServiceId\x1a\x17.context.ConnectionList\"\x00\x12=\n\rGetConnection\x12\x15.context.ConnectionId\x1a\x13.context.Connection\"\x00\x12=\n\rSetConnection\x12\x13.context.Connection\x1a\x15.context.ConnectionId\"\x00\x12;\n\x10RemoveConnection\x12\x15.context.ConnectionId\x1a\x0e.context.Empty\"\x00\x12\x43\n\x13GetConnectionEvents\x12\x0e.context.Empty\x1a\x18.context.ConnectionEvent\"\x00\x30\x01\x62\x06proto3' + serialized_pb=b'\n\rcontext.proto\x12\x07\x63ontext\x1a\x16kpi_sample_types.proto\"\x07\n\x05\x45mpty\"\x14\n\x04Uuid\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"F\n\x05\x45vent\x12\x11\n\ttimestamp\x18\x01 \x01(\x01\x12*\n\nevent_type\x18\x02 \x01(\x0e\x32\x16.context.EventTypeEnum\"0\n\tContextId\x12#\n\x0c\x63ontext_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xb6\x01\n\x07\x43ontext\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12)\n\x0ctopology_ids\x18\x02 \x03(\x0b\x32\x13.context.TopologyId\x12\'\n\x0bservice_ids\x18\x03 \x03(\x0b\x32\x12.context.ServiceId\x12/\n\ncontroller\x18\x04 \x01(\x0b\x32\x1b.context.TeraFlowController\"8\n\rContextIdList\x12\'\n\x0b\x63ontext_ids\x18\x01 \x03(\x0b\x32\x12.context.ContextId\"1\n\x0b\x43ontextList\x12\"\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32\x10.context.Context\"U\n\x0c\x43ontextEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\ncontext_id\x18\x02 \x01(\x0b\x32\x12.context.ContextId\"Z\n\nTopologyId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12$\n\rtopology_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"~\n\x08Topology\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12%\n\ndevice_ids\x18\x02 \x03(\x0b\x32\x11.context.DeviceId\x12!\n\x08link_ids\x18\x03 \x03(\x0b\x32\x0f.context.LinkId\";\n\x0eTopologyIdList\x12)\n\x0ctopology_ids\x18\x01 \x03(\x0b\x32\x13.context.TopologyId\"5\n\x0cTopologyList\x12%\n\ntopologies\x18\x01 \x03(\x0b\x32\x11.context.Topology\"X\n\rTopologyEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12(\n\x0btopology_id\x18\x02 \x01(\x0b\x32\x13.context.TopologyId\".\n\x08\x44\x65viceId\x12\"\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x9a\x02\n\x06\x44\x65vice\x12$\n\tdevice_id\x18\x01 \x01(\x0b\x32\x11.context.DeviceId\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12,\n\rdevice_config\x18\x03 \x01(\x0b\x32\x15.context.DeviceConfig\x12G\n\x19\x64\x65vice_operational_status\x18\x04 \x01(\x0e\x32$.context.DeviceOperationalStatusEnum\x12\x31\n\x0e\x64\x65vice_drivers\x18\x05 \x03(\x0e\x32\x19.context.DeviceDriverEnum\x12+\n\x10\x64\x65vice_endpoints\x18\x06 \x03(\x0b\x32\x11.context.EndPoint\"9\n\x0c\x44\x65viceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"5\n\x0c\x44\x65viceIdList\x12%\n\ndevice_ids\x18\x01 \x03(\x0b\x32\x11.context.DeviceId\".\n\nDeviceList\x12 \n\x07\x64\x65vices\x18\x01 \x03(\x0b\x32\x0f.context.Device\"R\n\x0b\x44\x65viceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"*\n\x06LinkId\x12 \n\tlink_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"X\n\x04Link\x12 \n\x07link_id\x18\x01 \x01(\x0b\x32\x0f.context.LinkId\x12.\n\x11link_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\"/\n\nLinkIdList\x12!\n\x08link_ids\x18\x01 \x03(\x0b\x32\x0f.context.LinkId\"(\n\x08LinkList\x12\x1c\n\x05links\x18\x01 \x03(\x0b\x32\r.context.Link\"L\n\tLinkEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12 \n\x07link_id\x18\x02 \x01(\x0b\x32\x0f.context.LinkId\"X\n\tServiceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12#\n\x0cservice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\xa6\x02\n\x07Service\x12&\n\nservice_id\x18\x01 \x01(\x0b\x32\x12.context.ServiceId\x12.\n\x0cservice_type\x18\x02 \x01(\x0e\x32\x18.context.ServiceTypeEnum\x12\x31\n\x14service_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12\x30\n\x13service_constraints\x18\x04 \x03(\x0b\x32\x13.context.Constraint\x12.\n\x0eservice_status\x18\x05 \x01(\x0b\x32\x16.context.ServiceStatus\x12.\n\x0eservice_config\x18\x06 \x01(\x0b\x32\x16.context.ServiceConfig\"C\n\rServiceStatus\x12\x32\n\x0eservice_status\x18\x01 \x01(\x0e\x32\x1a.context.ServiceStatusEnum\":\n\rServiceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"8\n\rServiceIdList\x12\'\n\x0bservice_ids\x18\x01 \x03(\x0b\x32\x12.context.ServiceId\"1\n\x0bServiceList\x12\"\n\x08services\x18\x01 \x03(\x0b\x32\x10.context.Service\"U\n\x0cServiceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\"T\n\x07SliceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12!\n\nslice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\x95\x02\n\x05Slice\x12\"\n\x08slice_id\x18\x01 \x01(\x0b\x32\x10.context.SliceId\x12/\n\x12slice_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\x12.\n\x11slice_constraints\x18\x03 \x03(\x0b\x32\x13.context.Constraint\x12-\n\x11slice_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\x12,\n\x12slice_subslice_ids\x18\x05 \x03(\x0b\x32\x10.context.SliceId\x12*\n\x0cslice_status\x18\x06 \x01(\x0b\x32\x14.context.SliceStatus\"=\n\x0bSliceStatus\x12.\n\x0cslice_status\x18\x01 \x01(\x0e\x32\x18.context.SliceStatusEnum\"2\n\x0bSliceIdList\x12#\n\tslice_ids\x18\x01 \x03(\x0b\x32\x10.context.SliceId\"+\n\tSliceList\x12\x1e\n\x06slices\x18\x01 \x03(\x0b\x32\x0e.context.Slice\"O\n\nSliceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12\"\n\x08slice_id\x18\x02 \x01(\x0b\x32\x10.context.SliceId\"6\n\x0c\x43onnectionId\x12&\n\x0f\x63onnection_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xc4\x01\n\nConnection\x12,\n\rconnection_id\x18\x01 \x01(\x0b\x32\x15.context.ConnectionId\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\x12\x33\n\x16path_hops_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12+\n\x0fsub_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\"A\n\x10\x43onnectionIdList\x12-\n\x0e\x63onnection_ids\x18\x01 \x03(\x0b\x32\x15.context.ConnectionId\":\n\x0e\x43onnectionList\x12(\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x13.context.Connection\"^\n\x0f\x43onnectionEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12,\n\rconnection_id\x18\x02 \x01(\x0b\x32\x15.context.ConnectionId\"\x82\x01\n\nEndPointId\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\x12$\n\rendpoint_uuid\x18\x03 \x01(\x0b\x32\r.context.Uuid\"\x86\x01\n\x08\x45ndPoint\x12(\n\x0b\x65ndpoint_id\x18\x01 \x01(\x0b\x32\x13.context.EndPointId\x12\x15\n\rendpoint_type\x18\x02 \x01(\t\x12\x39\n\x10kpi_sample_types\x18\x03 \x03(\x0e\x32\x1f.kpi_sample_types.KpiSampleType\"e\n\nConfigRule\x12)\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x19.context.ConfigActionEnum\x12\x14\n\x0cresource_key\x18\x02 \x01(\t\x12\x16\n\x0eresource_value\x18\x03 \x01(\t\"?\n\nConstraint\x12\x17\n\x0f\x63onstraint_type\x18\x01 \x01(\t\x12\x18\n\x10\x63onstraint_value\x18\x02 \x01(\t\"^\n\x12TeraFlowController\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x12\n\nip_address\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\"U\n\x14\x41uthenticationResult\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x15\n\rauthenticated\x18\x02 \x01(\x08*j\n\rEventTypeEnum\x12\x17\n\x13\x45VENTTYPE_UNDEFINED\x10\x00\x12\x14\n\x10\x45VENTTYPE_CREATE\x10\x01\x12\x14\n\x10\x45VENTTYPE_UPDATE\x10\x02\x12\x14\n\x10\x45VENTTYPE_REMOVE\x10\x03*\xc5\x01\n\x10\x44\x65viceDriverEnum\x12\x1a\n\x16\x44\x45VICEDRIVER_UNDEFINED\x10\x00\x12\x1b\n\x17\x44\x45VICEDRIVER_OPENCONFIG\x10\x01\x12\x1e\n\x1a\x44\x45VICEDRIVER_TRANSPORT_API\x10\x02\x12\x13\n\x0f\x44\x45VICEDRIVER_P4\x10\x03\x12&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOGY\x10\x04\x12\x1b\n\x17\x44\x45VICEDRIVER_ONF_TR_352\x10\x05*\x8f\x01\n\x1b\x44\x65viceOperationalStatusEnum\x12%\n!DEVICEOPERATIONALSTATUS_UNDEFINED\x10\x00\x12$\n DEVICEOPERATIONALSTATUS_DISABLED\x10\x01\x12#\n\x1f\x44\x45VICEOPERATIONALSTATUS_ENABLED\x10\x02*\x81\x01\n\x0fServiceTypeEnum\x12\x17\n\x13SERVICETYPE_UNKNOWN\x10\x00\x12\x14\n\x10SERVICETYPE_L3NM\x10\x01\x12\x14\n\x10SERVICETYPE_L2NM\x10\x02\x12)\n%SERVICETYPE_TAPI_CONNECTIVITY_SERVICE\x10\x03*\x88\x01\n\x11ServiceStatusEnum\x12\x1b\n\x17SERVICESTATUS_UNDEFINED\x10\x00\x12\x19\n\x15SERVICESTATUS_PLANNED\x10\x01\x12\x18\n\x14SERVICESTATUS_ACTIVE\x10\x02\x12!\n\x1dSERVICESTATUS_PENDING_REMOVAL\x10\x03*\x8b\x01\n\x0fSliceStatusEnum\x12\x19\n\x15SLICESTATUS_UNDEFINED\x10\x00\x12\x17\n\x13SLICESTATUS_PLANNED\x10\x01\x12\x14\n\x10SLICESTATUS_INIT\x10\x02\x12\x16\n\x12SLICESTATUS_ACTIVE\x10\x03\x12\x16\n\x12SLICESTATUS_DEINIT\x10\x04*]\n\x10\x43onfigActionEnum\x12\x1a\n\x16\x43ONFIGACTION_UNDEFINED\x10\x00\x12\x14\n\x10\x43ONFIGACTION_SET\x10\x01\x12\x17\n\x13\x43ONFIGACTION_DELETE\x10\x02\x32\xef\x12\n\x0e\x43ontextService\x12:\n\x0eListContextIds\x12\x0e.context.Empty\x1a\x16.context.ContextIdList\"\x00\x12\x36\n\x0cListContexts\x12\x0e.context.Empty\x1a\x14.context.ContextList\"\x00\x12\x34\n\nGetContext\x12\x12.context.ContextId\x1a\x10.context.Context\"\x00\x12\x34\n\nSetContext\x12\x10.context.Context\x1a\x12.context.ContextId\"\x00\x12\x35\n\rRemoveContext\x12\x12.context.ContextId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetContextEvents\x12\x0e.context.Empty\x1a\x15.context.ContextEvent\"\x00\x30\x01\x12@\n\x0fListTopologyIds\x12\x12.context.ContextId\x1a\x17.context.TopologyIdList\"\x00\x12=\n\x0eListTopologies\x12\x12.context.ContextId\x1a\x15.context.TopologyList\"\x00\x12\x37\n\x0bGetTopology\x12\x13.context.TopologyId\x1a\x11.context.Topology\"\x00\x12\x37\n\x0bSetTopology\x12\x11.context.Topology\x1a\x13.context.TopologyId\"\x00\x12\x37\n\x0eRemoveTopology\x12\x13.context.TopologyId\x1a\x0e.context.Empty\"\x00\x12?\n\x11GetTopologyEvents\x12\x0e.context.Empty\x1a\x16.context.TopologyEvent\"\x00\x30\x01\x12\x38\n\rListDeviceIds\x12\x0e.context.Empty\x1a\x15.context.DeviceIdList\"\x00\x12\x34\n\x0bListDevices\x12\x0e.context.Empty\x1a\x13.context.DeviceList\"\x00\x12\x31\n\tGetDevice\x12\x11.context.DeviceId\x1a\x0f.context.Device\"\x00\x12\x31\n\tSetDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0cRemoveDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x12;\n\x0fGetDeviceEvents\x12\x0e.context.Empty\x1a\x14.context.DeviceEvent\"\x00\x30\x01\x12\x34\n\x0bListLinkIds\x12\x0e.context.Empty\x1a\x13.context.LinkIdList\"\x00\x12\x30\n\tListLinks\x12\x0e.context.Empty\x1a\x11.context.LinkList\"\x00\x12+\n\x07GetLink\x12\x0f.context.LinkId\x1a\r.context.Link\"\x00\x12+\n\x07SetLink\x12\r.context.Link\x1a\x0f.context.LinkId\"\x00\x12/\n\nRemoveLink\x12\x0f.context.LinkId\x1a\x0e.context.Empty\"\x00\x12\x37\n\rGetLinkEvents\x12\x0e.context.Empty\x1a\x12.context.LinkEvent\"\x00\x30\x01\x12>\n\x0eListServiceIds\x12\x12.context.ContextId\x1a\x16.context.ServiceIdList\"\x00\x12:\n\x0cListServices\x12\x12.context.ContextId\x1a\x14.context.ServiceList\"\x00\x12\x34\n\nGetService\x12\x12.context.ServiceId\x1a\x10.context.Service\"\x00\x12\x34\n\nSetService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rRemoveService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetServiceEvents\x12\x0e.context.Empty\x1a\x15.context.ServiceEvent\"\x00\x30\x01\x12:\n\x0cListSliceIds\x12\x12.context.ContextId\x1a\x14.context.SliceIdList\"\x00\x12\x36\n\nListSlices\x12\x12.context.ContextId\x1a\x12.context.SliceList\"\x00\x12.\n\x08GetSlice\x12\x10.context.SliceId\x1a\x0e.context.Slice\"\x00\x12.\n\x08SetSlice\x12\x0e.context.Slice\x1a\x10.context.SliceId\"\x00\x12\x31\n\x0bRemoveSlice\x12\x10.context.SliceId\x1a\x0e.context.Empty\"\x00\x12\x39\n\x0eGetSliceEvents\x12\x0e.context.Empty\x1a\x13.context.SliceEvent\"\x00\x30\x01\x12\x44\n\x11ListConnectionIds\x12\x12.context.ServiceId\x1a\x19.context.ConnectionIdList\"\x00\x12@\n\x0fListConnections\x12\x12.context.ServiceId\x1a\x17.context.ConnectionList\"\x00\x12=\n\rGetConnection\x12\x15.context.ConnectionId\x1a\x13.context.Connection\"\x00\x12=\n\rSetConnection\x12\x13.context.Connection\x1a\x15.context.ConnectionId\"\x00\x12;\n\x10RemoveConnection\x12\x15.context.ConnectionId\x1a\x0e.context.Empty\"\x00\x12\x43\n\x13GetConnectionEvents\x12\x0e.context.Empty\x1a\x18.context.ConnectionEvent\"\x00\x30\x01\x62\x06proto3' , dependencies=[kpi__sample__types__pb2.DESCRIPTOR,]) @@ -55,8 +55,8 @@ _EVENTTYPEENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=3703, - serialized_end=3809, + serialized_start=4310, + serialized_end=4416, ) _sym_db.RegisterEnumDescriptor(_EVENTTYPEENUM) @@ -101,8 +101,8 @@ _DEVICEDRIVERENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=3812, - serialized_end=4009, + serialized_start=4419, + serialized_end=4616, ) _sym_db.RegisterEnumDescriptor(_DEVICEDRIVERENUM) @@ -132,8 +132,8 @@ _DEVICEOPERATIONALSTATUSENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4012, - serialized_end=4155, + serialized_start=4619, + serialized_end=4762, ) _sym_db.RegisterEnumDescriptor(_DEVICEOPERATIONALSTATUSENUM) @@ -168,8 +168,8 @@ _SERVICETYPEENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4158, - serialized_end=4287, + serialized_start=4765, + serialized_end=4894, ) _sym_db.RegisterEnumDescriptor(_SERVICETYPEENUM) @@ -204,12 +204,53 @@ _SERVICESTATUSENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4290, - serialized_end=4426, + serialized_start=4897, + serialized_end=5033, ) _sym_db.RegisterEnumDescriptor(_SERVICESTATUSENUM) ServiceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICESTATUSENUM) +_SLICESTATUSENUM = _descriptor.EnumDescriptor( + name='SliceStatusEnum', + full_name='context.SliceStatusEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_PLANNED', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_INIT', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_ACTIVE', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_DEINIT', index=4, number=4, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=5036, + serialized_end=5175, +) +_sym_db.RegisterEnumDescriptor(_SLICESTATUSENUM) + +SliceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SLICESTATUSENUM) _CONFIGACTIONENUM = _descriptor.EnumDescriptor( name='ConfigActionEnum', full_name='context.ConfigActionEnum', @@ -235,8 +276,8 @@ _CONFIGACTIONENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4428, - serialized_end=4521, + serialized_start=5177, + serialized_end=5270, ) _sym_db.RegisterEnumDescriptor(_CONFIGACTIONENUM) @@ -262,6 +303,11 @@ SERVICESTATUS_UNDEFINED = 0 SERVICESTATUS_PLANNED = 1 SERVICESTATUS_ACTIVE = 2 SERVICESTATUS_PENDING_REMOVAL = 3 +SLICESTATUS_UNDEFINED = 0 +SLICESTATUS_PLANNED = 1 +SLICESTATUS_INIT = 2 +SLICESTATUS_ACTIVE = 3 +SLICESTATUS_DEINIT = 4 CONFIGACTION_UNDEFINED = 0 CONFIGACTION_SET = 1 CONFIGACTION_DELETE = 2 @@ -1421,6 +1467,247 @@ _SERVICEEVENT = _descriptor.Descriptor( ) +_SLICEID = _descriptor.Descriptor( + name='SliceId', + full_name='context.SliceId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_id', full_name='context.SliceId.context_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_uuid', full_name='context.SliceId.slice_uuid', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2604, + serialized_end=2688, +) + + +_SLICE = _descriptor.Descriptor( + name='Slice', + full_name='context.Slice', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_id', full_name='context.Slice.slice_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_endpoint_ids', full_name='context.Slice.slice_endpoint_ids', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_constraints', full_name='context.Slice.slice_constraints', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_service_ids', full_name='context.Slice.slice_service_ids', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_subslice_ids', full_name='context.Slice.slice_subslice_ids', index=4, + number=5, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_status', full_name='context.Slice.slice_status', index=5, + number=6, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2691, + serialized_end=2968, +) + + +_SLICESTATUS = _descriptor.Descriptor( + name='SliceStatus', + full_name='context.SliceStatus', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_status', full_name='context.SliceStatus.slice_status', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2970, + serialized_end=3031, +) + + +_SLICEIDLIST = _descriptor.Descriptor( + name='SliceIdList', + full_name='context.SliceIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_ids', full_name='context.SliceIdList.slice_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3033, + serialized_end=3083, +) + + +_SLICELIST = _descriptor.Descriptor( + name='SliceList', + full_name='context.SliceList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slices', full_name='context.SliceList.slices', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3085, + serialized_end=3128, +) + + +_SLICEEVENT = _descriptor.Descriptor( + name='SliceEvent', + full_name='context.SliceEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.SliceEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_id', full_name='context.SliceEvent.slice_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3130, + serialized_end=3209, +) + + _CONNECTIONID = _descriptor.Descriptor( name='ConnectionId', full_name='context.ConnectionId', @@ -1448,8 +1735,8 @@ _CONNECTIONID = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2604, - serialized_end=2658, + serialized_start=3211, + serialized_end=3265, ) @@ -1501,8 +1788,8 @@ _CONNECTION = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2661, - serialized_end=2857, + serialized_start=3268, + serialized_end=3464, ) @@ -1533,8 +1820,8 @@ _CONNECTIONIDLIST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2859, - serialized_end=2924, + serialized_start=3466, + serialized_end=3531, ) @@ -1565,8 +1852,8 @@ _CONNECTIONLIST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2926, - serialized_end=2984, + serialized_start=3533, + serialized_end=3591, ) @@ -1604,8 +1891,8 @@ _CONNECTIONEVENT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2986, - serialized_end=3080, + serialized_start=3593, + serialized_end=3687, ) @@ -1650,8 +1937,8 @@ _ENDPOINTID = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3083, - serialized_end=3213, + serialized_start=3690, + serialized_end=3820, ) @@ -1696,8 +1983,8 @@ _ENDPOINT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3216, - serialized_end=3350, + serialized_start=3823, + serialized_end=3957, ) @@ -1742,8 +2029,8 @@ _CONFIGRULE = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3352, - serialized_end=3453, + serialized_start=3959, + serialized_end=4060, ) @@ -1781,8 +2068,8 @@ _CONSTRAINT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3455, - serialized_end=3518, + serialized_start=4062, + serialized_end=4125, ) @@ -1827,8 +2114,8 @@ _TERAFLOWCONTROLLER = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3520, - serialized_end=3614, + serialized_start=4127, + serialized_end=4221, ) @@ -1866,8 +2153,8 @@ _AUTHENTICATIONRESULT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3616, - serialized_end=3701, + serialized_start=4223, + serialized_end=4308, ) _EVENT.fields_by_name['event_type'].enum_type = _EVENTTYPEENUM @@ -1921,6 +2208,19 @@ _SERVICEIDLIST.fields_by_name['service_ids'].message_type = _SERVICEID _SERVICELIST.fields_by_name['services'].message_type = _SERVICE _SERVICEEVENT.fields_by_name['event'].message_type = _EVENT _SERVICEEVENT.fields_by_name['service_id'].message_type = _SERVICEID +_SLICEID.fields_by_name['context_id'].message_type = _CONTEXTID +_SLICEID.fields_by_name['slice_uuid'].message_type = _UUID +_SLICE.fields_by_name['slice_id'].message_type = _SLICEID +_SLICE.fields_by_name['slice_endpoint_ids'].message_type = _ENDPOINTID +_SLICE.fields_by_name['slice_constraints'].message_type = _CONSTRAINT +_SLICE.fields_by_name['slice_service_ids'].message_type = _SERVICEID +_SLICE.fields_by_name['slice_subslice_ids'].message_type = _SLICEID +_SLICE.fields_by_name['slice_status'].message_type = _SLICESTATUS +_SLICESTATUS.fields_by_name['slice_status'].enum_type = _SLICESTATUSENUM +_SLICEIDLIST.fields_by_name['slice_ids'].message_type = _SLICEID +_SLICELIST.fields_by_name['slices'].message_type = _SLICE +_SLICEEVENT.fields_by_name['event'].message_type = _EVENT +_SLICEEVENT.fields_by_name['slice_id'].message_type = _SLICEID _CONNECTIONID.fields_by_name['connection_uuid'].message_type = _UUID _CONNECTION.fields_by_name['connection_id'].message_type = _CONNECTIONID _CONNECTION.fields_by_name['service_id'].message_type = _SERVICEID @@ -1969,6 +2269,12 @@ DESCRIPTOR.message_types_by_name['ServiceConfig'] = _SERVICECONFIG DESCRIPTOR.message_types_by_name['ServiceIdList'] = _SERVICEIDLIST DESCRIPTOR.message_types_by_name['ServiceList'] = _SERVICELIST DESCRIPTOR.message_types_by_name['ServiceEvent'] = _SERVICEEVENT +DESCRIPTOR.message_types_by_name['SliceId'] = _SLICEID +DESCRIPTOR.message_types_by_name['Slice'] = _SLICE +DESCRIPTOR.message_types_by_name['SliceStatus'] = _SLICESTATUS +DESCRIPTOR.message_types_by_name['SliceIdList'] = _SLICEIDLIST +DESCRIPTOR.message_types_by_name['SliceList'] = _SLICELIST +DESCRIPTOR.message_types_by_name['SliceEvent'] = _SLICEEVENT DESCRIPTOR.message_types_by_name['ConnectionId'] = _CONNECTIONID DESCRIPTOR.message_types_by_name['Connection'] = _CONNECTION DESCRIPTOR.message_types_by_name['ConnectionIdList'] = _CONNECTIONIDLIST @@ -1985,6 +2291,7 @@ DESCRIPTOR.enum_types_by_name['DeviceDriverEnum'] = _DEVICEDRIVERENUM DESCRIPTOR.enum_types_by_name['DeviceOperationalStatusEnum'] = _DEVICEOPERATIONALSTATUSENUM DESCRIPTOR.enum_types_by_name['ServiceTypeEnum'] = _SERVICETYPEENUM DESCRIPTOR.enum_types_by_name['ServiceStatusEnum'] = _SERVICESTATUSENUM +DESCRIPTOR.enum_types_by_name['SliceStatusEnum'] = _SLICESTATUSENUM DESCRIPTOR.enum_types_by_name['ConfigActionEnum'] = _CONFIGACTIONENUM _sym_db.RegisterFileDescriptor(DESCRIPTOR) @@ -2205,6 +2512,48 @@ ServiceEvent = _reflection.GeneratedProtocolMessageType('ServiceEvent', (_messag }) _sym_db.RegisterMessage(ServiceEvent) +SliceId = _reflection.GeneratedProtocolMessageType('SliceId', (_message.Message,), { + 'DESCRIPTOR' : _SLICEID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceId) + }) +_sym_db.RegisterMessage(SliceId) + +Slice = _reflection.GeneratedProtocolMessageType('Slice', (_message.Message,), { + 'DESCRIPTOR' : _SLICE, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Slice) + }) +_sym_db.RegisterMessage(Slice) + +SliceStatus = _reflection.GeneratedProtocolMessageType('SliceStatus', (_message.Message,), { + 'DESCRIPTOR' : _SLICESTATUS, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceStatus) + }) +_sym_db.RegisterMessage(SliceStatus) + +SliceIdList = _reflection.GeneratedProtocolMessageType('SliceIdList', (_message.Message,), { + 'DESCRIPTOR' : _SLICEIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceIdList) + }) +_sym_db.RegisterMessage(SliceIdList) + +SliceList = _reflection.GeneratedProtocolMessageType('SliceList', (_message.Message,), { + 'DESCRIPTOR' : _SLICELIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceList) + }) +_sym_db.RegisterMessage(SliceList) + +SliceEvent = _reflection.GeneratedProtocolMessageType('SliceEvent', (_message.Message,), { + 'DESCRIPTOR' : _SLICEEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceEvent) + }) +_sym_db.RegisterMessage(SliceEvent) + ConnectionId = _reflection.GeneratedProtocolMessageType('ConnectionId', (_message.Message,), { 'DESCRIPTOR' : _CONNECTIONID, '__module__' : 'context_pb2' @@ -2291,8 +2640,8 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( index=0, serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_start=4524, - serialized_end=6617, + serialized_start=5273, + serialized_end=7688, methods=[ _descriptor.MethodDescriptor( name='ListContextIds', @@ -2594,10 +2943,70 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( serialized_options=None, create_key=_descriptor._internal_create_key, ), + _descriptor.MethodDescriptor( + name='ListSliceIds', + full_name='context.ContextService.ListSliceIds', + index=30, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SLICEIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListSlices', + full_name='context.ContextService.ListSlices', + index=31, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SLICELIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetSlice', + full_name='context.ContextService.GetSlice', + index=32, + containing_service=None, + input_type=_SLICEID, + output_type=_SLICE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetSlice', + full_name='context.ContextService.SetSlice', + index=33, + containing_service=None, + input_type=_SLICE, + output_type=_SLICEID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveSlice', + full_name='context.ContextService.RemoveSlice', + index=34, + containing_service=None, + input_type=_SLICEID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetSliceEvents', + full_name='context.ContextService.GetSliceEvents', + index=35, + containing_service=None, + input_type=_EMPTY, + output_type=_SLICEEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), _descriptor.MethodDescriptor( name='ListConnectionIds', full_name='context.ContextService.ListConnectionIds', - index=30, + index=36, containing_service=None, input_type=_SERVICEID, output_type=_CONNECTIONIDLIST, @@ -2607,7 +3016,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='ListConnections', full_name='context.ContextService.ListConnections', - index=31, + index=37, containing_service=None, input_type=_SERVICEID, output_type=_CONNECTIONLIST, @@ -2617,7 +3026,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='GetConnection', full_name='context.ContextService.GetConnection', - index=32, + index=38, containing_service=None, input_type=_CONNECTIONID, output_type=_CONNECTION, @@ -2627,7 +3036,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='SetConnection', full_name='context.ContextService.SetConnection', - index=33, + index=39, containing_service=None, input_type=_CONNECTION, output_type=_CONNECTIONID, @@ -2637,7 +3046,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='RemoveConnection', full_name='context.ContextService.RemoveConnection', - index=34, + index=40, containing_service=None, input_type=_CONNECTIONID, output_type=_EMPTY, @@ -2647,7 +3056,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='GetConnectionEvents', full_name='context.ContextService.GetConnectionEvents', - index=35, + index=41, containing_service=None, input_type=_EMPTY, output_type=_CONNECTIONEVENT, diff --git a/src/device/requirements.in b/src/device/requirements.in index dde08cf195ecb503c7a10f75a2df9ca9f1a0c651..3bac91e712575d62a6a3809f56a663427a36e5c3 100644 --- a/src/device/requirements.in +++ b/src/device/requirements.in @@ -4,7 +4,7 @@ fastcache==1.1.0 grpcio==1.43.0 grpcio-health-checking==1.43.0 Jinja2==3.0.3 -netconf-client==2.0.0 #1.7.3 +ncclient==0.6.13 p4runtime==1.3.0 paramiko==2.9.2 prometheus-client==0.13.0 diff --git a/src/device/service/DeviceService.py b/src/device/service/DeviceService.py index bb2cc09535af579a24cf05687d2883d81c7c914b..4f9b032e8a224e89e48daebf52687cc892ca534a 100644 --- a/src/device/service/DeviceService.py +++ b/src/device/service/DeviceService.py @@ -12,76 +12,29 @@ # See the License for the specific language governing permissions and # limitations under the License. -import grpc, logging -from concurrent import futures -from grpc_health.v1.health import HealthServicer, OVERALL_HEALTH -from grpc_health.v1.health_pb2 import HealthCheckResponse -from grpc_health.v1.health_pb2_grpc import add_HealthServicer_to_server +from common.Constants import ServiceNameEnum +from common.Settings import get_service_port_grpc from common.orm.backend.BackendEnum import BackendEnum from common.orm.Database import Database from common.orm.Factory import get_database_backend -from context.client.ContextClient import ContextClient -from device.Config import GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD +from common.tools.service.GenericGrpcService import GenericGrpcService from device.proto.device_pb2_grpc import add_DeviceServiceServicer_to_server -from monitoring.client.monitoring_client import MonitoringClient from .driver_api.DriverInstanceCache import DriverInstanceCache from .DeviceServiceServicerImpl import DeviceServiceServicerImpl from .MonitoringLoops import MonitoringLoops -BIND_ADDRESS = '0.0.0.0' -LOGGER = logging.getLogger(__name__) - -class DeviceService: - def __init__( - self, context_client : ContextClient, monitoring_client : MonitoringClient, - driver_instance_cache : DriverInstanceCache, - address=BIND_ADDRESS, port=GRPC_SERVICE_PORT, max_workers=GRPC_MAX_WORKERS, grace_period=GRPC_GRACE_PERIOD): - - self.context_client = context_client - self.monitoring_client = monitoring_client - self.driver_instance_cache = driver_instance_cache - self.address = address - self.port = port - self.endpoint = None - self.max_workers = max_workers - self.grace_period = grace_period - self.device_servicer = None - self.health_servicer = None - self.pool = None - self.server = None - - self.database = Database(get_database_backend(backend=BackendEnum.INMEMORY)) - self.monitoring_loops = MonitoringLoops(monitoring_client, self.database) - - def start(self): - self.endpoint = '{:s}:{:s}'.format(str(self.address), str(self.port)) - LOGGER.info('Starting Service (tentative endpoint: {:s}, max_workers: {:s})...'.format( - str(self.endpoint), str(self.max_workers))) +class DeviceService(GenericGrpcService): + def __init__(self, driver_instance_cache : DriverInstanceCache, cls_name: str = __name__) -> None: + port = get_service_port_grpc(ServiceNameEnum.DEVICE) + super().__init__(port, cls_name=cls_name) + database = Database(get_database_backend(backend=BackendEnum.INMEMORY)) + self.monitoring_loops = MonitoringLoops(database) + self.device_servicer = DeviceServiceServicerImpl(database, driver_instance_cache, self.monitoring_loops) + def install_servicers(self): self.monitoring_loops.start() - - self.pool = futures.ThreadPoolExecutor(max_workers=self.max_workers) - self.server = grpc.server(self.pool) # , interceptors=(tracer_interceptor,)) - - self.device_servicer = DeviceServiceServicerImpl( - self.context_client, self.database, self.driver_instance_cache, self.monitoring_loops) add_DeviceServiceServicer_to_server(self.device_servicer, self.server) - self.health_servicer = HealthServicer( - experimental_non_blocking=True, experimental_thread_pool=futures.ThreadPoolExecutor(max_workers=1)) - add_HealthServicer_to_server(self.health_servicer, self.server) - - port = self.server.add_insecure_port(self.endpoint) - self.endpoint = '{:s}:{:s}'.format(str(self.address), str(port)) - LOGGER.info('Listening on {:s}...'.format(str(self.endpoint))) - self.server.start() - self.health_servicer.set(OVERALL_HEALTH, HealthCheckResponse.SERVING) # pylint: disable=maybe-no-member - - LOGGER.debug('Service started') - def stop(self): - LOGGER.debug('Stopping service (grace period {:s} seconds)...'.format(str(self.grace_period))) - self.health_servicer.enter_graceful_shutdown() - self.server.stop(self.grace_period) + super().stop() self.monitoring_loops.stop() - LOGGER.debug('Service stopped') diff --git a/src/device/service/DeviceServiceServicerImpl.py b/src/device/service/DeviceServiceServicerImpl.py index 8e00b344f0462ae56b289cfc5d33e6c1b1c42b7e..e328c76cdd29147163adc9713c86fc0efc31555d 100644 --- a/src/device/service/DeviceServiceServicerImpl.py +++ b/src/device/service/DeviceServiceServicerImpl.py @@ -49,11 +49,10 @@ METRICS = create_metrics(SERVICE_NAME, METHOD_NAMES) class DeviceServiceServicerImpl(DeviceServiceServicer): def __init__( - self, context_client : ContextClient, database : Database, driver_instance_cache : DriverInstanceCache, - monitoring_loops : MonitoringLoops): - + self, database : Database, driver_instance_cache : DriverInstanceCache, monitoring_loops : MonitoringLoops + ) -> None: LOGGER.debug('Creating Servicer...') - self.context_client = context_client + self.context_client = ContextClient() self.database = database self.driver_instance_cache = driver_instance_cache self.monitoring_loops = monitoring_loops diff --git a/src/device/service/MonitoringLoops.py b/src/device/service/MonitoringLoops.py index e5b671f7f06beade5ab9f8b6539527999d49b9e8..eff634c75537ed26fd77f02f6adb85f0b0555aa8 100644 --- a/src/device/service/MonitoringLoops.py +++ b/src/device/service/MonitoringLoops.py @@ -18,7 +18,7 @@ from typing import Dict from common.orm.Database import Database from common.orm.HighLevel import get_object from common.orm.backend.Tools import key_to_str -from monitoring.client.monitoring_client import MonitoringClient +from monitoring.client.MonitoringClient import MonitoringClient from monitoring.proto.monitoring_pb2 import Kpi from .database.KpiModel import KpiModel from .database.RelationModels import EndPointMonitorKpiModel @@ -55,8 +55,8 @@ class MonitoringLoop: self._collector_thread.join() class MonitoringLoops: - def __init__(self, monitoring_client : MonitoringClient, database : Database) -> None: - self._monitoring_client = monitoring_client + def __init__(self, database : Database) -> None: + self._monitoring_client = MonitoringClient() self._database = database self._samples_queue = queue.Queue() self._running = threading.Event() @@ -82,7 +82,6 @@ class MonitoringLoops: def start(self): self._exporter_thread.start() - self._running.set() @property def is_running(self): return self._running.is_set() @@ -96,6 +95,7 @@ class MonitoringLoops: LOGGER.error('[MonitoringLoops:_export] Database not set. Terminating Exporter.') return + self._running.set() while not self._terminate.is_set(): try: sample = self._samples_queue.get(block=True, timeout=QUEUE_GET_WAIT_TIMEOUT) @@ -149,3 +149,5 @@ class MonitoringLoops: })) except: # pylint: disable=bare-except LOGGER.exception('Unable to format/send Kpi') + + self._running.clear() diff --git a/src/device/service/__main__.py b/src/device/service/__main__.py index 0e92cabba4ddae84a9d4cd938c7e8b31ab4f0531..1f0adfa8f1dd8b3e307ed202967b1d5195171f11 100644 --- a/src/device/service/__main__.py +++ b/src/device/service/__main__.py @@ -14,12 +14,10 @@ import logging, signal, sys, threading from prometheus_client import start_http_server -from common.Settings import get_setting, wait_for_environment_variables -from context.client.ContextClient import ContextClient -from device.Config import ( - CONTEXT_SERVICE_HOST, CONTEXT_SERVICE_PORT, GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD, LOG_LEVEL, - METRICS_PORT, MONITORING_SERVICE_HOST, MONITORING_SERVICE_PORT) -from monitoring.client.monitoring_client import MonitoringClient +from common.Constants import ServiceNameEnum +from common.Settings import ( + ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_log_level, get_metrics_port, + wait_for_environment_variables) from .DeviceService import DeviceService from .driver_api.DriverFactory import DriverFactory from .driver_api.DriverInstanceCache import DriverInstanceCache @@ -35,12 +33,7 @@ def signal_handler(signal, frame): # pylint: disable=redefined-outer-name def main(): global LOGGER # pylint: disable=global-statement - grpc_service_port = get_setting('DEVICESERVICE_SERVICE_PORT_GRPC', default=GRPC_SERVICE_PORT ) - max_workers = get_setting('MAX_WORKERS', default=GRPC_MAX_WORKERS ) - grace_period = get_setting('GRACE_PERIOD', default=GRPC_GRACE_PERIOD ) - log_level = get_setting('LOG_LEVEL', default=LOG_LEVEL ) - metrics_port = get_setting('METRICS_PORT', default=METRICS_PORT ) - + log_level = get_log_level() logging.basicConfig(level=log_level) logging.getLogger('apscheduler.executors.default').setLevel(logging.WARNING) logging.getLogger('apscheduler.scheduler').setLevel(logging.WARNING) @@ -48,43 +41,25 @@ def main(): LOGGER = logging.getLogger(__name__) wait_for_environment_variables([ - 'CONTEXTSERVICE_SERVICE_HOST', 'CONTEXTSERVICE_SERVICE_PORT_GRPC', - 'MONITORINGSERVICE_SERVICE_HOST', 'MONITORINGSERVICE_SERVICE_PORT_GRPC' + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_HOST ), + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC), ]) - context_service_host = get_setting('CONTEXTSERVICE_SERVICE_HOST', default=CONTEXT_SERVICE_HOST ) - context_service_port = get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC', default=CONTEXT_SERVICE_PORT ) - monitoring_service_host = get_setting('MONITORINGSERVICE_SERVICE_HOST', default=MONITORING_SERVICE_HOST) - monitoring_service_port = get_setting('MONITORINGSERVICE_SERVICE_PORT_GRPC', default=MONITORING_SERVICE_PORT) - signal.signal(signal.SIGINT, signal_handler) signal.signal(signal.SIGTERM, signal_handler) LOGGER.info('Starting...') # Start metrics server + metrics_port = get_metrics_port() start_http_server(metrics_port) - # Initialize Context Client - if context_service_host is None or context_service_port is None: - raise Exception('Wrong address({:s}):port({:s}) of Context component'.format( - str(context_service_host), str(context_service_port))) - context_client = ContextClient(context_service_host, context_service_port) - - # Initialize Monitoring Client - if monitoring_service_host is None or monitoring_service_port is None: - raise Exception('Wrong address({:s}):port({:s}) of Monitoring component'.format( - str(monitoring_service_host), str(monitoring_service_port))) - monitoring_client = MonitoringClient(monitoring_service_host, monitoring_service_port) - # Initialize Driver framework driver_factory = DriverFactory(DRIVERS) driver_instance_cache = DriverInstanceCache(driver_factory) # Starting device service - grpc_service = DeviceService( - context_client, monitoring_client, driver_instance_cache, port=grpc_service_port, max_workers=max_workers, - grace_period=grace_period) + grpc_service = DeviceService(driver_instance_cache) grpc_service.start() # Wait for Ctrl+C or termination signal diff --git a/src/device/service/database/EndPointModel.py b/src/device/service/database/EndPointModel.py index 286a51db69738782a6d1acaed5b1d7846ac67b2b..84d0c97073481af162b1e66f7e35c93bc6e1eed5 100644 --- a/src/device/service/database/EndPointModel.py +++ b/src/device/service/database/EndPointModel.py @@ -15,6 +15,7 @@ import logging from typing import Dict, List from common.orm.Database import Database +from common.orm.HighLevel import update_or_create_object from common.orm.backend.Tools import key_to_str from common.orm.fields.EnumeratedField import EnumeratedField from common.orm.fields.ForeignKeyField import ForeignKeyField @@ -72,9 +73,14 @@ def set_endpoint_monitors(database : Database, db_endpoint : EndPointModel, grpc db_endpoint_pk = db_endpoint.pk for kpi_sample_type in grpc_endpoint_kpi_sample_types: orm_kpi_sample_type = grpc_to_enum__kpi_sample_type(kpi_sample_type) - str_endpoint_kpi_sample_type_key = key_to_str([db_endpoint_pk, orm_kpi_sample_type.name]) - db_endpoint_kpi_sample_type = EndPointMonitorModel(database, str_endpoint_kpi_sample_type_key) - db_endpoint_kpi_sample_type.endpoint_fk = db_endpoint - db_endpoint_kpi_sample_type.resource_key = '' # during initialization, allow empty value - db_endpoint_kpi_sample_type.kpi_sample_type = orm_kpi_sample_type - db_endpoint_kpi_sample_type.save() + str_endpoint_kpi_sample_type_key = key_to_str([db_endpoint_pk, str(orm_kpi_sample_type.value)]) + #db_endpoint_kpi_sample_type = EndPointMonitorModel(database, str_endpoint_kpi_sample_type_key) + #db_endpoint_kpi_sample_type.endpoint_fk = db_endpoint + #db_endpoint_kpi_sample_type.resource_key = '' # during initialization, allow empty value + #db_endpoint_kpi_sample_type.kpi_sample_type = orm_kpi_sample_type + #db_endpoint_kpi_sample_type.save() + update_or_create_object(database, EndPointMonitorModel, str_endpoint_kpi_sample_type_key, { + 'endpoint_fk' : db_endpoint, + #'resource_key' : '', # during initialization, allow empty value + 'kpi_sample_type': orm_kpi_sample_type, + }) diff --git a/src/device/service/driver_api/DriverFactory.py b/src/device/service/driver_api/DriverFactory.py index 1e79b4ba45593d3f24f7193648010071d766ec58..b2b6c467a9d7c941a430e7bc7aaa1ab123053750 100644 --- a/src/device/service/driver_api/DriverFactory.py +++ b/src/device/service/driver_api/DriverFactory.py @@ -76,6 +76,7 @@ class DriverFactory: field_candidate_driver_classes = field_candidate_driver_classes.union(field_indice_drivers) if candidate_driver_classes is None: + if len(field_candidate_driver_classes) == 0: continue candidate_driver_classes = {k:1 for k in field_candidate_driver_classes} else: for candidate_driver_class in candidate_driver_classes: diff --git a/src/device/service/driver_api/_Driver.py b/src/device/service/driver_api/_Driver.py index f30165a178a5946c414157da5d09df07bf060a39..7dbb9eddb238dcaae9d00b579a1851aacf53225d 100644 --- a/src/device/service/driver_api/_Driver.py +++ b/src/device/service/driver_api/_Driver.py @@ -21,6 +21,7 @@ RESOURCE_ENDPOINTS = '__endpoints__' RESOURCE_INTERFACES = '__interfaces__' RESOURCE_NETWORK_INSTANCES = '__network_instances__' RESOURCE_ROUTING_POLICIES = '__routing_policies__' +RESOURCE_ACL = '__acl__' class _Driver: def __init__(self, address : str, port : int, **settings) -> None: diff --git a/src/device/service/drivers/__init__.py b/src/device/service/drivers/__init__.py index 7479d43641b1ecd0803b3c790f51256a03e2c7fa..40912f50b98f1d5fc9555d87a4855a12ab8e0c07 100644 --- a/src/device/service/drivers/__init__.py +++ b/src/device/service/drivers/__init__.py @@ -18,10 +18,16 @@ from .emulated.EmulatedDriver import EmulatedDriver from .openconfig.OpenConfigDriver import OpenConfigDriver from .transport_api.TransportApiDriver import TransportApiDriver from .p4.p4_driver import P4Driver +from .microwave.IETFApiDriver import IETFApiDriver DRIVERS = [ (EmulatedDriver, [ { + # Driver==unspecified & no device type specified => use Emulated + FilterFieldEnum.DRIVER: ORM_DeviceDriverEnum.UNDEFINED, + }, + { + # Emulated OLS/Packet Router, specifying Undefined/OpenConfig/TAPI Driver => use EmulatedDriver FilterFieldEnum.DEVICE_TYPE: [ DeviceTypeEnum.EMULATED_OPTICAL_LINE_SYSTEM, DeviceTypeEnum.EMULATED_PACKET_ROUTER, @@ -35,20 +41,29 @@ DRIVERS = [ ]), (OpenConfigDriver, [ { + # Real Packet Router, specifying OpenConfig Driver => use OpenConfigDriver FilterFieldEnum.DEVICE_TYPE: DeviceTypeEnum.PACKET_ROUTER, FilterFieldEnum.DRIVER : ORM_DeviceDriverEnum.OPENCONFIG, } ]), (TransportApiDriver, [ { + # Real OLS, specifying TAPI Driver => use TransportApiDriver FilterFieldEnum.DEVICE_TYPE: DeviceTypeEnum.OPTICAL_LINE_SYSTEM, FilterFieldEnum.DRIVER : ORM_DeviceDriverEnum.TRANSPORT_API, } ]), (P4Driver, [ { + # Real P4 Switch, specifying P4 Driver => use P4Driver FilterFieldEnum.DEVICE_TYPE: DeviceTypeEnum.P4_SWITCH, FilterFieldEnum.DRIVER : ORM_DeviceDriverEnum.P4, } ]), + (IETFApiDriver, [ + { + FilterFieldEnum.DEVICE_TYPE: DeviceTypeEnum.MICROVAWE_RADIO_SYSTEM, + FilterFieldEnum.DRIVER : ORM_DeviceDriverEnum.IETF_NETWORK_TOPOLOGY, + } + ]), ] diff --git a/src/device/service/drivers/microwave/IETFApiDriver.py b/src/device/service/drivers/microwave/IETFApiDriver.py new file mode 100644 index 0000000000000000000000000000000000000000..4d5ec439f4085575fc0f7fddb228d30dab3010b5 --- /dev/null +++ b/src/device/service/drivers/microwave/IETFApiDriver.py @@ -0,0 +1,110 @@ +# 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. + +import logging, requests, threading +from typing import Any, Iterator, List, Optional, Tuple, Union +from common.type_checkers.Checkers import chk_string, chk_type +from device.service.driver_api._Driver import _Driver +from . import ALL_RESOURCE_KEYS +from .Tools import create_connectivity_service, find_key, config_getter, delete_connectivity_service + +LOGGER = logging.getLogger(__name__) + +class IETFApiDriver(_Driver): + def __init__(self, address: str, port: int, **settings) -> None: # pylint: disable=super-init-not-called + self.__lock = threading.Lock() + self.__started = threading.Event() + self.__terminate = threading.Event() + self.__ietf_root = 'https://' + address + ':' + str(port) + self.__timeout = int(settings.get('timeout', 120)) + + def Connect(self) -> bool: + url = self.__ietf_root + '/nmswebs/restconf/data/ietf-network:networks' + with self.__lock: + if self.__started.is_set(): return True + try: + requests.get(url, timeout=self.__timeout, verify=False) + except requests.exceptions.Timeout: + LOGGER.exception('Timeout connecting {:s}'.format(str(self.__ietf_root))) + return False + except Exception: # pylint: disable=broad-except + LOGGER.exception('Exception connecting {:s}'.format(str(self.__ietf_root))) + return False + else: + self.__started.set() + return True + + def Disconnect(self) -> bool: + with self.__lock: + self.__terminate.set() + return True + + def GetInitialConfig(self) -> List[Tuple[str, Any]]: + with self.__lock: + return [] + + def GetConfig(self, resource_keys : List[str] = []) -> List[Tuple[str, Union[Any, None, Exception]]]: + chk_type('resources', resource_keys, list) + results = [] + with self.__lock: + if len(resource_keys) == 0: resource_keys = ALL_RESOURCE_KEYS + for i, resource_key in enumerate(resource_keys): + str_resource_name = 'resource_key[#{:d}]'.format(i) + chk_string(str_resource_name, resource_key, allow_empty=False) + results.extend(config_getter(self.__ietf_root, resource_key, self.__timeout)) + return results + + def SetConfig(self, resources: List[Tuple[str, Any]]) -> List[Union[bool, Exception]]: + results = [] + if len(resources) == 0: + return results + with self.__lock: + for resource in resources: + LOGGER.info('resource = {:s}'.format(str(resource))) + + node_id_src = find_key(resource, 'node_id_src') + tp_id_src = find_key(resource, 'tp_id_src') + node_id_dst = find_key(resource, 'node_id_dst') + tp_id_dst = find_key(resource, 'tp_id_dst') + vlan_id = find_key(resource, 'vlan_id') + uuid = find_key(resource, 'uuid') + + data = create_connectivity_service( + self.__ietf_root, self.__timeout, uuid, node_id_src, tp_id_src, node_id_dst, tp_id_dst, vlan_id) + results.extend(data) + return results + + def DeleteConfig(self, resources: List[Tuple[str, Any]]) -> List[Union[bool, Exception]]: + results = [] + if len(resources) == 0: return results + with self.__lock: + for resource in resources: + LOGGER.info('resource = {:s}'.format(str(resource))) + uuid = find_key(resource, 'uuid') + results.extend(delete_connectivity_service(self.__ietf_root, self.__timeout, uuid)) + return results + + def SubscribeState(self, subscriptions : List[Tuple[str, float, float]]) -> List[Union[bool, Exception]]: + # TODO: IETF API Driver does not support monitoring by now + return [False for _ in subscriptions] + + def UnsubscribeState(self, subscriptions : List[Tuple[str, float, float]]) -> List[Union[bool, Exception]]: + # TODO: IETF API Driver does not support monitoring by now + return [False for _ in subscriptions] + + def GetState( + self, blocking=False, terminate : Optional[threading.Event] = None + ) -> Iterator[Tuple[float, str, Any]]: + # TODO: IETF API Driver does not support monitoring by now + return [] diff --git a/src/device/service/drivers/microwave/Tools.py b/src/device/service/drivers/microwave/Tools.py new file mode 100644 index 0000000000000000000000000000000000000000..93498f72d4646e1837e934903b6b3e2da6e52259 --- /dev/null +++ b/src/device/service/drivers/microwave/Tools.py @@ -0,0 +1,151 @@ +# 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. + +import json, logging, requests +from device.service.driver_api._Driver import RESOURCE_ENDPOINTS + +LOGGER = logging.getLogger(__name__) + + +def find_key(resource, key): + return json.loads(resource[1])[key] + +# this function exports only the endpoints which are not already involved in a microwave physical link +def is_exportable_endpoint(node, termination_point_id, links): + # for each link we check if the endpoint (termination_point_id) is already used by an existing link + for link in links: + src = link['source'] + dest = link['destination'] + if dest['dest-node'] == node and dest['dest-tp'] == termination_point_id: + return False + if src['source-node'] == node and src['source-tp'] == termination_point_id: + return False + return True + +def config_getter(root_url, resource_key, timeout): + # getting endpoints + network_name = 'SIAE-ETH-TOPOLOGY' + FIELDS = ''.join([ + 'ietf-network-topology:', + 'link(link-id;destination(dest-node;dest-tp);source(source-node;source-tp));', + 'node(node-id;ietf-network-topology:termination-point(tp-id;ietf-te-topology:te/name)))', + ]) + URL_TEMPLATE = '{:s}/nmswebs/restconf/data/ietf-network:networks/network={:s}?fields={:s}' + url = URL_TEMPLATE.format(root_url, network_name, FIELDS) + + result = [] + try: + response = requests.get(url, timeout=timeout, verify=False) + except requests.exceptions.Timeout: + LOGGER.exception('Timeout connecting {:s}'.format(url)) + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('Exception retrieving {:s}'.format(resource_key)) + result.append((resource_key, e)) + else: + context = json.loads(response.content) + if resource_key == RESOURCE_ENDPOINTS: + network_instance = context.get('ietf-network:network', {}) + links = network_instance.get('ietf-network-topology:link', []) + for sip in network_instance['node']: + tp = sip['ietf-network-topology:termination-point'] + node_id = sip['node-id'] + for te in tp: + tp_id = te['tp-id'] + if not is_exportable_endpoint(node_id, tp_id, links): continue + resource_key = '/endpoints/endpoint[{:s}:{:s}]'.format(node_id,tp_id) + resource_value = {'uuid': tp_id, 'type': te['ietf-te-topology:te']['name']} + result.append((resource_key, resource_value)) + + # getting created services + url = '{:s}/nmswebs/restconf/data/ietf-eth-tran-service:etht-svc'.format(root_url) + try: + response = requests.get(url, timeout=timeout, verify=False) + except requests.exceptions.Timeout: + LOGGER.exception('Timeout connecting {:s}'.format(url)) + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('Exception retrieving {:s}'.format(resource_key)) + result.append((resource_key, e)) + else: + context = json.loads(response.content) + if resource_key == RESOURCE_ENDPOINTS: + etht_service = context.get('ietf-eth-tran-service:etht-svc', {}) + service_instances = etht_service.get('etht-svc-instances', []) + for service in service_instances: + service_name = service['etht-svc-name'] + resource_key = '/services/service[{:s}]'.format(service_name) + resource_value = {'uuid': service_name, 'type': service['etht-svc-type']} + result.append((resource_key, resource_value)) + return result + +def create_connectivity_service( + root_url, timeout, uuid, node_id_src, tp_id_src, node_id_dst, tp_id_dst, vlan_id): + + url = '{:s}/nmswebs/restconf/data/ietf-eth-tran-service:etht-svc'.format(root_url) + headers = {'content-type': 'application/json'} + data = { + 'etht-svc-instances': [ + { + 'etht-svc-name': uuid, + 'etht-svc-type': 'ietf-eth-tran-types:p2p-svc', + 'etht-svc-end-points': [ + { + 'etht-svc-access-points': [ + {'access-node-id': node_id_src, 'access-ltp-id': tp_id_src, 'access-point-id': '1'} + ], + 'outer-tag': {'vlan-value': vlan_id, 'tag-type': 'ietf-eth-tran-types:classify-c-vlan'}, + 'etht-svc-end-point-name': '{:s}:{:s}'.format(str(node_id_src), str(tp_id_src)), + 'service-classification-type': 'ietf-eth-tran-types:vlan-classification' + }, + { + 'etht-svc-access-points': [ + {'access-node-id': node_id_dst, 'access-ltp-id': tp_id_dst, 'access-point-id': '2'} + ], + 'outer-tag': {'vlan-value': vlan_id, 'tag-type': 'ietf-eth-tran-types:classify-c-vlan'}, + 'etht-svc-end-point-name': '{:s}:{:s}'.format(str(node_id_dst), str(tp_id_dst)), + 'service-classification-type': 'ietf-eth-tran-types:vlan-classification' + } + ] + } + ] + } + results = [] + try: + LOGGER.info('Connectivity service {:s}: {:s}'.format(str(uuid), str(data))) + response = requests.post(url=url, data=json.dumps(data), timeout=timeout, headers=headers, verify=False) + LOGGER.info('Microwave Driver response: {:s}'.format(str(response))) + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('Exception creating ConnectivityService(uuid={:s}, data={:s})'.format(str(uuid), str(data))) + results.append(e) + else: + if response.status_code != 201: + msg = 'Could not create ConnectivityService(uuid={:s}, data={:s}). status_code={:s} reply={:s}' + LOGGER.error(msg.format(str(uuid), str(data), str(response.status_code), str(response))) + results.append(response.status_code == 201) + return results + +def delete_connectivity_service(root_url, timeout, uuid): + url = '{:s}/nmswebs/restconf/data/ietf-eth-tran-service:etht-svc/etht-svc-instances={:s}' + url = url.format(root_url, uuid) + results = [] + try: + response = requests.delete(url=url, timeout=timeout, verify=False) + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('Exception deleting ConnectivityService(uuid={:s})'.format(str(uuid))) + results.append(e) + else: + if response.status_code != 201: + msg = 'Could not delete ConnectivityService(uuid={:s}). status_code={:s} reply={:s}' + LOGGER.error(msg.format(str(uuid), str(response.status_code), str(response))) + results.append(response.status_code == 202) + return results diff --git a/src/device/service/drivers/microwave/__init__.py b/src/device/service/drivers/microwave/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..925746998061f4e05c468133dfacaaa0414551c8 --- /dev/null +++ b/src/device/service/drivers/microwave/__init__.py @@ -0,0 +1,27 @@ +# 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. + +from device.service.driver_api._Driver import RESOURCE_ENDPOINTS, RESOURCE_INTERFACES, RESOURCE_NETWORK_INSTANCES + +ALL_RESOURCE_KEYS = [ + RESOURCE_ENDPOINTS, + RESOURCE_INTERFACES, + RESOURCE_NETWORK_INSTANCES, +] + +RESOURCE_KEY_MAPPINGS = { + RESOURCE_ENDPOINTS : 'component', + RESOURCE_INTERFACES : 'interface', + RESOURCE_NETWORK_INSTANCES: 'network_instance', +} diff --git a/src/device/service/drivers/openconfig/OpenConfigDriver.py b/src/device/service/drivers/openconfig/OpenConfigDriver.py index 7f582c4880bafd08aee0204c7498ea3a3e7ad279..dd41096ec25fb74f1b1b855c98f90e09fee33194 100644 --- a/src/device/service/drivers/openconfig/OpenConfigDriver.py +++ b/src/device/service/drivers/openconfig/OpenConfigDriver.py @@ -20,8 +20,7 @@ from apscheduler.executors.pool import ThreadPoolExecutor from apscheduler.job import Job from apscheduler.jobstores.memory import MemoryJobStore from apscheduler.schedulers.background import BackgroundScheduler -from netconf_client.connect import connect_ssh, Session -from netconf_client.ncclient import Manager +from ncclient.manager import Manager, connect_ssh from common.tools.client.RetryDecorator import delay_exponential from common.type_checkers.Checkers import chk_length, chk_string, chk_type, chk_float from device.service.driver_api.Exceptions import UnsupportedResourceKeyException @@ -32,7 +31,8 @@ from .templates import ALL_RESOURCE_KEYS, EMPTY_CONFIG, compose_config, get_filt from .RetryDecorator import retry DEBUG_MODE = False -#logging.getLogger('ncclient.transport.ssh').setLevel(logging.DEBUG if DEBUG_MODE else logging.WARNING) +logging.getLogger('ncclient.manager').setLevel(logging.DEBUG if DEBUG_MODE else logging.WARNING) +logging.getLogger('ncclient.transport.ssh').setLevel(logging.DEBUG if DEBUG_MODE else logging.WARNING) logging.getLogger('apscheduler.executors.default').setLevel(logging.INFO if DEBUG_MODE else logging.ERROR) logging.getLogger('apscheduler.scheduler').setLevel(logging.INFO if DEBUG_MODE else logging.ERROR) logging.getLogger('monitoring-client').setLevel(logging.INFO if DEBUG_MODE else logging.ERROR) @@ -59,29 +59,41 @@ class NetconfSessionHandler: self.__connected = threading.Event() self.__address = address self.__port = int(port) - self.__username = settings.get('username') - self.__password = settings.get('password') - self.__timeout = int(settings.get('timeout', 120)) - self.__netconf_session : Session = None - self.__netconf_manager : Manager = None + self.__username = settings.get('username') + self.__password = settings.get('password') + self.__key_filename = settings.get('key_filename') + self.__hostkey_verify = settings.get('hostkey_verify', True) + self.__look_for_keys = settings.get('look_for_keys', True) + self.__allow_agent = settings.get('allow_agent', True) + self.__force_running = settings.get('force_running', False) + self.__device_params = settings.get('device_params', {}) + self.__manager_params = settings.get('manager_params', {}) + self.__nc_params = settings.get('nc_params', {}) + self.__manager : Manager = None + self.__candidate_supported = False def connect(self): with self.__lock: - self.__netconf_session = connect_ssh( - host=self.__address, port=self.__port, username=self.__username, password=self.__password) - self.__netconf_manager = Manager(self.__netconf_session, timeout=self.__timeout) - self.__netconf_manager.set_logger_level(logging.DEBUG if DEBUG_MODE else logging.WARNING) + self.__manager = connect_ssh( + host=self.__address, port=self.__port, username=self.__username, password=self.__password, + device_params=self.__device_params, manager_params=self.__manager_params, nc_params=self.__nc_params, + key_filename=self.__key_filename, hostkey_verify=self.__hostkey_verify, allow_agent=self.__allow_agent, + look_for_keys=self.__look_for_keys) + self.__candidate_supported = ':candidate' in self.__manager.server_capabilities self.__connected.set() def disconnect(self): if not self.__connected.is_set(): return with self.__lock: - self.__netconf_manager.close_session() + self.__manager.close_session() + + @property + def use_candidate(self): return self.__candidate_supported and not self.__force_running @RETRY_DECORATOR def get(self, filter=None, with_defaults=None): # pylint: disable=redefined-builtin with self.__lock: - return self.__netconf_manager.get(filter=filter, with_defaults=with_defaults) + return self.__manager.get(filter=filter, with_defaults=with_defaults) @RETRY_DECORATOR def edit_config( @@ -90,10 +102,16 @@ class NetconfSessionHandler: ): if config == EMPTY_CONFIG: return with self.__lock: - self.__netconf_manager.edit_config( + self.__manager.edit_config( config, target=target, default_operation=default_operation, test_option=test_option, error_option=error_option, format=format) + def locked(self, target): + return self.__manager.locked(target=target) + + def commit(self, confirmed=False, timeout=None, persist=None, persist_id=None): + return self.__manager.commit(confirmed=confirmed, timeout=timeout, persist=persist, persist_id=persist_id) + def compute_delta_sample(previous_sample, previous_timestamp, current_sample, current_timestamp): if previous_sample is None: return None if previous_timestamp is None: return None @@ -162,6 +180,36 @@ def do_sampling(samples_cache : SamplesCache, resource_key : str, out_samples : except: # pylint: disable=bare-except LOGGER.exception('Error retrieving samples') +def edit_config( + netconf_handler : NetconfSessionHandler, resources : List[Tuple[str, Any]], delete=False, target='running', + default_operation='merge', test_option=None, error_option=None, format='xml' # pylint: disable=redefined-builtin +): + str_method = 'DeleteConfig' if delete else 'SetConfig' + LOGGER.info('[{:s}] resources = {:s}'.format(str_method, str(resources))) + results = [None for _ in resources] + for i,resource in enumerate(resources): + str_resource_name = 'resources[#{:d}]'.format(i) + try: + LOGGER.info('[{:s}] resource = {:s}'.format(str_method, str(resource))) + chk_type(str_resource_name, resource, (list, tuple)) + chk_length(str_resource_name, resource, min_length=2, max_length=2) + resource_key,resource_value = resource + chk_string(str_resource_name + '.key', resource_key, allow_empty=False) + str_config_message = compose_config(resource_key, resource_value, delete=delete) + if str_config_message is None: raise UnsupportedResourceKeyException(resource_key) + LOGGER.info('[{:s}] str_config_message[{:d}] = {:s}'.format( + str_method, len(str_config_message), str(str_config_message))) + netconf_handler.edit_config( + config=str_config_message, target=target, default_operation=default_operation, + test_option=test_option, error_option=error_option, format=format) + results[i] = True + except Exception as e: # pylint: disable=broad-except + str_operation = 'preparing' if target == 'candidate' else ('deleting' if delete else 'setting') + msg = '[{:s}] Exception {:s} {:s}: {:s}' + LOGGER.exception(msg.format(str_method, str_operation, str_resource_name, str(resource))) + results[i] = e # if validation fails, store the exception + return results + class OpenConfigDriver(_Driver): def __init__(self, address : str, port : int, **settings) -> None: # pylint: disable=super-init-not-called self.__lock = threading.Lock() @@ -227,51 +275,33 @@ class OpenConfigDriver(_Driver): def SetConfig(self, resources : List[Tuple[str, Any]]) -> List[Union[bool, Exception]]: chk_type('resources', resources, list) if len(resources) == 0: return [] - results = [] - LOGGER.info('[SetConfig] resources = {:s}'.format(str(resources))) with self.__lock: - for i,resource in enumerate(resources): - str_resource_name = 'resources[#{:d}]'.format(i) - try: - LOGGER.info('[SetConfig] resource = {:s}'.format(str(resource))) - chk_type(str_resource_name, resource, (list, tuple)) - chk_length(str_resource_name, resource, min_length=2, max_length=2) - resource_key,resource_value = resource - chk_string(str_resource_name + '.key', resource_key, allow_empty=False) - str_config_message = compose_config(resource_key, resource_value) - if str_config_message is None: raise UnsupportedResourceKeyException(resource_key) - LOGGER.info('[SetConfig] str_config_message[{:d}] = {:s}'.format( - len(str_config_message), str(str_config_message))) - self.__netconf_handler.edit_config(str_config_message, target='running') - results.append(True) - except Exception as e: # pylint: disable=broad-except - LOGGER.exception('Exception setting {:s}: {:s}'.format(str_resource_name, str(resource))) - results.append(e) # if validation fails, store the exception + if self.__netconf_handler.use_candidate: + with self.__netconf_handler.locked(target='candidate'): + results = edit_config(self.__netconf_handler, resources, target='candidate') + try: + self.__netconf_handler.commit() + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('[SetConfig] Exception commiting resources: {:s}'.format(str(resources))) + results = [e for _ in resources] # if commit fails, set exception in each resource + else: + results = edit_config(self.__netconf_handler, resources) return results def DeleteConfig(self, resources : List[Tuple[str, Any]]) -> List[Union[bool, Exception]]: chk_type('resources', resources, list) if len(resources) == 0: return [] - results = [] - LOGGER.info('[DeleteConfig] resources = {:s}'.format(str(resources))) with self.__lock: - for i,resource in enumerate(resources): - str_resource_name = 'resources[#{:d}]'.format(i) - try: - LOGGER.info('[DeleteConfig] resource = {:s}'.format(str(resource))) - chk_type(str_resource_name, resource, (list, tuple)) - chk_length(str_resource_name, resource, min_length=2, max_length=2) - resource_key,resource_value = resource - chk_string(str_resource_name + '.key', resource_key, allow_empty=False) - str_config_message = compose_config(resource_key, resource_value, delete=True) - if str_config_message is None: raise UnsupportedResourceKeyException(resource_key) - LOGGER.info('[DeleteConfig] str_config_message[{:d}] = {:s}'.format( - len(str_config_message), str(str_config_message))) - self.__netconf_handler.edit_config(str_config_message, target='running') - results.append(True) - except Exception as e: # pylint: disable=broad-except - LOGGER.exception('Exception deleting {:s}: {:s}'.format(str_resource_name, str(resource_key))) - results.append(e) # if validation fails, store the exception + if self.__netconf_handler.use_candidate: + with self.__netconf_handler.locked(target='candidate'): + results = edit_config(self.__netconf_handler, resources, target='candidate', delete=True) + try: + self.__netconf_handler.commit() + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('[DeleteConfig] Exception commiting resources: {:s}'.format(str(resources))) + results = [e for _ in resources] # if commit fails, set exception in each resource + else: + results = edit_config(self.__netconf_handler, resources, delete=True) return results def SubscribeState(self, subscriptions : List[Tuple[str, float, float]]) -> List[Union[bool, Exception]]: diff --git a/src/device/service/drivers/openconfig/templates/Acl.py b/src/device/service/drivers/openconfig/templates/Acl.py new file mode 100644 index 0000000000000000000000000000000000000000..6cd90f373427e2ab55550985929c4cfcd8798702 --- /dev/null +++ b/src/device/service/drivers/openconfig/templates/Acl.py @@ -0,0 +1,123 @@ +# 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. + +import logging, lxml.etree as ET +from typing import Any, Dict, List, Tuple +from .Namespace import NAMESPACES +from .Tools import add_value_from_tag + +LOGGER = logging.getLogger(__name__) + +XPATH_ACL_SET = "//ocacl:acl/ocacl:acl-sets/ocacl:acl-set" +XPATH_A_ACL_ENTRY = ".//ocacl:acl-entries/ocacl:ecl-entry" +XPATH_A_IPv4 = ".//ocacl:ipv4/ocacl:config" +XPATH_A_TRANSPORT = ".//ocacl:transport/ocacl:config" +XPATH_A_ACTIONS = ".//ocacl:actions/ocacl:config" + +XPATH_INTERFACE = "//ocacl:acl/ocacl:interfaces/ocacl:interface" +XPATH_I_INGRESS = ".//ocacl:ingress-acl-sets/ocacl:ingress-acl-set" +XPATH_I_EGRESS = ".//ocacl:egress-acl-sets/ocacl:egress-acl-set" + +def parse(xml_data : ET.Element) -> List[Tuple[str, Dict[str, Any]]]: + #LOGGER.info('[ACL] xml_data = {:s}'.format(str(ET.tostring(xml_data)))) + + response = [] + acl = {} + + for xml_acl in xml_data.xpath(XPATH_ACL_SET, namespaces=NAMESPACES): + #LOGGER.info('xml_acl = {:s}'.format(str(ET.tostring(xml_acl)))) + + acl_name = xml_acl.find('ocacl:name', namespaces=NAMESPACES) + if acl_name is None or acl_name.text is None: continue + add_value_from_tag(acl, 'name', acl_name) + + acl_type = xml_acl.find('ocacl:type', namespaces=NAMESPACES) + add_value_from_tag(acl, 'type', acl_type) + + for xml_acl_entries in xml_acl.xpath(XPATH_A_ACL_ENTRY, namespaces=NAMESPACES): + + acl_id = xml_acl_entries.find('ocacl:sequence_id', namespaces=NAMESPACES) + add_value_from_tag(acl, 'sequence_id', acl_id) + + for xml_ipv4 in xml_acl_entries.xpath(XPATH_A_IPv4, namespaces=NAMESPACES): + + ipv4_source = xml_ipv4.find('ocacl:source_address', namespaces=NAMESPACES) + add_value_from_tag(acl, 'source_address' , ipv4_source) + + ipv4_destination = xml_ipv4.find('ocacl:destination_address', namespaces=NAMESPACES) + add_value_from_tag(acl, 'destination_address' , ipv4_destination) + + ipv4_protocol = xml_ipv4.find('ocacl:protocol', namespaces=NAMESPACES) + add_value_from_tag(acl, 'protocol' , ipv4_protocol) + + ipv4_dscp = xml_ipv4.find('ocacl:dscp', namespaces=NAMESPACES) + add_value_from_tag(acl, 'dscp' , ipv4_dscp) + + ipv4_hop_limit = xml_ipv4.find('ocacl:hop_limit', namespaces=NAMESPACES) + add_value_from_tag(acl, 'hop_limit' , ipv4_hop_limit) + + for xml_transport in xml_acl_entries.xpath(XPATH_A_TRANSPORT, namespaces=NAMESPACES): + + transport_source = xml_transport.find('ocacl:source_port', namespaces=NAMESPACES) + add_value_from_tag(acl, 'source_port' ,transport_source) + + transport_destination = xml_transport.find('ocacl:destination_port', namespaces=NAMESPACES) + add_value_from_tag(acl, 'destination_port' ,transport_destination) + + transport_tcp_flags = xml_transport.find('ocacl:tcp_flags', namespaces=NAMESPACES) + add_value_from_tag(acl, 'tcp_flags' ,transport_tcp_flags) + + for xml_action in xml_acl_entries.xpath(XPATH_A_ACTIONS, namespaces=NAMESPACES): + + action = xml_action.find('ocacl:forwarding_action', namespaces=NAMESPACES) + add_value_from_tag(acl, 'forwarding_action' ,action) + + log_action = xml_action.find('ocacl:log_action', namespaces=NAMESPACES) + add_value_from_tag(acl, 'log_action' ,log_action) + + resource_key = '/acl/acl-set[{:s}][{:s}]/acl-entry[{:s}]'.format( + acl['name'], acl['type'], acl['sequence-id']) + response.append((resource_key,acl)) + + for xml_interface in xml_data.xpath(XPATH_INTERFACE, namespaces=NAMESPACES): + + interface = {} + + interface_id = xml_interface.find('ocacl:id', namespaces=NAMESPACES) + add_value_from_tag(interface, 'id' , interface_id) + + for xml_ingress in xml_interface.xpath(XPATH_I_INGRESS, namespaces=NAMESPACES): + + i_name = xml_ingress.find('ocacl:set_name_ingress', namespaces=NAMESPACES) + add_value_from_tag(interface, 'ingress_set_name' , i_name) + + i_type = xml_ingress.find('ocacl:type_ingress', namespaces=NAMESPACES) + add_value_from_tag(interface, 'ingress_type' , i_type) + + resource_key = '/acl/interfaces/ingress[{:s}][{:s}]'.format( + acl['name'], acl['type']) + response.append((resource_key,interface)) + + for xml_egress in xml_interface.xpath(XPATH_I_EGRESS, namespaces=NAMESPACES): + + e_name = xml_egress.find('ocacl:set_name_egress', namespaces=NAMESPACES) + add_value_from_tag(interface, 'egress_set_name' , e_name) + + e_type = xml_egress.find('ocacl:type_egress', namespaces=NAMESPACES) + add_value_from_tag(interface, 'egress_type' , e_type) + + resource_key = '/acl/interfaces/egress[{:s}][{:s}]'.format( + acl['name'], acl['type']) + response.append((resource_key,interface)) + return response diff --git a/src/device/service/drivers/openconfig/templates/Namespace.py b/src/device/service/drivers/openconfig/templates/Namespace.py index 35be5827db892541847a3c02af42e2fd08ee0e1d..94af95566f33751a25fb1cb1c817cbffa910eec4 100644 --- a/src/device/service/drivers/openconfig/templates/Namespace.py +++ b/src/device/service/drivers/openconfig/templates/Namespace.py @@ -13,8 +13,9 @@ # limitations under the License. -NAMESPACE_NETCONF = 'urn:ietf:params:xml:ns:netconf:base:1.0' +NAMESPACE_NETCONF = 'urn:ietf:params:xml:ns:netconf:base:1.0' +NAMESPACE_ACL = 'http://openconfig.net/yang/acl' NAMESPACE_BGP_POLICY = 'http://openconfig.net/yang/bgp-policy' NAMESPACE_INTERFACES = 'http://openconfig.net/yang/interfaces' NAMESPACE_INTERFACES_IP = 'http://openconfig.net/yang/interfaces/ip' @@ -30,6 +31,7 @@ NAMESPACE_VLAN = 'http://openconfig.net/yang/vlan' NAMESPACES = { 'nc' : NAMESPACE_NETCONF, + 'ocacl': NAMESPACE_ACL, 'ocbp' : NAMESPACE_BGP_POLICY, 'oci' : NAMESPACE_INTERFACES, 'ociip': NAMESPACE_INTERFACES_IP, diff --git a/src/device/service/drivers/openconfig/templates/RoutingPolicy.py b/src/device/service/drivers/openconfig/templates/RoutingPolicy.py index aae8483706646801dccf6d3018eb9860209bf52b..369732de3fe58c52a2e9ab2227899160d091ff68 100644 --- a/src/device/service/drivers/openconfig/templates/RoutingPolicy.py +++ b/src/device/service/drivers/openconfig/templates/RoutingPolicy.py @@ -15,7 +15,7 @@ import copy, logging, lxml.etree as ET from typing import Any, Dict, List, Tuple from .Namespace import NAMESPACES -from .Tools import add_value_from_collection, add_value_from_tag +from .Tools import add_value_from_tag LOGGER = logging.getLogger(__name__) diff --git a/src/device/service/drivers/openconfig/templates/__init__.py b/src/device/service/drivers/openconfig/templates/__init__.py index eb7842ea8d5b62798f08429776700a792f69dc91..901f5cf0291dca1bda155e20abd16db5989df7dc 100644 --- a/src/device/service/drivers/openconfig/templates/__init__.py +++ b/src/device/service/drivers/openconfig/templates/__init__.py @@ -16,17 +16,19 @@ import json, logging, lxml.etree as ET, re from typing import Any, Dict from jinja2 import Environment, PackageLoader, select_autoescape from device.service.driver_api._Driver import ( - RESOURCE_ENDPOINTS, RESOURCE_INTERFACES, RESOURCE_NETWORK_INSTANCES, RESOURCE_ROUTING_POLICIES) + RESOURCE_ENDPOINTS, RESOURCE_INTERFACES, RESOURCE_NETWORK_INSTANCES, RESOURCE_ROUTING_POLICIES, RESOURCE_ACL) from .EndPoints import parse as parse_endpoints from .Interfaces import parse as parse_interfaces, parse_counters from .NetworkInstances import parse as parse_network_instances from .RoutingPolicy import parse as parse_routing_policy +from .Acl import parse as parse_acl ALL_RESOURCE_KEYS = [ RESOURCE_ENDPOINTS, RESOURCE_INTERFACES, RESOURCE_ROUTING_POLICIES, # routing policies should come before network instances RESOURCE_NETWORK_INSTANCES, + RESOURCE_ACL, ] RESOURCE_KEY_MAPPINGS = { @@ -34,6 +36,7 @@ RESOURCE_KEY_MAPPINGS = { RESOURCE_INTERFACES : 'interface', RESOURCE_NETWORK_INSTANCES: 'network_instance', RESOURCE_ROUTING_POLICIES : 'routing_policy', + RESOURCE_ACL : 'acl', } RESOURCE_PARSERS = { @@ -42,6 +45,7 @@ RESOURCE_PARSERS = { 'network_instance': parse_network_instances, 'routing_policy' : parse_routing_policy, 'interfaces/interface/state/counters': parse_counters, + 'acl' : parse_acl, } LOGGER = logging.getLogger(__name__) diff --git a/src/device/service/drivers/openconfig/templates/acl/acl-set/acl-entry/edit_config.xml b/src/device/service/drivers/openconfig/templates/acl/acl-set/acl-entry/edit_config.xml new file mode 100644 index 0000000000000000000000000000000000000000..fac259b6fdcd3cbded93088ddc6335ea2bfe5f69 --- /dev/null +++ b/src/device/service/drivers/openconfig/templates/acl/acl-set/acl-entry/edit_config.xml @@ -0,0 +1,42 @@ +<acl xmlns="http://openconfig.net/yang/acl"> + <acl-sets> + <acl-set{% if operation is defined %} xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" nc:operation="{{operation}}"{% endif %}> + <name>{{name}}</name> + <type>{{type}}</type> + <config> + <name>{{name}}</name> + <type>{{type}}</type> + </config> + <acl-entries> + <acl-entry> + <sequence-id>{{sequence_id}}</sequence-id> + <config> + <sequence-id>{{sequence_id}}</sequence-id> + </config> + <ipv4> + <config> + {% if source_address is defined %}<source-address>{{source_address}}</source-address>{% endif%} + {% if destination_address is defined %}<destination-address>{{destination_address}}</destination-address>{% endif%} + {% if protocol is defined %}<protocol>{{protocol}}</protocol>{% endif%} + {% if dscp is defined %}<dscp>{{dscp}}</dscp>{% endif%} + {% if hop_limit is defined %}<hop-limit>{{hop_limit}}</hop-limit>{% endif%} + </config> + </ipv4> + <transport> + <config> + {% if source_port is defined %}<source-port>{{source_port}}</source-port>{% endif%} + {% if destination_port is defined %}<destination-port>{{destination_port}}</destination-port>{% endif%} + {% if tcp_flags is defined %}<tcp-flags>{{tcp_flags}}</tcp-flags>{% endif%} + </config> + </transport> + <actions> + <config> + {% if forwarding_action is defined %}<forwarding-action>{{forwarding_action}}</forwarding-action>{% endif%} + {% if log_action is defined %}<log-action>{{log_action}}</log-action>{% endif%} + </config> + </actions> + </acl-entry> + </acl-entries> + </acl-set> + </acl-sets> +</acl> diff --git a/src/device/service/drivers/openconfig/templates/acl/get.xml b/src/device/service/drivers/openconfig/templates/acl/get.xml new file mode 100644 index 0000000000000000000000000000000000000000..dfed162427d03953890ecf1f90352cc26a76cbc9 --- /dev/null +++ b/src/device/service/drivers/openconfig/templates/acl/get.xml @@ -0,0 +1,7 @@ +<acl xmlns="http://openconfig.net/yang/acl"> + <acl-sets> + </acl-sets> + <interfaces> + </interfaces> +</acl> + \ No newline at end of file diff --git a/src/device/service/drivers/openconfig/templates/acl/interfaces/egress/edit_config.xml b/src/device/service/drivers/openconfig/templates/acl/interfaces/egress/edit_config.xml new file mode 100644 index 0000000000000000000000000000000000000000..d987b0cc4b40298533f140f71af83c6fad884020 --- /dev/null +++ b/src/device/service/drivers/openconfig/templates/acl/interfaces/egress/edit_config.xml @@ -0,0 +1,26 @@ +<acl xmlns="http://openconfig.net/yang/acl"> + <interfaces> + <interface{% if operation is defined %} xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" nc:operation="{{operation}}"{% endif %}> + <id>{{id}}</id> + <config> + <id>{{id}}</id> + </config> + <interface-ref> + <config> + <interface>{{interface}}</interface> + {% if subinterface is defined %}<subinterface>{{subinterface}}</subinterface>{% endif%} + </config> + </interface-ref> + <egress-acl-sets> + <egress-acl-set> + <set-name>{{set_name_egress}}</set-name> + <type>{{type_egress}}</type> + <config> + <set-name>{{set_name_egress}}</set-name> + <type>{{type_egress}}</type> + </config> + </egress-acl-set> + </egress-acl-sets> + </interface> + </interfaces> +</acl> diff --git a/src/device/service/drivers/openconfig/templates/acl/interfaces/ingress/edit_config.xml b/src/device/service/drivers/openconfig/templates/acl/interfaces/ingress/edit_config.xml new file mode 100644 index 0000000000000000000000000000000000000000..144a03c55477e532379541be5443063fe3aa2f10 --- /dev/null +++ b/src/device/service/drivers/openconfig/templates/acl/interfaces/ingress/edit_config.xml @@ -0,0 +1,26 @@ +<acl xmlns="http://openconfig.net/yang/acl"> + <interfaces> + <interface{% if operation is defined %} xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" nc:operation="{{operation}}"{% endif %}> + <id>{{id}}</id> + <config> + <id>{{id}}</id> + </config> + <interface-ref> + <config> + <interface>{{interface}}</interface> + {% if subinterface is defined %}<subinterface>{{subinterface}}</subinterface>{% endif%} + </config> + </interface-ref> + <ingress-acl-sets> + <ingress-acl-set> + <set-name>{{set_name_ingress}}</set-name> + <type>{{type_ingress}}</type> + <config> + <set-name>{{set_name_ingress}}</set-name> + <type>{{type_ingress}}</type> + </config> + </ingress-acl-set> + </ingress-acl-sets> + </interface> + </interfaces> +</acl> diff --git a/src/device/service/drivers/p4/p4_driver.py b/src/device/service/drivers/p4/p4_driver.py index 3e0cccffabb7aad4ab5b5c6e88642c36b7e12166..af05952b313d1632eacd5962cc34c4aa1b6b5a10 100644 --- a/src/device/service/drivers/p4/p4_driver.py +++ b/src/device/service/drivers/p4/p4_driver.py @@ -44,7 +44,7 @@ class P4Driver(_Driver): transport port number of the P4Runtime server running on the P4 device **settings : map id : int - P4 device ID (Mandatory) + P4 device datapath ID (Mandatory) name : str P4 device name (Optional) vendor : str diff --git a/src/device/tests/.gitignore b/src/device/tests/.gitignore index b5f6bc13b7b17daa79d9e67c5fc0c50338d089a1..4cbf5059c2f905c16aac6234e2b9ca0ac7584c09 100644 --- a/src/device/tests/.gitignore +++ b/src/device/tests/.gitignore @@ -1,3 +1,5 @@ # Add here your files containing confidential testbed details such as IP addresses, ports, usernames, passwords, etc. +Device_OpenConfig_Adva* +Device_OpenConfig_Cisco* Device_OpenConfig_Infinera* Device_Transport_Api* diff --git a/src/device/tests/Device_Microwave_Template.py b/src/device/tests/Device_Microwave_Template.py new file mode 100644 index 0000000000000000000000000000000000000000..710d28becad9c0bb50b639f3c5d0ef8fa1abe145 --- /dev/null +++ b/src/device/tests/Device_Microwave_Template.py @@ -0,0 +1,46 @@ +# 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. + +from common.tools.object_factory.ConfigRule import json_config_rule_delete, json_config_rule_set +from common.tools.object_factory.Device import ( + json_device_connect_rules, json_device_id, json_device_microwave_disabled) + +DEVICE_MICROWAVE_UUID = 'DEVICE-MICROWAVE' # populate 'device-uuid' of the MICROWAVE SMDC server +DEVICE_MICROWAVE_ADDRESS = '127.0.0.1' # populate 'address' of the MICROWAVE SMDC server +DEVICE_MICROWAVE_PORT = 8443 # populate 'port' of the MICROWAVE SMDC server +DEVICE_MICROWAVE_TIMEOUT = 120 # populate 'timeout' of the MICROWAVE SMDC server + +DEVICE_MICROWAVE_ID = json_device_id(DEVICE_MICROWAVE_UUID) +DEVICE_MICROWAVE = json_device_microwave_disabled(DEVICE_MICROWAVE_UUID) + +DEVICE_MICROWAVE_CONNECT_RULES = json_device_connect_rules(DEVICE_MICROWAVE_ADDRESS, DEVICE_MICROWAVE_PORT, { + 'timeout' : DEVICE_MICROWAVE_TIMEOUT, +}) + +DEVICE_MICROWAVE_CONFIG_RULES = [ + json_config_rule_set('/services/service[service_uuid]', { + 'uuid' : 'service-uuid', # populate 'service_name of the service to test + 'node_id_src': '172.26.60.243', # populate 'node_id_src' of the service to test + 'tp_id_src' : 9, # populate 'tp_id_src' of the service to test + 'node_id_dst': '172.26.60.244', # populate 'node_id_dst' of the service to test + 'tp_id_dst' : 9, # populate 'tp_id_dst' of the service to test + 'vlan_id' : 121, # populate 'vlan_id' of the service to test + }) +] + +DEVICE_MICROWAVE_DECONFIG_RULES = [ + json_config_rule_delete('/services/service[service-uuid]', { + 'uuid': 'service-uuid' # populate 'service_name' of the service to test + }) +] diff --git a/src/device/tests/Device_OpenConfig_Template.py b/src/device/tests/Device_OpenConfig_Template.py index df588b3d8a65883e0ebbfeacb222648bda0455ed..6afa2721ff920c39de243b308b9b9a4749cb013b 100644 --- a/src/device/tests/Device_OpenConfig_Template.py +++ b/src/device/tests/Device_OpenConfig_Template.py @@ -20,15 +20,20 @@ DEVICE_OC_ADDRESS = '127.0.0.1' # populate the Netconf Server IP address of th DEVICE_OC_PORT = 830 # populate the Netconf Server port of the device to test DEVICE_OC_USERNAME = 'username' # populate the Netconf Server username of the device to test DEVICE_OC_PASSWORD = 'password' # populate the Netconf Server password of the device to test -DEVICE_OC_TIMEOUT = 120 +DEVICE_OC_TIMEOUT = 15 DEVICE_OC_ID = json_device_id(DEVICE_OC_UUID) DEVICE_OC = json_device_packetrouter_disabled(DEVICE_OC_UUID) DEVICE_OC_CONNECT_RULES = json_device_connect_rules(DEVICE_OC_ADDRESS, DEVICE_OC_PORT, { - 'username': DEVICE_OC_USERNAME, - 'password': DEVICE_OC_PASSWORD, - 'timeout' : DEVICE_OC_TIMEOUT, + 'username' : DEVICE_OC_USERNAME, + 'password' : DEVICE_OC_PASSWORD, + 'force_running' : False, + 'hostkey_verify' : True, + 'look_for_keys' : True, + 'allow_agent' : True, + 'device_params' : {'name': 'default'}, + 'manager_params' : {'timeout' : DEVICE_OC_TIMEOUT}, }) DEVICE_OC_CONFIG_RULES = [] # populate your configuration rules to test diff --git a/src/device/tests/MockMonitoringService.py b/src/device/tests/MockMonitoringService.py deleted file mode 100644 index 3e8550058daa905517f26a659a08c66db1172d74..0000000000000000000000000000000000000000 --- a/src/device/tests/MockMonitoringService.py +++ /dev/null @@ -1,61 +0,0 @@ -# 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. - -import grpc, logging -from concurrent import futures -from queue import Queue -from monitoring.Config import GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD -from monitoring.proto.monitoring_pb2_grpc import add_MonitoringServiceServicer_to_server -from .MockMonitoringServiceServicerImpl import MockMonitoringServiceServicerImpl - -BIND_ADDRESS = '0.0.0.0' -LOGGER = logging.getLogger(__name__) - -class MockMonitoringService: - def __init__( - self, address=BIND_ADDRESS, port=GRPC_SERVICE_PORT, max_workers=GRPC_MAX_WORKERS, - grace_period=GRPC_GRACE_PERIOD): - - self.queue_samples = Queue() - self.address = address - self.port = port - self.endpoint = None - self.max_workers = max_workers - self.grace_period = grace_period - self.monitoring_servicer = None - self.pool = None - self.server = None - - def start(self): - self.endpoint = '{:s}:{:s}'.format(str(self.address), str(self.port)) - LOGGER.info('Starting Service (tentative endpoint: {:s}, max_workers: {:s})...'.format( - str(self.endpoint), str(self.max_workers))) - - self.pool = futures.ThreadPoolExecutor(max_workers=self.max_workers) - self.server = grpc.server(self.pool) # , interceptors=(tracer_interceptor,)) - - self.monitoring_servicer = MockMonitoringServiceServicerImpl(self.queue_samples) - add_MonitoringServiceServicer_to_server(self.monitoring_servicer, self.server) - - port = self.server.add_insecure_port(self.endpoint) - self.endpoint = '{:s}:{:s}'.format(str(self.address), str(port)) - LOGGER.info('Listening on {:s}...'.format(str(self.endpoint))) - self.server.start() - - LOGGER.debug('Service started') - - def stop(self): - LOGGER.debug('Stopping service (grace period {:s} seconds)...'.format(str(self.grace_period))) - self.server.stop(self.grace_period) - LOGGER.debug('Service stopped') diff --git a/src/device/tests/MockService_Dependencies.py b/src/device/tests/MockService_Dependencies.py new file mode 100644 index 0000000000000000000000000000000000000000..6b2a7788fa3fa242edb9cc7c4b10e22244d7c99a --- /dev/null +++ b/src/device/tests/MockService_Dependencies.py @@ -0,0 +1,50 @@ +# 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. + +import os, queue +from typing import Union +from common.Constants import ServiceNameEnum +from common.Settings import ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name +from common.tests.MockServicerImpl_Context import MockServicerImpl_Context +from common.tests.MockServicerImpl_Monitoring import MockServicerImpl_Monitoring +from common.tools.service.GenericGrpcService import GenericGrpcService +from context.proto.context_pb2_grpc import add_ContextServiceServicer_to_server +from monitoring.proto.monitoring_pb2_grpc import add_MonitoringServiceServicer_to_server + +LOCAL_HOST = '127.0.0.1' + +SERVICE_CONTEXT = ServiceNameEnum.CONTEXT +SERVICE_MONITORING = ServiceNameEnum.MONITORING + +class MockService_Dependencies(GenericGrpcService): + # Mock Service implementing Context and Monitoring to simplify unitary tests of Device + + def __init__(self, bind_port: Union[str, int]) -> None: + super().__init__(bind_port, LOCAL_HOST, enable_health_servicer=False, cls_name='MockService') + + # pylint: disable=attribute-defined-outside-init + def install_servicers(self): + self.context_servicer = MockServicerImpl_Context() + add_ContextServiceServicer_to_server(self.context_servicer, self.server) + + self.queue_samples = queue.Queue() + self.monitoring_servicer = MockServicerImpl_Monitoring(queue_samples=self.queue_samples) + add_MonitoringServiceServicer_to_server(self.monitoring_servicer, self.server) + + def configure_env_vars(self): + os.environ[get_env_var_name(SERVICE_CONTEXT, ENVVAR_SUFIX_SERVICE_HOST )] = str(self.bind_address) + os.environ[get_env_var_name(SERVICE_CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(self.bind_port) + + os.environ[get_env_var_name(SERVICE_MONITORING, ENVVAR_SUFIX_SERVICE_HOST )] = str(self.bind_address) + os.environ[get_env_var_name(SERVICE_MONITORING, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(self.bind_port) diff --git a/src/device/tests/PrepareTestScenario.py b/src/device/tests/PrepareTestScenario.py new file mode 100644 index 0000000000000000000000000000000000000000..08991221a3f5121c587ecfd4644a6b28156ccefd --- /dev/null +++ b/src/device/tests/PrepareTestScenario.py @@ -0,0 +1,80 @@ +# 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. + +import pytest, os +from common.Constants import ServiceNameEnum +from common.Settings import ( + ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_service_port_grpc) +from context.client.ContextClient import ContextClient +from context.proto.context_pb2 import Context, Topology +from device.client.DeviceClient import DeviceClient +from device.service.DeviceService import DeviceService +from device.service.driver_api.DriverFactory import DriverFactory +from device.service.driver_api.DriverInstanceCache import DriverInstanceCache +from device.service.drivers import DRIVERS +from device.tests.CommonObjects import CONTEXT, TOPOLOGY +from device.tests.MockService_Dependencies import MockService_Dependencies +from monitoring.client.MonitoringClient import MonitoringClient + +LOCAL_HOST = '127.0.0.1' +MOCKSERVICE_PORT = 10000 +DEVICE_SERVICE_PORT = MOCKSERVICE_PORT + get_service_port_grpc(ServiceNameEnum.DEVICE) # avoid privileged ports +os.environ[get_env_var_name(ServiceNameEnum.DEVICE, ENVVAR_SUFIX_SERVICE_HOST )] = str(LOCAL_HOST) +os.environ[get_env_var_name(ServiceNameEnum.DEVICE, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(DEVICE_SERVICE_PORT) + +@pytest.fixture(scope='session') +def mock_service(): + _service = MockService_Dependencies(MOCKSERVICE_PORT) + _service.configure_env_vars() + _service.start() + yield _service + _service.stop() + +@pytest.fixture(scope='session') +def context_client(mock_service : MockService_Dependencies): # pylint: disable=redefined-outer-name + _client = ContextClient() + yield _client + _client.close() + +@pytest.fixture(scope='session') +def monitoring_client(mock_service : MockService_Dependencies): # pylint: disable=redefined-outer-name + _client = MonitoringClient() + yield _client + _client.close() + +@pytest.fixture(scope='session') +def device_service( + context_client : ContextClient, # pylint: disable=redefined-outer-name + monitoring_client : MonitoringClient): # pylint: disable=redefined-outer-name + + _driver_factory = DriverFactory(DRIVERS) + _driver_instance_cache = DriverInstanceCache(_driver_factory) + _service = DeviceService(_driver_instance_cache) + _service.start() + yield _service + _service.stop() + +@pytest.fixture(scope='session') +def device_client(device_service : DeviceService): # pylint: disable=redefined-outer-name + _client = DeviceClient() + yield _client + _client.close() + +def test_prepare_environment( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + context_client.SetContext(Context(**CONTEXT)) + context_client.SetTopology(Topology(**TOPOLOGY)) diff --git a/src/device/tests/device_p4.py b/src/device/tests/device_p4.py index 577855dd449b1aa67b8b36e78bd57abb47b03b23..4cd0a4c745d3a07b71f320ce79d73c95ffb0af37 100644 --- a/src/device/tests/device_p4.py +++ b/src/device/tests/device_p4.py @@ -17,9 +17,10 @@ P4 device example configuration. """ from common.tools.object_factory.ConfigRule import json_config_rule_set -from common.tools.object_factory.Device import json_device_p4_disabled +from common.tools.object_factory.Device import ( + json_device_connect_rules, json_device_id, json_device_p4_disabled) -DEVICE_P4_ID = 0 +DEVICE_P4_DPID = 0 DEVICE_P4_NAME = 'device:leaf1' DEVICE_P4_ADDRESS = '127.0.0.1' DEVICE_P4_PORT = '50101' @@ -29,21 +30,22 @@ DEVICE_P4_SW_VER = 'Stratum' DEVICE_P4_PIPECONF = 'org.onosproject.pipelines.fabric' DEVICE_P4_WORKERS = 2 DEVICE_P4_GRACE_PERIOD = 60 +DEVICE_P4_TIMEOUT = 60 -DEVICE_P4_UUID = {'device_uuid': {'uuid': DEVICE_P4_NAME}} +DEVICE_P4_UUID = DEVICE_P4_NAME +DEVICE_P4_ID = json_device_id(DEVICE_P4_UUID) DEVICE_P4 = json_device_p4_disabled(DEVICE_P4_UUID) -DEVICE_P4_CONNECT_RULES = [ - json_config_rule_set('_connect/address', DEVICE_P4_ADDRESS), - json_config_rule_set('_connect/port', DEVICE_P4_PORT), - json_config_rule_set('_connect/settings', { - 'id' : int(DEVICE_P4_ID), - 'name' : DEVICE_P4_NAME, - 'hw-ver' : DEVICE_P4_HW_VER, - 'sw-ver' : DEVICE_P4_SW_VER, - 'pipeconf': DEVICE_P4_PIPECONF - }), -] +DEVICE_P4_CONNECT_RULES = json_device_connect_rules( + DEVICE_P4_ADDRESS, DEVICE_P4_PORT, { + 'id': DEVICE_P4_DPID, + 'name': DEVICE_P4_NAME, + 'hw-ver': DEVICE_P4_HW_VER, + 'sw-ver': DEVICE_P4_SW_VER, + 'pipeconf': DEVICE_P4_PIPECONF, + 'timeout': DEVICE_P4_TIMEOUT + } +) DEVICE_P4_CONFIG_RULES = [ json_config_rule_set('key1', 'value1'), diff --git a/src/device/tests/test_unit_p4.py b/src/device/tests/test_unit_p4.py index 853d9d8a5fa4795fbec1445bd0f9d518402023c7..777ab280aa2b500c3c2b445fcecdf81024b817f3 100644 --- a/src/device/tests/test_unit_p4.py +++ b/src/device/tests/test_unit_p4.py @@ -15,7 +15,7 @@ import pytest from device.service.drivers.p4.p4_driver import P4Driver from .device_p4 import( - DEVICE_P4_ADDRESS, DEVICE_P4_PORT, DEVICE_P4_ID, DEVICE_P4_NAME, + DEVICE_P4_ADDRESS, DEVICE_P4_PORT, DEVICE_P4_DPID, DEVICE_P4_NAME, DEVICE_P4_VENDOR, DEVICE_P4_HW_VER, DEVICE_P4_SW_VER, DEVICE_P4_PIPECONF, DEVICE_P4_WORKERS, DEVICE_P4_GRACE_PERIOD) from .mock_p4runtime_service import MockP4RuntimeService @@ -37,7 +37,7 @@ def device_driverapi_p4(): _driver = P4Driver( address=DEVICE_P4_ADDRESS, port=DEVICE_P4_PORT, - id=DEVICE_P4_ID, + id=DEVICE_P4_DPID, name=DEVICE_P4_NAME, vendor=DEVICE_P4_VENDOR, hw_ver=DEVICE_P4_HW_VER, diff --git a/src/device/tests/test_unitary.py b/src/device/tests/test_unitary.py deleted file mode 100644 index 64c54deb0e784fbf075d7d6973ed01b0708d4867..0000000000000000000000000000000000000000 --- a/src/device/tests/test_unitary.py +++ /dev/null @@ -1,996 +0,0 @@ -# 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. - -import calendar, copy, dateutil.parser, grpc, json, logging, operator, os, pytest, queue, time -from datetime import datetime, timezone -from typing import Tuple -from common.orm.Database import Database -from common.orm.Factory import get_database_backend, BackendEnum as DatabaseBackendEnum -from common.message_broker.Factory import get_messagebroker_backend, BackendEnum as MessageBrokerBackendEnum -from common.message_broker.MessageBroker import MessageBroker -from common.tools.grpc.Tools import grpc_message_to_json_string -from common.tools.object_factory.EndPoint import json_endpoint, json_endpoint_id -from context.Config import ( - GRPC_SERVICE_PORT as CONTEXT_GRPC_SERVICE_PORT, GRPC_MAX_WORKERS as CONTEXT_GRPC_MAX_WORKERS, - GRPC_GRACE_PERIOD as CONTEXT_GRPC_GRACE_PERIOD) -from context.client.ContextClient import ContextClient -from context.proto.context_pb2 import DeviceId, DeviceOperationalStatusEnum -from context.service.grpc_server.ContextService import ContextService -from device.Config import ( - GRPC_SERVICE_PORT as DEVICE_GRPC_SERVICE_PORT, GRPC_MAX_WORKERS as DEVICE_GRPC_MAX_WORKERS, - GRPC_GRACE_PERIOD as DEVICE_GRPC_GRACE_PERIOD) -from device.client.DeviceClient import DeviceClient -from device.proto.context_pb2 import ConfigActionEnum, Context, Device, Topology -from device.proto.device_pb2 import MonitoringSettings -from device.proto.kpi_sample_types_pb2 import KpiSampleType -from device.service.DeviceService import DeviceService -from device.service.driver_api._Driver import _Driver -from device.service.driver_api.DriverFactory import DriverFactory -from device.service.driver_api.DriverInstanceCache import DriverInstanceCache -from device.service.drivers import DRIVERS -from device.tests.MockMonitoringService import MockMonitoringService -from monitoring.Config import ( - GRPC_SERVICE_PORT as MONITORING_GRPC_SERVICE_PORT, GRPC_MAX_WORKERS as MONITORING_GRPC_MAX_WORKERS, - GRPC_GRACE_PERIOD as MONITORING_GRPC_GRACE_PERIOD) -from monitoring.client.monitoring_client import MonitoringClient -from .CommonObjects import CONTEXT, TOPOLOGY - -from .Device_Emulated import ( - DEVICE_EMU, DEVICE_EMU_CONFIG_ADDRESSES, DEVICE_EMU_CONFIG_ENDPOINTS, DEVICE_EMU_CONNECT_RULES, - DEVICE_EMU_DECONFIG_ADDRESSES, DEVICE_EMU_DECONFIG_ENDPOINTS, DEVICE_EMU_EP_DESCS, DEVICE_EMU_ENDPOINTS_COOKED, - DEVICE_EMU_ID, DEVICE_EMU_RECONFIG_ADDRESSES, DEVICE_EMU_UUID) -ENABLE_EMULATED = True - -try: - from .Device_OpenConfig_Infinera1 import( - #from .Device_OpenConfig_Infinera2 import( - DEVICE_OC, DEVICE_OC_CONFIG_RULES, DEVICE_OC_DECONFIG_RULES, DEVICE_OC_CONNECT_RULES, DEVICE_OC_ID, - DEVICE_OC_UUID) - ENABLE_OPENCONFIG = True -except ImportError: - ENABLE_OPENCONFIG = False - -try: - from .Device_Transport_Api_CTTC import ( - DEVICE_TAPI, DEVICE_TAPI_CONNECT_RULES, DEVICE_TAPI_UUID, DEVICE_TAPI_ID, DEVICE_TAPI_CONFIG_RULES, - DEVICE_TAPI_DECONFIG_RULES) - ENABLE_TAPI = True -except ImportError: - ENABLE_TAPI = False - -from .mock_p4runtime_service import MockP4RuntimeService -try: - from .device_p4 import( - DEVICE_P4, DEVICE_P4_ID, DEVICE_P4_UUID, DEVICE_P4_NAME, DEVICE_P4_ADDRESS, DEVICE_P4_PORT, DEVICE_P4_WORKERS, - DEVICE_P4_GRACE_PERIOD, DEVICE_P4_CONNECT_RULES, DEVICE_P4_CONFIG_RULES) - ENABLE_P4 = True -except ImportError: - ENABLE_P4 = False - -#ENABLE_EMULATED = False # set to False to disable tests of Emulated devices -#ENABLE_OPENCONFIG = False # set to False to disable tests of OpenConfig devices -#ENABLE_TAPI = False # set to False to disable tests of TAPI devices -ENABLE_P4 = False # set to False to disable tests of P4 devices (P4 device not available in GitLab) - -ENABLE_OPENCONFIG_CONFIGURE = True -ENABLE_OPENCONFIG_MONITOR = True -ENABLE_OPENCONFIG_DECONFIGURE = True - - -logging.getLogger('apscheduler.executors.default').setLevel(logging.WARNING) -logging.getLogger('apscheduler.scheduler').setLevel(logging.WARNING) -logging.getLogger('monitoring-client').setLevel(logging.WARNING) - -LOGGER = logging.getLogger(__name__) -LOGGER.setLevel(logging.DEBUG) - -CONTEXT_GRPC_SERVICE_PORT = 10000 + CONTEXT_GRPC_SERVICE_PORT # avoid privileged ports -DEVICE_GRPC_SERVICE_PORT = 10000 + DEVICE_GRPC_SERVICE_PORT # avoid privileged ports -MONITORING_GRPC_SERVICE_PORT = 10000 + MONITORING_GRPC_SERVICE_PORT # avoid privileged ports - -DEFAULT_REDIS_SERVICE_HOST = '127.0.0.1' -DEFAULT_REDIS_SERVICE_PORT = 6379 -DEFAULT_REDIS_DATABASE_ID = 0 - -REDIS_CONFIG = { - 'REDIS_SERVICE_HOST': os.environ.get('REDIS_SERVICE_HOST', DEFAULT_REDIS_SERVICE_HOST), - 'REDIS_SERVICE_PORT': os.environ.get('REDIS_SERVICE_PORT', DEFAULT_REDIS_SERVICE_PORT), - 'REDIS_DATABASE_ID' : os.environ.get('REDIS_DATABASE_ID', DEFAULT_REDIS_DATABASE_ID ), -} - -SCENARIOS = [ - ('all_inmemory', DatabaseBackendEnum.INMEMORY, {}, MessageBrokerBackendEnum.INMEMORY, {} ), - #('all_redis', DatabaseBackendEnum.REDIS, REDIS_CONFIG, MessageBrokerBackendEnum.REDIS, REDIS_CONFIG), -] - -@pytest.fixture(scope='session', ids=[str(scenario[0]) for scenario in SCENARIOS], params=SCENARIOS) -def context_db_mb(request) -> Tuple[Database, MessageBroker]: - name,db_backend,db_settings,mb_backend,mb_settings = request.param - msg = 'Running scenario {:s} db_backend={:s}, db_settings={:s}, mb_backend={:s}, mb_settings={:s}...' - LOGGER.info(msg.format(str(name), str(db_backend.value), str(db_settings), str(mb_backend.value), str(mb_settings))) - _database = Database(get_database_backend(backend=db_backend, **db_settings)) - _message_broker = MessageBroker(get_messagebroker_backend(backend=mb_backend, **mb_settings)) - yield _database, _message_broker - _message_broker.terminate() - -@pytest.fixture(scope='session') -def context_service(context_db_mb : Tuple[Database, MessageBroker]): # pylint: disable=redefined-outer-name - _service = ContextService( - context_db_mb[0], context_db_mb[1], port=CONTEXT_GRPC_SERVICE_PORT, max_workers=CONTEXT_GRPC_MAX_WORKERS, - grace_period=CONTEXT_GRPC_GRACE_PERIOD) - _service.start() - yield _service - _service.stop() - -@pytest.fixture(scope='session') -def context_client(context_service : ContextService): # pylint: disable=redefined-outer-name - _client = ContextClient(address='127.0.0.1', port=CONTEXT_GRPC_SERVICE_PORT) - yield _client - _client.close() - -@pytest.fixture(scope='session') -def monitoring_service(): - _service = MockMonitoringService(port=MONITORING_GRPC_SERVICE_PORT, max_workers=MONITORING_GRPC_MAX_WORKERS, - grace_period=MONITORING_GRPC_GRACE_PERIOD) - _service.start() - yield _service - _service.stop() - -@pytest.fixture(scope='session') -def monitoring_client(monitoring_service : MockMonitoringService): # pylint: disable=redefined-outer-name - _client = MonitoringClient(server='127.0.0.1', port=MONITORING_GRPC_SERVICE_PORT) - #yield _client - #_client.close() - return _client - -@pytest.fixture(scope='session') -def device_service( - context_client : ContextClient, # pylint: disable=redefined-outer-name - monitoring_client : MonitoringClient): # pylint: disable=redefined-outer-name - - _driver_factory = DriverFactory(DRIVERS) - _driver_instance_cache = DriverInstanceCache(_driver_factory) - _service = DeviceService( - context_client, monitoring_client, _driver_instance_cache, port=DEVICE_GRPC_SERVICE_PORT, - max_workers=DEVICE_GRPC_MAX_WORKERS, grace_period=DEVICE_GRPC_GRACE_PERIOD) - _service.start() - yield _service - _service.stop() - -@pytest.fixture(scope='session') -def device_client(device_service : DeviceService): # pylint: disable=redefined-outer-name - _client = DeviceClient(address='127.0.0.1', port=DEVICE_GRPC_SERVICE_PORT) - yield _client - _client.close() - -@pytest.fixture(scope='session') -def p4runtime_service(): - _service = MockP4RuntimeService( - address=DEVICE_P4_ADDRESS, port=DEVICE_P4_PORT, - max_workers=DEVICE_P4_WORKERS, - grace_period=DEVICE_P4_GRACE_PERIOD) - _service.start() - yield _service - _service.stop() - - -def test_prepare_environment( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService): # pylint: disable=redefined-outer-name - - context_client.SetContext(Context(**CONTEXT)) - context_client.SetTopology(Topology(**TOPOLOGY)) - - -# ----- Test Device Driver Emulated -------------------------------------------- -# Device Driver Emulated tests are used to validate Driver API as well as Emulated Device Driver. Note that other -# Drivers might support a different set of resource paths, and attributes/values per resource; however, they must -# implement the Driver API. - -def test_device_emulated_add_error_cases( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService): # pylint: disable=redefined-outer-name - - if not ENABLE_EMULATED: pytest.skip('Skipping test: No Emulated device has been configured') - - with pytest.raises(grpc.RpcError) as e: - DEVICE_EMU_WITH_ENDPOINTS = copy.deepcopy(DEVICE_EMU) - DEVICE_EMU_WITH_ENDPOINTS['device_endpoints'].append(json_endpoint(DEVICE_EMU_ID, 'ep-id', 'ep-type')) - device_client.AddDevice(Device(**DEVICE_EMU_WITH_ENDPOINTS)) - assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT - msg_head = 'device.device_endpoints([' - msg_tail = ']) is invalid; RPC method AddDevice does not accept Endpoints. '\ - 'Endpoints are discovered through interrogation of the physical device.' - except_msg = str(e.value.details()) - assert except_msg.startswith(msg_head) and except_msg.endswith(msg_tail) - - with pytest.raises(grpc.RpcError) as e: - DEVICE_EMU_WITH_EXTRA_RULES = copy.deepcopy(DEVICE_EMU) - DEVICE_EMU_WITH_EXTRA_RULES['device_config']['config_rules'].extend(DEVICE_EMU_CONNECT_RULES) - DEVICE_EMU_WITH_EXTRA_RULES['device_config']['config_rules'].extend(DEVICE_EMU_CONFIG_ENDPOINTS) - device_client.AddDevice(Device(**DEVICE_EMU_WITH_EXTRA_RULES)) - assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT - msg_head = 'device.device_config.config_rules([' - msg_tail = ']) is invalid; RPC method AddDevice only accepts connection Config Rules that should start '\ - 'with "_connect/" tag. Others should be configured after adding the device.' - except_msg = str(e.value.details()) - assert except_msg.startswith(msg_head) and except_msg.endswith(msg_tail) - - -def test_device_emulated_add_correct( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService): # pylint: disable=redefined-outer-name - - if not ENABLE_EMULATED: pytest.skip('Skipping test: No Emulated device has been configured') - - DEVICE_EMU_WITH_CONNECT_RULES = copy.deepcopy(DEVICE_EMU) - DEVICE_EMU_WITH_CONNECT_RULES['device_config']['config_rules'].extend(DEVICE_EMU_CONNECT_RULES) - device_client.AddDevice(Device(**DEVICE_EMU_WITH_CONNECT_RULES)) - driver : _Driver = device_service.driver_instance_cache.get(DEVICE_EMU_UUID) # we know the driver exists now - assert driver is not None - - -def test_device_emulated_get( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService): # pylint: disable=redefined-outer-name - - if not ENABLE_EMULATED: pytest.skip('Skipping test: No Emulated device has been configured') - - initial_config = device_client.GetInitialConfig(DeviceId(**DEVICE_EMU_ID)) - LOGGER.info('initial_config = {:s}'.format(grpc_message_to_json_string(initial_config))) - - device_data = context_client.GetDevice(DeviceId(**DEVICE_EMU_ID)) - LOGGER.info('device_data = {:s}'.format(grpc_message_to_json_string(device_data))) - - -def test_device_emulated_configure( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService): # pylint: disable=redefined-outer-name - - if not ENABLE_EMULATED: pytest.skip('Skipping test: No Emulated device has been configured') - - driver : _Driver = device_service.driver_instance_cache.get(DEVICE_EMU_UUID) # we know the driver exists now - assert driver is not None - - driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) - #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) - assert len(driver_config) == len(DEVICE_EMU_ENDPOINTS_COOKED) - for endpoint_cooked in DEVICE_EMU_ENDPOINTS_COOKED: - assert endpoint_cooked in driver_config - - DEVICE_EMU_WITH_CONFIG_RULES = copy.deepcopy(DEVICE_EMU) - DEVICE_EMU_WITH_CONFIG_RULES['device_config']['config_rules'].extend(DEVICE_EMU_CONFIG_ENDPOINTS) - device_client.ConfigureDevice(Device(**DEVICE_EMU_WITH_CONFIG_RULES)) - - DEVICE_EMU_WITH_CONFIG_RULES = copy.deepcopy(DEVICE_EMU) - DEVICE_EMU_WITH_CONFIG_RULES['device_config']['config_rules'].extend(DEVICE_EMU_CONFIG_ADDRESSES) - device_client.ConfigureDevice(Device(**DEVICE_EMU_WITH_CONFIG_RULES)) - - DEVICE_EMU_WITH_OPERATIONAL_STATUS = copy.deepcopy(DEVICE_EMU) - DEVICE_EMU_WITH_OPERATIONAL_STATUS['device_operational_status'] = \ - DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED - device_client.ConfigureDevice(Device(**DEVICE_EMU_WITH_OPERATIONAL_STATUS)) - - driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) - #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) - assert len(driver_config) == len(DEVICE_EMU_ENDPOINTS_COOKED) + len(DEVICE_EMU_CONFIG_ADDRESSES) - for endpoint_cooked in DEVICE_EMU_ENDPOINTS_COOKED: - endpoint_cooked = copy.deepcopy(endpoint_cooked) - endpoint_cooked[1]['enabled'] = True - assert endpoint_cooked in driver_config - for config_rule in DEVICE_EMU_CONFIG_ADDRESSES: - assert (config_rule['resource_key'], json.loads(config_rule['resource_value'])) in driver_config - - device_data = context_client.GetDevice(DeviceId(**DEVICE_EMU_ID)) - assert device_data.device_operational_status == DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED - - config_rules = [ - (ConfigActionEnum.Name(config_rule.action), config_rule.resource_key, config_rule.resource_value) - for config_rule in device_data.device_config.config_rules - ] - #LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( - # '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) - RESULTING_CONFIG_ENDPOINTS = {cr['resource_key']:cr for cr in copy.deepcopy(DEVICE_EMU_CONFIG_ENDPOINTS)} - for endpoint_cooked in DEVICE_EMU_ENDPOINTS_COOKED: - values = json.loads(RESULTING_CONFIG_ENDPOINTS[endpoint_cooked[0]]['resource_value']) - values.update(endpoint_cooked[1]) - RESULTING_CONFIG_ENDPOINTS[endpoint_cooked[0]]['resource_value'] = json.dumps(values, sort_keys=True) - for config_rule in RESULTING_CONFIG_ENDPOINTS.values(): - config_rule = ( - ConfigActionEnum.Name(config_rule['action']), config_rule['resource_key'], - json.loads(json.dumps(config_rule['resource_value']))) - assert config_rule in config_rules - for config_rule in DEVICE_EMU_CONFIG_ADDRESSES: - config_rule = ( - ConfigActionEnum.Name(config_rule['action']), config_rule['resource_key'], - json.loads(json.dumps(config_rule['resource_value']))) - assert config_rule in config_rules - - # Try to reconfigure... - - DEVICE_EMU_WITH_RECONFIG_RULES = copy.deepcopy(DEVICE_EMU) - DEVICE_EMU_WITH_RECONFIG_RULES['device_operational_status'] = \ - DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED - DEVICE_EMU_WITH_RECONFIG_RULES['device_config']['config_rules'].extend(DEVICE_EMU_RECONFIG_ADDRESSES) - device_client.ConfigureDevice(Device(**DEVICE_EMU_WITH_RECONFIG_RULES)) - - RESULTING_CONFIG_RULES = {cr['resource_key']:cr for cr in copy.deepcopy(DEVICE_EMU_CONFIG_ENDPOINTS)} - for endpoint_cooked in DEVICE_EMU_ENDPOINTS_COOKED: - values = json.loads(RESULTING_CONFIG_RULES[endpoint_cooked[0]]['resource_value']) - values.update(endpoint_cooked[1]) - RESULTING_CONFIG_RULES[endpoint_cooked[0]]['resource_value'] = json.dumps(values, sort_keys=True) - RESULTING_CONFIG_RULES.update({cr['resource_key']:cr for cr in copy.deepcopy(DEVICE_EMU_CONFIG_ADDRESSES)}) - for reconfig_rule in DEVICE_EMU_RECONFIG_ADDRESSES: - if reconfig_rule['action'] == ConfigActionEnum.CONFIGACTION_DELETE: - RESULTING_CONFIG_RULES.pop(reconfig_rule['resource_key'], None) - else: - RESULTING_CONFIG_RULES[reconfig_rule['resource_key']] = reconfig_rule - RESULTING_CONFIG_RULES = RESULTING_CONFIG_RULES.values() - #LOGGER.info('RESULTING_CONFIG_RULES = {:s}'.format(str(RESULTING_CONFIG_RULES))) - - driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) - driver_config = json.loads(json.dumps(driver_config)) # prevent integer keys to fail matching with string keys - #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) - assert len(driver_config) == len(RESULTING_CONFIG_RULES) - for config_rule in RESULTING_CONFIG_RULES: - resource = [config_rule['resource_key'], json.loads(config_rule['resource_value'])] - assert resource in driver_config - - device_data = context_client.GetDevice(DeviceId(**DEVICE_EMU_ID)) - config_rules = [ - (ConfigActionEnum.Name(config_rule.action), config_rule.resource_key, config_rule.resource_value) - for config_rule in device_data.device_config.config_rules - ] - #LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( - # '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) - for config_rule in RESULTING_CONFIG_RULES: - config_rule = ( - ConfigActionEnum.Name(config_rule['action']), config_rule['resource_key'], config_rule['resource_value']) - assert config_rule in config_rules - - -def test_device_emulated_monitor( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService, # pylint: disable=redefined-outer-name - monitoring_service : MockMonitoringService): # pylint: disable=redefined-outer-name - - if not ENABLE_EMULATED: pytest.skip('Skipping test: No Emulated device has been configured') - - device_uuid = DEVICE_EMU_UUID - json_device_id = DEVICE_EMU_ID - device_id = DeviceId(**json_device_id) - device_data = context_client.GetDevice(device_id) - #LOGGER.info('device_data = \n{:s}'.format(str(device_data))) - - driver : _Driver = device_service.driver_instance_cache.get(device_uuid) # we know the driver exists now - assert driver is not None - #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) - #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) - #assert len(driver_config) == len(DEVICE_EMU_ENDPOINTS_COOKED) + len(DEVICE_EMU_CONFIG_ADDRESSES) - - SAMPLING_DURATION_SEC = 10.0 - SAMPLING_INTERVAL_SEC = 2.0 - - MONITORING_SETTINGS_LIST = [] - KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED = {} - for endpoint in device_data.device_endpoints: - endpoint_uuid = endpoint.endpoint_id.endpoint_uuid.uuid - for sample_type_id in endpoint.kpi_sample_types: - sample_type_name = str(KpiSampleType.Name(sample_type_id)).upper().replace('KPISAMPLETYPE_', '') - kpi_uuid = '{:s}-{:s}-{:s}-kpi_uuid'.format(device_uuid, endpoint_uuid, str(sample_type_id)) - monitoring_settings = { - 'kpi_id' : {'kpi_id': {'uuid': kpi_uuid}}, - 'kpi_descriptor': { - 'kpi_description': 'Metric {:s} for Endpoint {:s} in Device {:s}'.format( - sample_type_name, endpoint_uuid, device_uuid), - 'kpi_sample_type': sample_type_id, - 'device_id': json_device_id, - 'endpoint_id': json_endpoint_id(json_device_id, endpoint_uuid), - }, - 'sampling_duration_s': SAMPLING_DURATION_SEC, - 'sampling_interval_s': SAMPLING_INTERVAL_SEC, - } - MONITORING_SETTINGS_LIST.append(monitoring_settings) - KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED[kpi_uuid] = 0 - - NUM_SAMPLES_EXPECTED_PER_KPI = SAMPLING_DURATION_SEC / SAMPLING_INTERVAL_SEC - NUM_SAMPLES_EXPECTED = len(MONITORING_SETTINGS_LIST) * NUM_SAMPLES_EXPECTED_PER_KPI - - # Start monitoring the device - t_start_monitoring = datetime.timestamp(datetime.utcnow()) - for monitoring_settings in MONITORING_SETTINGS_LIST: - device_client.MonitorDeviceKpi(MonitoringSettings(**monitoring_settings)) - - # wait to receive the expected number of samples - # if takes more than 1.5 times the sampling duration, assume there is an error - time_ini = time.time() - queue_samples : queue.Queue = monitoring_service.queue_samples - received_samples = [] - while (len(received_samples) < NUM_SAMPLES_EXPECTED) and (time.time() - time_ini < SAMPLING_DURATION_SEC * 1.5): - try: - received_sample = queue_samples.get(block=True, timeout=SAMPLING_INTERVAL_SEC / NUM_SAMPLES_EXPECTED) - #LOGGER.info('received_sample = {:s}'.format(str(received_sample))) - received_samples.append(received_sample) - except queue.Empty: - continue - - t_end_monitoring = datetime.timestamp(datetime.utcnow()) - - #LOGGER.info('received_samples = {:s}'.format(str(received_samples))) - LOGGER.info('len(received_samples) = {:s}'.format(str(len(received_samples)))) - LOGGER.info('NUM_SAMPLES_EXPECTED = {:s}'.format(str(NUM_SAMPLES_EXPECTED))) - assert len(received_samples) == NUM_SAMPLES_EXPECTED - for received_sample in received_samples: - kpi_uuid = received_sample.kpi_id.kpi_id.uuid - assert kpi_uuid in KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED - assert isinstance(received_sample.timestamp, str) - try: - timestamp = float(received_sample.timestamp) - except ValueError: - dt_time = dateutil.parser.isoparse(received_sample.timestamp).replace(tzinfo=timezone.utc) - timestamp = float(calendar.timegm(dt_time.timetuple())) + (dt_time.microsecond / 1.e6) - assert timestamp > t_start_monitoring - assert timestamp < t_end_monitoring - assert received_sample.kpi_value.HasField('floatVal') or received_sample.kpi_value.HasField('intVal') - kpi_value = getattr(received_sample.kpi_value, received_sample.kpi_value.WhichOneof('value')) - assert isinstance(kpi_value, (float, int)) - KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED[kpi_uuid] += 1 - - LOGGER.info('KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED = {:s}'.format(str(KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED))) - for kpi_uuid, num_samples_received in KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED.items(): - assert num_samples_received == NUM_SAMPLES_EXPECTED_PER_KPI - - # Unsubscribe monitoring - for kpi_uuid in KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED.keys(): - MONITORING_SETTINGS_UNSUBSCRIBE = { - 'kpi_id' : {'kpi_id': {'uuid': kpi_uuid}}, - 'sampling_duration_s': -1, # negative value in sampling_duration_s or sampling_interval_s means unsibscribe - 'sampling_interval_s': -1, # kpi_id is mandatory to unsibscribe - } - device_client.MonitorDeviceKpi(MonitoringSettings(**MONITORING_SETTINGS_UNSUBSCRIBE)) - - -def test_device_emulated_deconfigure( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService): # pylint: disable=redefined-outer-name - - if not ENABLE_EMULATED: pytest.skip('Skipping test: No Emulated device has been configured') - - driver : _Driver = device_service.driver_instance_cache.get(DEVICE_EMU_UUID) # we know the driver exists now - assert driver is not None - - driver_config = driver.GetConfig() - #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) - - DEVICE_EMU_WITH_DECONFIG_RULES = copy.deepcopy(DEVICE_EMU) - DEVICE_EMU_WITH_DECONFIG_RULES['device_operational_status'] = \ - DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_DISABLED - DEVICE_EMU_WITH_DECONFIG_RULES['device_config']['config_rules'].extend(DEVICE_EMU_DECONFIG_ADDRESSES) - device_client.ConfigureDevice(Device(**DEVICE_EMU_WITH_DECONFIG_RULES)) - - RESULTING_CONFIG_RULES = {cr['resource_key']:cr for cr in copy.deepcopy(DEVICE_EMU_CONFIG_ENDPOINTS)} - for endpoint_cooked in DEVICE_EMU_ENDPOINTS_COOKED: - values = json.loads(RESULTING_CONFIG_RULES[endpoint_cooked[0]]['resource_value']) - values.update(endpoint_cooked[1]) - RESULTING_CONFIG_RULES[endpoint_cooked[0]]['resource_value'] = json.dumps(values, sort_keys=True) - RESULTING_CONFIG_RULES = RESULTING_CONFIG_RULES.values() - driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) - driver_config = json.loads(json.dumps(driver_config)) # prevent integer keys to fail matching with string keys - driver_config = list(filter( - lambda config_rule: ( - not isinstance(config_rule[1], str) or not config_rule[1].startswith('do_sampling (trigger:')), - driver_config)) - LOGGER.info('driver_config = {:s}'.format(str(driver_config))) - LOGGER.info('RESULTING_CONFIG_RULES = {:s}'.format(str(RESULTING_CONFIG_RULES))) - assert len(driver_config) == len(RESULTING_CONFIG_RULES) - for config_rule in RESULTING_CONFIG_RULES: - config_rule = [config_rule['resource_key'], json.loads(config_rule['resource_value'])] - #LOGGER.info('config_rule = {:s}'.format(str(config_rule))) - assert config_rule in driver_config - - DEVICE_EMU_WITH_DECONFIG_RULES = copy.deepcopy(DEVICE_EMU) - DEVICE_EMU_WITH_DECONFIG_RULES['device_config']['config_rules'].extend(DEVICE_EMU_DECONFIG_ENDPOINTS) - device_client.ConfigureDevice(Device(**DEVICE_EMU_WITH_DECONFIG_RULES)) - - driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) - driver_config = json.loads(json.dumps(driver_config)) # prevent integer keys to fail matching with string keys - #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) - assert len(driver_config) == 0 - - device_data = context_client.GetDevice(DeviceId(**DEVICE_EMU_ID)) - config_rules = device_data.device_config.config_rules - LOGGER.info('config_rules = {:s}'.format(str(config_rules))) - clean_config_rules = [] - for config_rule in config_rules: - config_rule_value = json.loads(config_rule.resource_value) - if not isinstance(config_rule_value, str): clean_config_rules.append(config_rule) - if config_rule_value.startswith('do_sampling (trigger:'): continue - clean_config_rules.append(config_rule) - LOGGER.info('clean_config_rules = {:s}'.format(str(clean_config_rules))) - assert len(clean_config_rules) == 0 - - -def test_device_emulated_delete( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService): # pylint: disable=redefined-outer-name - - if not ENABLE_EMULATED: pytest.skip('Skipping test: No Emulated device has been configured') - - device_client.DeleteDevice(DeviceId(**DEVICE_EMU_ID)) - driver : _Driver = device_service.driver_instance_cache.get(DEVICE_EMU_UUID, {}) - assert driver is None - - -# ----- Test Device Driver OpenConfig ------------------------------------------ - -def test_device_openconfig_add_error_cases( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService): # pylint: disable=redefined-outer-name - - if not ENABLE_OPENCONFIG: pytest.skip('Skipping test: No OpenConfig device has been configured') - - with pytest.raises(grpc.RpcError) as e: - DEVICE_OC_WITH_EXTRA_RULES = copy.deepcopy(DEVICE_OC) - DEVICE_OC_WITH_EXTRA_RULES['device_config']['config_rules'].extend(DEVICE_OC_CONNECT_RULES) - DEVICE_OC_WITH_EXTRA_RULES['device_config']['config_rules'].extend(DEVICE_OC_CONFIG_RULES) - device_client.AddDevice(Device(**DEVICE_OC_WITH_EXTRA_RULES)) - assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT - msg_head = 'device.device_config.config_rules([' - msg_tail = ']) is invalid; RPC method AddDevice only accepts connection Config Rules that should start '\ - 'with "_connect/" tag. Others should be configured after adding the device.' - except_msg = str(e.value.details()) - assert except_msg.startswith(msg_head) and except_msg.endswith(msg_tail) - - -def test_device_openconfig_add_correct( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService): # pylint: disable=redefined-outer-name - - if not ENABLE_OPENCONFIG: pytest.skip('Skipping test: No OpenConfig device has been configured') - - DEVICE_OC_WITH_CONNECT_RULES = copy.deepcopy(DEVICE_OC) - DEVICE_OC_WITH_CONNECT_RULES['device_config']['config_rules'].extend(DEVICE_OC_CONNECT_RULES) - device_client.AddDevice(Device(**DEVICE_OC_WITH_CONNECT_RULES)) - driver : _Driver = device_service.driver_instance_cache.get(DEVICE_OC_UUID) # we know the driver exists now - assert driver is not None - - device_data = context_client.GetDevice(DeviceId(**DEVICE_OC_ID)) - config_rules = [ - (ConfigActionEnum.Name(config_rule.action), config_rule.resource_key, config_rule.resource_value) - for config_rule in device_data.device_config.config_rules - ] - LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( - '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) - - -def test_device_openconfig_get( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService): # pylint: disable=redefined-outer-name - - if not ENABLE_OPENCONFIG: pytest.skip('Skipping test: No OpenConfig device has been configured') - - initial_config = device_client.GetInitialConfig(DeviceId(**DEVICE_OC_ID)) - LOGGER.info('initial_config = {:s}'.format(grpc_message_to_json_string(initial_config))) - - device_data = context_client.GetDevice(DeviceId(**DEVICE_OC_ID)) - LOGGER.info('device_data = {:s}'.format(grpc_message_to_json_string(device_data))) - - -def test_device_openconfig_configure( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService): # pylint: disable=redefined-outer-name - - if not ENABLE_OPENCONFIG: pytest.skip('Skipping test: No OpenConfig device has been configured') - if not ENABLE_OPENCONFIG_CONFIGURE: pytest.skip('Skipping test OpenConfig configure') - - driver : _Driver = device_service.driver_instance_cache.get(DEVICE_OC_UUID) # we know the driver exists now - assert driver is not None - - # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. - #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) - #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) - - DEVICE_OC_WITH_CONFIG_RULES = copy.deepcopy(DEVICE_OC) - DEVICE_OC_WITH_CONFIG_RULES['device_config']['config_rules'].extend(DEVICE_OC_CONFIG_RULES) - device_client.ConfigureDevice(Device(**DEVICE_OC_WITH_CONFIG_RULES)) - - # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. - #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) - #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) - - device_data = context_client.GetDevice(DeviceId(**DEVICE_OC_ID)) - config_rules = [ - (ConfigActionEnum.Name(config_rule.action), config_rule.resource_key, config_rule.resource_value) - for config_rule in device_data.device_config.config_rules - ] - LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( - '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) - for config_rule in DEVICE_OC_CONFIG_RULES: - config_rule = ( - ConfigActionEnum.Name(config_rule['action']), config_rule['resource_key'], config_rule['resource_value']) - assert config_rule in config_rules - - -def test_device_openconfig_monitor( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService, # pylint: disable=redefined-outer-name - monitoring_service : MockMonitoringService): # pylint: disable=redefined-outer-name - - if not ENABLE_OPENCONFIG: pytest.skip('Skipping test: No OpenConfig device has been configured') - if not ENABLE_OPENCONFIG_MONITOR: pytest.skip('Skipping test OpenConfig monitor') - - device_uuid = DEVICE_OC_UUID - json_device_id = DEVICE_OC_ID - device_id = DeviceId(**json_device_id) - device_data = context_client.GetDevice(device_id) - #LOGGER.info('device_data = \n{:s}'.format(str(device_data))) - - driver : _Driver = device_service.driver_instance_cache.get(device_uuid) # we know the driver exists now - assert driver is not None - - SAMPLING_DURATION_SEC = 60.0 - SAMPLING_INTERVAL_SEC = 15.0 - - MONITORING_SETTINGS_LIST = [] - KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED = {} - for endpoint in device_data.device_endpoints: - endpoint_uuid = endpoint.endpoint_id.endpoint_uuid.uuid - for sample_type_id in endpoint.kpi_sample_types: - sample_type_name = str(KpiSampleType.Name(sample_type_id)).upper().replace('KPISAMPLETYPE_', '') - kpi_uuid = '{:s}-{:s}-{:s}-kpi_uuid'.format(device_uuid, endpoint_uuid, str(sample_type_id)) - monitoring_settings = { - 'kpi_id' : {'kpi_id': {'uuid': kpi_uuid}}, - 'kpi_descriptor': { - 'kpi_description': 'Metric {:s} for Endpoint {:s} in Device {:s}'.format( - sample_type_name, endpoint_uuid, device_uuid), - 'kpi_sample_type': sample_type_id, - 'device_id': json_device_id, - 'endpoint_id': json_endpoint_id(json_device_id, endpoint_uuid), - }, - 'sampling_duration_s': SAMPLING_DURATION_SEC, - 'sampling_interval_s': SAMPLING_INTERVAL_SEC, - } - MONITORING_SETTINGS_LIST.append(monitoring_settings) - KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED[kpi_uuid] = 0 - - NUM_SAMPLES_EXPECTED_PER_KPI = SAMPLING_DURATION_SEC / SAMPLING_INTERVAL_SEC - NUM_SAMPLES_EXPECTED = len(MONITORING_SETTINGS_LIST) * NUM_SAMPLES_EXPECTED_PER_KPI - - # Start monitoring the device - t_start_monitoring = datetime.timestamp(datetime.utcnow()) - for monitoring_settings in MONITORING_SETTINGS_LIST: - device_client.MonitorDeviceKpi(MonitoringSettings(**monitoring_settings)) - - # wait to receive the expected number of samples - # if takes more than 1.5 times the sampling duration, assume there is an error - time_ini = time.time() - queue_samples : queue.Queue = monitoring_service.queue_samples - received_samples = [] - while (len(received_samples) < NUM_SAMPLES_EXPECTED) and (time.time() - time_ini < SAMPLING_DURATION_SEC * 1.5): - try: - received_sample = queue_samples.get(block=True, timeout=SAMPLING_INTERVAL_SEC / NUM_SAMPLES_EXPECTED) - #LOGGER.info('received_sample = {:s}'.format(str(received_sample))) - received_samples.append(received_sample) - except queue.Empty: - continue - - t_end_monitoring = datetime.timestamp(datetime.utcnow()) - - #LOGGER.info('received_samples = {:s}'.format(str(received_samples))) - LOGGER.info('len(received_samples) = {:s}'.format(str(len(received_samples)))) - LOGGER.info('NUM_SAMPLES_EXPECTED = {:s}'.format(str(NUM_SAMPLES_EXPECTED))) - #assert len(received_samples) == NUM_SAMPLES_EXPECTED - for received_sample in received_samples: - kpi_uuid = received_sample.kpi_id.kpi_id.uuid - assert kpi_uuid in KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED - assert isinstance(received_sample.timestamp, str) - try: - timestamp = float(received_sample.timestamp) - except ValueError: - dt_time = dateutil.parser.isoparse(received_sample.timestamp).replace(tzinfo=timezone.utc) - timestamp = float(calendar.timegm(dt_time.timetuple())) + (dt_time.microsecond / 1.e6) - assert timestamp > t_start_monitoring - assert timestamp < t_end_monitoring - assert received_sample.kpi_value.HasField('floatVal') or received_sample.kpi_value.HasField('intVal') - kpi_value = getattr(received_sample.kpi_value, received_sample.kpi_value.WhichOneof('value')) - assert isinstance(kpi_value, (float, int)) - KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED[kpi_uuid] += 1 - - LOGGER.info('KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED = {:s}'.format(str(KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED))) - # TODO: review why num_samples_received per KPI != NUM_SAMPLES_EXPECTED_PER_KPI - #for kpi_uuid, num_samples_received in KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED.items(): - # assert num_samples_received == NUM_SAMPLES_EXPECTED_PER_KPI - - # Unsubscribe monitoring - for kpi_uuid in KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED.keys(): - MONITORING_SETTINGS_UNSUBSCRIBE = { - 'kpi_id' : {'kpi_id': {'uuid': kpi_uuid}}, - 'sampling_duration_s': -1, # negative value in sampling_duration_s or sampling_interval_s means unsibscribe - 'sampling_interval_s': -1, # kpi_id is mandatory to unsibscribe - } - device_client.MonitorDeviceKpi(MonitoringSettings(**MONITORING_SETTINGS_UNSUBSCRIBE)) - - -def test_device_openconfig_deconfigure( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService): # pylint: disable=redefined-outer-name - - if not ENABLE_OPENCONFIG: pytest.skip('Skipping test: No OpenConfig device has been configured') - if not ENABLE_OPENCONFIG_DECONFIGURE: pytest.skip('Skipping test OpenConfig deconfigure') - - driver : _Driver = device_service.driver_instance_cache.get(DEVICE_OC_UUID) # we know the driver exists now - assert driver is not None - - # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. - #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) - #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) - - DEVICE_OC_WITH_DECONFIG_RULES = copy.deepcopy(DEVICE_OC) - DEVICE_OC_WITH_DECONFIG_RULES['device_config']['config_rules'].extend(DEVICE_OC_DECONFIG_RULES) - device_client.ConfigureDevice(Device(**DEVICE_OC_WITH_DECONFIG_RULES)) - - # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. - #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) - #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) - - device_data = context_client.GetDevice(DeviceId(**DEVICE_OC_ID)) - config_rules = [ - (ConfigActionEnum.Name(config_rule.action), config_rule.resource_key, config_rule.resource_value) - for config_rule in device_data.device_config.config_rules - ] - LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( - '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) - for config_rule in DEVICE_OC_DECONFIG_RULES: - action_set = ConfigActionEnum.Name(ConfigActionEnum.CONFIGACTION_SET) - config_rule = (action_set, config_rule['resource_key'], config_rule['resource_value']) - assert config_rule not in config_rules - - -def test_device_openconfig_delete( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService): # pylint: disable=redefined-outer-name - - if not ENABLE_OPENCONFIG: pytest.skip('Skipping test: No OpenConfig device has been configured') - - device_client.DeleteDevice(DeviceId(**DEVICE_OC_ID)) - driver : _Driver = device_service.driver_instance_cache.get(DEVICE_OC_UUID, {}) - assert driver is None - - -# ----- Test Device Driver TAPI ------------------------------------------------ - -def test_device_tapi_add_error_cases( - device_client : DeviceClient): # pylint: disable=redefined-outer-name - - if not ENABLE_TAPI: pytest.skip('Skipping test: No TAPI device has been configured') - - with pytest.raises(grpc.RpcError) as e: - DEVICE_TAPI_WITH_EXTRA_RULES = copy.deepcopy(DEVICE_TAPI) - DEVICE_TAPI_WITH_EXTRA_RULES['device_config']['config_rules'].extend(DEVICE_TAPI_CONNECT_RULES) - DEVICE_TAPI_WITH_EXTRA_RULES['device_config']['config_rules'].extend(DEVICE_TAPI_CONFIG_RULES) - device_client.AddDevice(Device(**DEVICE_TAPI_WITH_EXTRA_RULES)) - assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT - msg_head = 'device.device_config.config_rules([' - msg_tail = ']) is invalid; RPC method AddDevice only accepts connection Config Rules that should start '\ - 'with "_connect/" tag. Others should be configured after adding the device.' - except_msg = str(e.value.details()) - assert except_msg.startswith(msg_head) and except_msg.endswith(msg_tail) - - -def test_device_tapi_add_correct( - device_client: DeviceClient, # pylint: disable=redefined-outer-name - device_service: DeviceService): # pylint: disable=redefined-outer-name - - if not ENABLE_TAPI: pytest.skip('Skipping test: No TAPI device has been configured') - - DEVICE_TAPI_WITH_CONNECT_RULES = copy.deepcopy(DEVICE_TAPI) - DEVICE_TAPI_WITH_CONNECT_RULES['device_config']['config_rules'].extend(DEVICE_TAPI_CONNECT_RULES) - device_client.AddDevice(Device(**DEVICE_TAPI_WITH_CONNECT_RULES)) - driver: _Driver = device_service.driver_instance_cache.get(DEVICE_TAPI_UUID) - assert driver is not None - - -def test_device_tapi_get( - context_client: ContextClient, # pylint: disable=redefined-outer-name - device_client: DeviceClient): # pylint: disable=redefined-outer-name - - if not ENABLE_TAPI: pytest.skip('Skipping test: No TAPI device has been configured') - - initial_config = device_client.GetInitialConfig(DeviceId(**DEVICE_TAPI_ID)) - LOGGER.info('initial_config = {:s}'.format(grpc_message_to_json_string(initial_config))) - - device_data = context_client.GetDevice(DeviceId(**DEVICE_TAPI_ID)) - LOGGER.info('device_data = {:s}'.format(grpc_message_to_json_string(device_data))) - - -def test_device_tapi_configure( - context_client: ContextClient, # pylint: disable=redefined-outer-name - device_client: DeviceClient, # pylint: disable=redefined-outer-name - device_service: DeviceService): # pylint: disable=redefined-outer-name - - if not ENABLE_TAPI: pytest.skip('Skipping test: No TAPI device has been configured') - - driver : _Driver = device_service.driver_instance_cache.get(DEVICE_TAPI_UUID) - assert driver is not None - - # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. - #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) - #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) - - DEVICE_TAPI_WITH_CONFIG_RULES = copy.deepcopy(DEVICE_TAPI) - DEVICE_TAPI_WITH_CONFIG_RULES['device_config']['config_rules'].extend(DEVICE_TAPI_CONFIG_RULES) - device_client.ConfigureDevice(Device(**DEVICE_TAPI_WITH_CONFIG_RULES)) - - # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. - #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) - #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) - - device_data = context_client.GetDevice(DeviceId(**DEVICE_TAPI_ID)) - config_rules = [ - (ConfigActionEnum.Name(config_rule.action), config_rule.resource_key, config_rule.resource_value) - for config_rule in device_data.device_config.config_rules - ] - LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( - '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) - for config_rule in DEVICE_TAPI_CONFIG_RULES: - config_rule = ( - ConfigActionEnum.Name(config_rule['action']), config_rule['resource_key'], config_rule['resource_value']) - assert config_rule in config_rules - - -def test_device_tapi_deconfigure( - context_client: ContextClient, # pylint: disable=redefined-outer-name - device_client: DeviceClient, # pylint: disable=redefined-outer-name - device_service: DeviceService): # pylint: disable=redefined-outer-name - - if not ENABLE_TAPI: pytest.skip('Skipping test: No TAPI device has been configured') - - driver: _Driver = device_service.driver_instance_cache.get(DEVICE_TAPI_UUID) - assert driver is not None - - # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. - #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) - #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) - - DEVICE_TAPI_WITH_DECONFIG_RULES = copy.deepcopy(DEVICE_TAPI) - DEVICE_TAPI_WITH_DECONFIG_RULES['device_config']['config_rules'].extend(DEVICE_TAPI_DECONFIG_RULES) - device_client.ConfigureDevice(Device(**DEVICE_TAPI_WITH_DECONFIG_RULES)) - - # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. - #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) - #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) - - device_data = context_client.GetDevice(DeviceId(**DEVICE_TAPI_ID)) - config_rules = [ - (ConfigActionEnum.Name(config_rule.action), config_rule.resource_key, config_rule.resource_value) - for config_rule in device_data.device_config.config_rules - ] - LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( - '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) - for config_rule in DEVICE_TAPI_DECONFIG_RULES: - action_set = ConfigActionEnum.Name(ConfigActionEnum.CONFIGACTION_SET) - config_rule = (action_set, config_rule['resource_key'], config_rule['resource_value']) - assert config_rule not in config_rules - - -def test_device_tapi_delete( - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService): # pylint: disable=redefined-outer-name - - if not ENABLE_TAPI: pytest.skip('Skipping test: No TAPI device has been configured') - - device_client.DeleteDevice(DeviceId(**DEVICE_TAPI_ID)) - driver : _Driver = device_service.driver_instance_cache.get(DEVICE_TAPI_UUID, {}) - assert driver is None - - -# ----- Test Device Driver P4 -------------------------------------------------- - -def test_device_p4_add_error_cases( - context_client: ContextClient, # pylint: disable=redefined-outer-name - device_client: DeviceClient, # pylint: disable=redefined-outer-name - device_service: DeviceService): # pylint: disable=redefined-outer-name - - if not ENABLE_P4: pytest.skip('Skipping test: No P4 device has been configured') - - with pytest.raises(grpc.RpcError) as e: - device_p4_with_extra_rules = copy.deepcopy(DEVICE_P4) - device_p4_with_extra_rules['device_config']['config_rules'].extend( - DEVICE_P4_CONNECT_RULES) - device_p4_with_extra_rules['device_config']['config_rules'].extend( - DEVICE_P4_CONFIG_RULES) - device_client.AddDevice(Device(**device_p4_with_extra_rules)) - assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT - msg_head = 'device.device_config.config_rules([' - msg_tail = ']) is invalid; RPC method AddDevice only accepts connection Config Rules that should start '\ - 'with "_connect/" tag. Others should be configured after adding the device.' - except_msg = str(e.value.details()) - assert except_msg.startswith(msg_head) and except_msg.endswith(msg_tail) - - -def test_device_p4_add_correct( - context_client: ContextClient, # pylint: disable=redefined-outer-name - device_client: DeviceClient, # pylint: disable=redefined-outer-name - device_service: DeviceService, # pylint: disable=redefined-outer-name - p4runtime_service: MockP4RuntimeService): # pylint: disable=redefined-outer-name - - if not ENABLE_P4: pytest.skip('Skipping test: No P4 device has been configured') - - device_p4_with_connect_rules = copy.deepcopy(DEVICE_P4) - device_p4_with_connect_rules['device_config']['config_rules'].extend( - DEVICE_P4_CONNECT_RULES) - device_client.AddDevice(Device(**device_p4_with_connect_rules)) - driver : _Driver = device_service.driver_instance_cache.get(DEVICE_P4_NAME) - assert driver is not None - - -def test_device_p4_get( - context_client: ContextClient, # pylint: disable=redefined-outer-name - device_client: DeviceClient, # pylint: disable=redefined-outer-name - device_service: DeviceService, # pylint: disable=redefined-outer-name - p4runtime_service: MockP4RuntimeService): # pylint: disable=redefined-outer-name - - if not ENABLE_P4: pytest.skip('Skipping test: No P4 device has been configured') - - initial_config = device_client.GetInitialConfig(DeviceId(**DEVICE_P4_UUID)) - LOGGER.info('initial_config = {:s}'.format( - grpc_message_to_json_string(initial_config))) - - device_data = context_client.GetDevice(DeviceId(**DEVICE_P4_UUID)) - LOGGER.info('device_data = {:s}'.format( - grpc_message_to_json_string(device_data))) - - -def test_device_p4_configure( - context_client: ContextClient, # pylint: disable=redefined-outer-name - device_client: DeviceClient, # pylint: disable=redefined-outer-name - device_service: DeviceService, # pylint: disable=redefined-outer-name - p4runtime_service: MockP4RuntimeService): # pylint: disable=redefined-outer-name - pytest.skip('Skipping test for unimplemented method') - - -def test_device_p4_deconfigure( - context_client: ContextClient, # pylint: disable=redefined-outer-name - device_client: DeviceClient, # pylint: disable=redefined-outer-name - device_service: DeviceService, # pylint: disable=redefined-outer-name - p4runtime_service: MockP4RuntimeService): # pylint: disable=redefined-outer-name - pytest.skip('Skipping test for unimplemented method') - - -def test_device_p4_delete( - context_client: ContextClient, # pylint: disable=redefined-outer-name - device_client: DeviceClient, # pylint: disable=redefined-outer-name - device_service: DeviceService, # pylint: disable=redefined-outer-name - p4runtime_service: MockP4RuntimeService): # pylint: disable=redefined-outer-name - - if not ENABLE_P4: pytest.skip('Skipping test: No P4 device has been configured') - - device_client.DeleteDevice(DeviceId(**DEVICE_P4_UUID)) - driver : _Driver = device_service.driver_instance_cache.get(DEVICE_P4_NAME) - assert driver is None diff --git a/src/device/tests/test_unitary_emulated.py b/src/device/tests/test_unitary_emulated.py new file mode 100644 index 0000000000000000000000000000000000000000..67a2e9c33c11711ed3343c688f7bc5a88316eca0 --- /dev/null +++ b/src/device/tests/test_unitary_emulated.py @@ -0,0 +1,378 @@ +# 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. + +import calendar, copy, dateutil.parser, grpc, json, logging, operator, pytest, queue, time +from datetime import datetime, timezone +from common.tools.grpc.Tools import grpc_message_to_json_string +from common.tools.object_factory.EndPoint import json_endpoint, json_endpoint_id +from context.client.ContextClient import ContextClient +from context.proto.context_pb2 import DeviceId, DeviceOperationalStatusEnum +from device.client.DeviceClient import DeviceClient +from device.proto.context_pb2 import ConfigActionEnum, Device +from device.proto.device_pb2 import MonitoringSettings +from device.proto.kpi_sample_types_pb2 import KpiSampleType +from device.service.DeviceService import DeviceService +from device.service.driver_api._Driver import _Driver +from .MockService_Dependencies import MockService_Dependencies +from .PrepareTestScenario import ( # pylint: disable=unused-import + # be careful, order of symbols is important here! + mock_service, device_service, context_client, device_client, monitoring_client, test_prepare_environment) + +from .Device_Emulated import ( + DEVICE_EMU, DEVICE_EMU_CONFIG_ADDRESSES, DEVICE_EMU_CONFIG_ENDPOINTS, DEVICE_EMU_CONNECT_RULES, + DEVICE_EMU_DECONFIG_ADDRESSES, DEVICE_EMU_DECONFIG_ENDPOINTS, DEVICE_EMU_ENDPOINTS_COOKED, DEVICE_EMU_ID, + DEVICE_EMU_RECONFIG_ADDRESSES, DEVICE_EMU_UUID) + +logging.getLogger('apscheduler.executors.default').setLevel(logging.WARNING) +logging.getLogger('apscheduler.scheduler').setLevel(logging.WARNING) +logging.getLogger('monitoring-client').setLevel(logging.WARNING) + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +# ----- Test Device Driver Emulated -------------------------------------------- +# Device Driver Emulated tests are used to validate Driver API as well as Emulated Device Driver. Note that other +# Drivers might support a different set of resource paths, and attributes/values per resource; however, they must +# implement the Driver API. + +def test_device_emulated_add_error_cases( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + with pytest.raises(grpc.RpcError) as e: + DEVICE_EMU_WITH_ENDPOINTS = copy.deepcopy(DEVICE_EMU) + DEVICE_EMU_WITH_ENDPOINTS['device_endpoints'].append(json_endpoint(DEVICE_EMU_ID, 'ep-id', 'ep-type')) + device_client.AddDevice(Device(**DEVICE_EMU_WITH_ENDPOINTS)) + assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT + msg_head = 'device.device_endpoints([' + msg_tail = ']) is invalid; RPC method AddDevice does not accept Endpoints. '\ + 'Endpoints are discovered through interrogation of the physical device.' + except_msg = str(e.value.details()) + assert except_msg.startswith(msg_head) and except_msg.endswith(msg_tail) + + with pytest.raises(grpc.RpcError) as e: + DEVICE_EMU_WITH_EXTRA_RULES = copy.deepcopy(DEVICE_EMU) + DEVICE_EMU_WITH_EXTRA_RULES['device_config']['config_rules'].extend(DEVICE_EMU_CONNECT_RULES) + DEVICE_EMU_WITH_EXTRA_RULES['device_config']['config_rules'].extend(DEVICE_EMU_CONFIG_ENDPOINTS) + device_client.AddDevice(Device(**DEVICE_EMU_WITH_EXTRA_RULES)) + assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT + msg_head = 'device.device_config.config_rules([' + msg_tail = ']) is invalid; RPC method AddDevice only accepts connection Config Rules that should start '\ + 'with "_connect/" tag. Others should be configured after adding the device.' + except_msg = str(e.value.details()) + assert except_msg.startswith(msg_head) and except_msg.endswith(msg_tail) + + +def test_device_emulated_add_correct( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + DEVICE_EMU_WITH_CONNECT_RULES = copy.deepcopy(DEVICE_EMU) + DEVICE_EMU_WITH_CONNECT_RULES['device_config']['config_rules'].extend(DEVICE_EMU_CONNECT_RULES) + device_client.AddDevice(Device(**DEVICE_EMU_WITH_CONNECT_RULES)) + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(DEVICE_EMU_UUID) # we know the driver exists now + assert driver is not None + + +def test_device_emulated_get( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + initial_config = device_client.GetInitialConfig(DeviceId(**DEVICE_EMU_ID)) + LOGGER.info('initial_config = {:s}'.format(grpc_message_to_json_string(initial_config))) + + device_data = context_client.GetDevice(DeviceId(**DEVICE_EMU_ID)) + LOGGER.info('device_data = {:s}'.format(grpc_message_to_json_string(device_data))) + + +def test_device_emulated_configure( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(DEVICE_EMU_UUID) # we know the driver exists now + assert driver is not None + + driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + assert len(driver_config) == len(DEVICE_EMU_ENDPOINTS_COOKED) + for endpoint_cooked in DEVICE_EMU_ENDPOINTS_COOKED: + assert endpoint_cooked in driver_config + + DEVICE_EMU_WITH_CONFIG_RULES = copy.deepcopy(DEVICE_EMU) + DEVICE_EMU_WITH_CONFIG_RULES['device_config']['config_rules'].extend(DEVICE_EMU_CONFIG_ENDPOINTS) + device_client.ConfigureDevice(Device(**DEVICE_EMU_WITH_CONFIG_RULES)) + + DEVICE_EMU_WITH_CONFIG_RULES = copy.deepcopy(DEVICE_EMU) + DEVICE_EMU_WITH_CONFIG_RULES['device_config']['config_rules'].extend(DEVICE_EMU_CONFIG_ADDRESSES) + device_client.ConfigureDevice(Device(**DEVICE_EMU_WITH_CONFIG_RULES)) + + DEVICE_EMU_WITH_OPERATIONAL_STATUS = copy.deepcopy(DEVICE_EMU) + DEVICE_EMU_WITH_OPERATIONAL_STATUS['device_operational_status'] = \ + DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED + device_client.ConfigureDevice(Device(**DEVICE_EMU_WITH_OPERATIONAL_STATUS)) + + driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + assert len(driver_config) == len(DEVICE_EMU_ENDPOINTS_COOKED) + len(DEVICE_EMU_CONFIG_ADDRESSES) + for endpoint_cooked in DEVICE_EMU_ENDPOINTS_COOKED: + endpoint_cooked = copy.deepcopy(endpoint_cooked) + endpoint_cooked[1]['enabled'] = True + assert endpoint_cooked in driver_config + for config_rule in DEVICE_EMU_CONFIG_ADDRESSES: + assert (config_rule['resource_key'], json.loads(config_rule['resource_value'])) in driver_config + + device_data = context_client.GetDevice(DeviceId(**DEVICE_EMU_ID)) + assert device_data.device_operational_status == DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED + + config_rules = [ + (ConfigActionEnum.Name(config_rule.action), config_rule.resource_key, config_rule.resource_value) + for config_rule in device_data.device_config.config_rules + ] + #LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( + # '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) + RESULTING_CONFIG_ENDPOINTS = {cr['resource_key']:cr for cr in copy.deepcopy(DEVICE_EMU_CONFIG_ENDPOINTS)} + for endpoint_cooked in DEVICE_EMU_ENDPOINTS_COOKED: + values = json.loads(RESULTING_CONFIG_ENDPOINTS[endpoint_cooked[0]]['resource_value']) + values.update(endpoint_cooked[1]) + RESULTING_CONFIG_ENDPOINTS[endpoint_cooked[0]]['resource_value'] = json.dumps(values, sort_keys=True) + for config_rule in RESULTING_CONFIG_ENDPOINTS.values(): + config_rule = ( + ConfigActionEnum.Name(config_rule['action']), config_rule['resource_key'], + json.loads(json.dumps(config_rule['resource_value']))) + assert config_rule in config_rules + for config_rule in DEVICE_EMU_CONFIG_ADDRESSES: + config_rule = ( + ConfigActionEnum.Name(config_rule['action']), config_rule['resource_key'], + json.loads(json.dumps(config_rule['resource_value']))) + assert config_rule in config_rules + + # Try to reconfigure... + + DEVICE_EMU_WITH_RECONFIG_RULES = copy.deepcopy(DEVICE_EMU) + DEVICE_EMU_WITH_RECONFIG_RULES['device_operational_status'] = \ + DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED + DEVICE_EMU_WITH_RECONFIG_RULES['device_config']['config_rules'].extend(DEVICE_EMU_RECONFIG_ADDRESSES) + device_client.ConfigureDevice(Device(**DEVICE_EMU_WITH_RECONFIG_RULES)) + + RESULTING_CONFIG_RULES = {cr['resource_key']:cr for cr in copy.deepcopy(DEVICE_EMU_CONFIG_ENDPOINTS)} + for endpoint_cooked in DEVICE_EMU_ENDPOINTS_COOKED: + values = json.loads(RESULTING_CONFIG_RULES[endpoint_cooked[0]]['resource_value']) + values.update(endpoint_cooked[1]) + RESULTING_CONFIG_RULES[endpoint_cooked[0]]['resource_value'] = json.dumps(values, sort_keys=True) + RESULTING_CONFIG_RULES.update({cr['resource_key']:cr for cr in copy.deepcopy(DEVICE_EMU_CONFIG_ADDRESSES)}) + for reconfig_rule in DEVICE_EMU_RECONFIG_ADDRESSES: + if reconfig_rule['action'] == ConfigActionEnum.CONFIGACTION_DELETE: + RESULTING_CONFIG_RULES.pop(reconfig_rule['resource_key'], None) + else: + RESULTING_CONFIG_RULES[reconfig_rule['resource_key']] = reconfig_rule + RESULTING_CONFIG_RULES = RESULTING_CONFIG_RULES.values() + #LOGGER.info('RESULTING_CONFIG_RULES = {:s}'.format(str(RESULTING_CONFIG_RULES))) + + driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + driver_config = json.loads(json.dumps(driver_config)) # prevent integer keys to fail matching with string keys + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + assert len(driver_config) == len(RESULTING_CONFIG_RULES) + for config_rule in RESULTING_CONFIG_RULES: + resource = [config_rule['resource_key'], json.loads(config_rule['resource_value'])] + assert resource in driver_config + + device_data = context_client.GetDevice(DeviceId(**DEVICE_EMU_ID)) + config_rules = [ + (ConfigActionEnum.Name(config_rule.action), config_rule.resource_key, config_rule.resource_value) + for config_rule in device_data.device_config.config_rules + ] + #LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( + # '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) + for config_rule in RESULTING_CONFIG_RULES: + config_rule = ( + ConfigActionEnum.Name(config_rule['action']), config_rule['resource_key'], config_rule['resource_value']) + assert config_rule in config_rules + + +def test_device_emulated_monitor( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService, # pylint: disable=redefined-outer-name + mock_service : MockService_Dependencies): # pylint: disable=redefined-outer-name + + device_uuid = DEVICE_EMU_UUID + json_device_id = DEVICE_EMU_ID + device_id = DeviceId(**json_device_id) + device_data = context_client.GetDevice(device_id) + LOGGER.info('device_data = \n{:s}'.format(str(device_data))) + + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(device_uuid) # we know the driver exists now + assert driver is not None + #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + #assert len(driver_config) == len(DEVICE_EMU_ENDPOINTS_COOKED) + len(DEVICE_EMU_CONFIG_ADDRESSES) + + SAMPLING_DURATION_SEC = 10.0 + SAMPLING_INTERVAL_SEC = 2.0 + + MONITORING_SETTINGS_LIST = [] + KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED = {} + for endpoint in device_data.device_endpoints: + endpoint_uuid = endpoint.endpoint_id.endpoint_uuid.uuid + for sample_type_id in endpoint.kpi_sample_types: + sample_type_name = str(KpiSampleType.Name(sample_type_id)).upper().replace('KPISAMPLETYPE_', '') + kpi_uuid = '{:s}-{:s}-{:s}-kpi_uuid'.format(device_uuid, endpoint_uuid, str(sample_type_id)) + monitoring_settings = { + 'kpi_id' : {'kpi_id': {'uuid': kpi_uuid}}, + 'kpi_descriptor': { + 'kpi_description': 'Metric {:s} for Endpoint {:s} in Device {:s}'.format( + sample_type_name, endpoint_uuid, device_uuid), + 'kpi_sample_type': sample_type_id, + 'device_id': json_device_id, + 'endpoint_id': json_endpoint_id(json_device_id, endpoint_uuid), + }, + 'sampling_duration_s': SAMPLING_DURATION_SEC, + 'sampling_interval_s': SAMPLING_INTERVAL_SEC, + } + MONITORING_SETTINGS_LIST.append(monitoring_settings) + KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED[kpi_uuid] = 0 + + NUM_SAMPLES_EXPECTED_PER_KPI = SAMPLING_DURATION_SEC / SAMPLING_INTERVAL_SEC + NUM_SAMPLES_EXPECTED = len(MONITORING_SETTINGS_LIST) * NUM_SAMPLES_EXPECTED_PER_KPI + + # Start monitoring the device + t_start_monitoring = datetime.timestamp(datetime.utcnow()) + for monitoring_settings in MONITORING_SETTINGS_LIST: + device_client.MonitorDeviceKpi(MonitoringSettings(**monitoring_settings)) + + # wait to receive the expected number of samples + # if takes more than 1.5 times the sampling duration, assume there is an error + time_ini = time.time() + queue_samples : queue.Queue = mock_service.queue_samples + received_samples = [] + while (len(received_samples) < NUM_SAMPLES_EXPECTED) and (time.time() - time_ini < SAMPLING_DURATION_SEC * 1.5): + try: + received_sample = queue_samples.get(block=True, timeout=SAMPLING_INTERVAL_SEC / NUM_SAMPLES_EXPECTED) + #LOGGER.info('received_sample = {:s}'.format(str(received_sample))) + received_samples.append(received_sample) + except queue.Empty: + continue + + t_end_monitoring = datetime.timestamp(datetime.utcnow()) + + #LOGGER.info('received_samples = {:s}'.format(str(received_samples))) + LOGGER.info('len(received_samples) = {:s}'.format(str(len(received_samples)))) + LOGGER.info('NUM_SAMPLES_EXPECTED = {:s}'.format(str(NUM_SAMPLES_EXPECTED))) + assert len(received_samples) == NUM_SAMPLES_EXPECTED + for received_sample in received_samples: + kpi_uuid = received_sample.kpi_id.kpi_id.uuid + assert kpi_uuid in KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED + assert isinstance(received_sample.timestamp, str) + try: + timestamp = float(received_sample.timestamp) + except ValueError: + dt_time = dateutil.parser.isoparse(received_sample.timestamp).replace(tzinfo=timezone.utc) + timestamp = float(calendar.timegm(dt_time.timetuple())) + (dt_time.microsecond / 1.e6) + assert timestamp > t_start_monitoring + assert timestamp < t_end_monitoring + assert received_sample.kpi_value.HasField('floatVal') or received_sample.kpi_value.HasField('intVal') + kpi_value = getattr(received_sample.kpi_value, received_sample.kpi_value.WhichOneof('value')) + assert isinstance(kpi_value, (float, int)) + KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED[kpi_uuid] += 1 + + LOGGER.info('KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED = {:s}'.format(str(KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED))) + for kpi_uuid, num_samples_received in KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED.items(): + assert num_samples_received == NUM_SAMPLES_EXPECTED_PER_KPI + + # Unsubscribe monitoring + for kpi_uuid in KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED.keys(): + MONITORING_SETTINGS_UNSUBSCRIBE = { + 'kpi_id' : {'kpi_id': {'uuid': kpi_uuid}}, + 'sampling_duration_s': -1, # negative value in sampling_duration_s or sampling_interval_s means unsibscribe + 'sampling_interval_s': -1, # kpi_id is mandatory to unsibscribe + } + device_client.MonitorDeviceKpi(MonitoringSettings(**MONITORING_SETTINGS_UNSUBSCRIBE)) + + +def test_device_emulated_deconfigure( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(DEVICE_EMU_UUID) # we know the driver exists now + assert driver is not None + + driver_config = driver.GetConfig() + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + + DEVICE_EMU_WITH_DECONFIG_RULES = copy.deepcopy(DEVICE_EMU) + DEVICE_EMU_WITH_DECONFIG_RULES['device_operational_status'] = \ + DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_DISABLED + DEVICE_EMU_WITH_DECONFIG_RULES['device_config']['config_rules'].extend(DEVICE_EMU_DECONFIG_ADDRESSES) + device_client.ConfigureDevice(Device(**DEVICE_EMU_WITH_DECONFIG_RULES)) + + RESULTING_CONFIG_RULES = {cr['resource_key']:cr for cr in copy.deepcopy(DEVICE_EMU_CONFIG_ENDPOINTS)} + for endpoint_cooked in DEVICE_EMU_ENDPOINTS_COOKED: + values = json.loads(RESULTING_CONFIG_RULES[endpoint_cooked[0]]['resource_value']) + values.update(endpoint_cooked[1]) + RESULTING_CONFIG_RULES[endpoint_cooked[0]]['resource_value'] = json.dumps(values, sort_keys=True) + RESULTING_CONFIG_RULES = RESULTING_CONFIG_RULES.values() + driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + driver_config = json.loads(json.dumps(driver_config)) # prevent integer keys to fail matching with string keys + driver_config = list(filter( + lambda config_rule: ( + not isinstance(config_rule[1], str) or not config_rule[1].startswith('do_sampling (trigger:')), + driver_config)) + LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + LOGGER.info('RESULTING_CONFIG_RULES = {:s}'.format(str(RESULTING_CONFIG_RULES))) + assert len(driver_config) == len(RESULTING_CONFIG_RULES) + for config_rule in RESULTING_CONFIG_RULES: + config_rule = [config_rule['resource_key'], json.loads(config_rule['resource_value'])] + #LOGGER.info('config_rule = {:s}'.format(str(config_rule))) + assert config_rule in driver_config + + DEVICE_EMU_WITH_DECONFIG_RULES = copy.deepcopy(DEVICE_EMU) + DEVICE_EMU_WITH_DECONFIG_RULES['device_config']['config_rules'].extend(DEVICE_EMU_DECONFIG_ENDPOINTS) + device_client.ConfigureDevice(Device(**DEVICE_EMU_WITH_DECONFIG_RULES)) + + driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + driver_config = json.loads(json.dumps(driver_config)) # prevent integer keys to fail matching with string keys + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + assert len(driver_config) == 0 + + device_data = context_client.GetDevice(DeviceId(**DEVICE_EMU_ID)) + config_rules = device_data.device_config.config_rules + LOGGER.info('config_rules = {:s}'.format(str(config_rules))) + clean_config_rules = [] + for config_rule in config_rules: + if config_rule.resource_key.startswith('/endpoints/endpoint'): continue + config_rule_value = json.loads(config_rule.resource_value) + if isinstance(config_rule_value, str) and config_rule_value.startswith('do_sampling (trigger:'): continue + clean_config_rules.append(config_rule) + LOGGER.info('clean_config_rules = {:s}'.format(str(clean_config_rules))) + assert len(clean_config_rules) == 0 + + +def test_device_emulated_delete( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + device_client.DeleteDevice(DeviceId(**DEVICE_EMU_ID)) + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(DEVICE_EMU_UUID, {}) + assert driver is None diff --git a/src/device/tests/test_unitary_microwave.py b/src/device/tests/test_unitary_microwave.py new file mode 100644 index 0000000000000000000000000000000000000000..c5cd70b993971812cd89dd970e9835cfd04a548f --- /dev/null +++ b/src/device/tests/test_unitary_microwave.py @@ -0,0 +1,167 @@ +# 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. + +import copy, grpc, logging, pytest +from common.tools.grpc.Tools import grpc_message_to_json_string +from context.client.ContextClient import ContextClient +from context.proto.context_pb2 import DeviceId +from device.client.DeviceClient import DeviceClient +from device.proto.context_pb2 import ConfigActionEnum, Device +from device.service.DeviceService import DeviceService +from device.service.driver_api._Driver import _Driver +from .PrepareTestScenario import ( # pylint: disable=unused-import + # be careful, order of symbols is important here! + mock_service, device_service, context_client, device_client, monitoring_client, test_prepare_environment) + +try: + from .Device_Microwave_Template import ( + DEVICE_MICROWAVE, DEVICE_MICROWAVE_CONNECT_RULES, DEVICE_MICROWAVE_UUID, DEVICE_MICROWAVE_ID, + DEVICE_MICROWAVE_CONFIG_RULES, DEVICE_MICROWAVE_DECONFIG_RULES) + ENABLE_MICROWAVE = True +except ImportError: + ENABLE_MICROWAVE = False + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + + +# ----- Test Device Driver Microwave ------------------------------------------------ + +def test_device_microwave_add_error_cases( + device_client : DeviceClient): # pylint: disable=redefined-outer-name + + if not ENABLE_MICROWAVE: pytest.skip('Skipping test: No TAPI device has been configured') + + with pytest.raises(grpc.RpcError) as e: + DEVICE_MICROWAVE_WITH_EXTRA_RULES = copy.deepcopy(DEVICE_MICROWAVE) + DEVICE_MICROWAVE_WITH_EXTRA_RULES['device_config']['config_rules'].extend(DEVICE_MICROWAVE_CONNECT_RULES) + DEVICE_MICROWAVE_WITH_EXTRA_RULES['device_config']['config_rules'].extend(DEVICE_MICROWAVE_CONFIG_RULES) + device_client.AddDevice(Device(**DEVICE_MICROWAVE_WITH_EXTRA_RULES)) + assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT + msg_head = 'device.device_config.config_rules([' + msg_tail = ']) is invalid; RPC method AddDevice only accepts connection Config Rules that should start '\ + 'with "_connect/" tag. Others should be configured after adding the device.' + except_msg = str(e.value.details()) + assert except_msg.startswith(msg_head) and except_msg.endswith(msg_tail) + + +def test_device_microwave_add_correct( + device_client: DeviceClient, # pylint: disable=redefined-outer-name + device_service: DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_MICROWAVE: pytest.skip('Skipping test: No MICROWAVE device has been configured') + + DEVICE_MICROWAVE_WITH_CONNECT_RULES = copy.deepcopy(DEVICE_MICROWAVE) + DEVICE_MICROWAVE_WITH_CONNECT_RULES['device_config']['config_rules'].extend(DEVICE_MICROWAVE_CONNECT_RULES) + device_client.AddDevice(Device(**DEVICE_MICROWAVE_WITH_CONNECT_RULES)) + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver: _Driver = driver_instance_cache.get(DEVICE_MICROWAVE_UUID) + assert driver is not None + + +def test_device_microwave_get( + context_client: ContextClient, # pylint: disable=redefined-outer-name + device_client: DeviceClient): # pylint: disable=redefined-outer-name + + if not ENABLE_MICROWAVE: pytest.skip('Skipping test: No MICROWAVE device has been configured') + + initial_config = device_client.GetInitialConfig(DeviceId(**DEVICE_MICROWAVE_ID)) + LOGGER.info('initial_config = {:s}'.format(grpc_message_to_json_string(initial_config))) + + device_data = context_client.GetDevice(DeviceId(**DEVICE_MICROWAVE_ID)) + LOGGER.info('device_data = {:s}'.format(grpc_message_to_json_string(device_data))) + + +def test_device_microwave_configure( + context_client: ContextClient, # pylint: disable=redefined-outer-name + device_client: DeviceClient, # pylint: disable=redefined-outer-name + device_service: DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_MICROWAVE: pytest.skip('Skipping test: No MICROWAVE device has been configured') + + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(DEVICE_MICROWAVE_UUID) + assert driver is not None + + # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. + #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + + DEVICE_MICROWAVE_WITH_CONFIG_RULES = copy.deepcopy(DEVICE_MICROWAVE) + DEVICE_MICROWAVE_WITH_CONFIG_RULES['device_config']['config_rules'].extend(DEVICE_MICROWAVE_CONFIG_RULES) + device_client.ConfigureDevice(Device(**DEVICE_MICROWAVE_WITH_CONFIG_RULES)) + + # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. + #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + + device_data = context_client.GetDevice(DeviceId(**DEVICE_MICROWAVE_ID)) + config_rules = [ + (ConfigActionEnum.Name(config_rule.action), config_rule.resource_key, config_rule.resource_value) + for config_rule in device_data.device_config.config_rules + ] + LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( + '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) + for config_rule in DEVICE_MICROWAVE_CONFIG_RULES: + config_rule = ( + ConfigActionEnum.Name(config_rule['action']), config_rule['resource_key'], config_rule['resource_value']) + assert config_rule in config_rules + + +def test_device_microwave_deconfigure( + context_client: ContextClient, # pylint: disable=redefined-outer-name + device_client: DeviceClient, # pylint: disable=redefined-outer-name + device_service: DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_MICROWAVE: pytest.skip('Skipping test: No MICROWAVE device has been configured') + + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver: _Driver = driver_instance_cache.get(DEVICE_MICROWAVE_UUID) + assert driver is not None + + # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. + #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + + DEVICE_MICROWAVE_WITH_DECONFIG_RULES = copy.deepcopy(DEVICE_MICROWAVE) + DEVICE_MICROWAVE_WITH_DECONFIG_RULES['device_config']['config_rules'].extend(DEVICE_MICROWAVE_DECONFIG_RULES) + device_client.ConfigureDevice(Device(**DEVICE_MICROWAVE_WITH_DECONFIG_RULES)) + + # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. + #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + + device_data = context_client.GetDevice(DeviceId(**DEVICE_MICROWAVE_ID)) + config_rules = [ + (ConfigActionEnum.Name(config_rule.action), config_rule.resource_key, config_rule.resource_value) + for config_rule in device_data.device_config.config_rules + ] + LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( + '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) + for config_rule in DEVICE_MICROWAVE_DECONFIG_RULES: + action_set = ConfigActionEnum.Name(ConfigActionEnum.CONFIGACTION_SET) + config_rule = (action_set, config_rule['resource_key'], config_rule['resource_value']) + assert config_rule not in config_rules + + +def test_device_microwave_delete( + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_MICROWAVE: pytest.skip('Skipping test: No MICROWAVE device has been configured') + + device_client.DeleteDevice(DeviceId(**DEVICE_MICROWAVE_ID)) + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(DEVICE_MICROWAVE_UUID, {}) + assert driver is None \ No newline at end of file diff --git a/src/device/tests/test_unitary_openconfig.py b/src/device/tests/test_unitary_openconfig.py new file mode 100644 index 0000000000000000000000000000000000000000..968272c04a1304b313d8a988ce0a432e3749a9b8 --- /dev/null +++ b/src/device/tests/test_unitary_openconfig.py @@ -0,0 +1,299 @@ +# 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. + +import calendar, copy, dateutil.parser, grpc, logging, pytest, queue, time +from datetime import datetime, timezone +from common.tools.grpc.Tools import grpc_message_to_json_string +from common.tools.object_factory.EndPoint import json_endpoint_id +from context.client.ContextClient import ContextClient +from context.proto.context_pb2 import DeviceId +from device.client.DeviceClient import DeviceClient +from device.proto.context_pb2 import ConfigActionEnum, Device +from device.proto.device_pb2 import MonitoringSettings +from device.proto.kpi_sample_types_pb2 import KpiSampleType +from device.service.DeviceService import DeviceService +from device.service.driver_api._Driver import _Driver +from .MockService_Dependencies import MockService_Dependencies +from .PrepareTestScenario import ( # pylint: disable=unused-import + # be careful, order of symbols is important here! + mock_service, device_service, context_client, device_client, monitoring_client, test_prepare_environment) + +try: + from .Device_OpenConfig_Infinera1 import( + #from .Device_OpenConfig_Infinera2 import( + DEVICE_OC, DEVICE_OC_CONFIG_RULES, DEVICE_OC_DECONFIG_RULES, DEVICE_OC_CONNECT_RULES, DEVICE_OC_ID, + DEVICE_OC_UUID) + ENABLE_OPENCONFIG = True +except ImportError: + ENABLE_OPENCONFIG = False + +ENABLE_OPENCONFIG_CONFIGURE = True +ENABLE_OPENCONFIG_MONITOR = True +ENABLE_OPENCONFIG_DECONFIGURE = True + + +logging.getLogger('apscheduler.executors.default').setLevel(logging.WARNING) +logging.getLogger('apscheduler.scheduler').setLevel(logging.WARNING) +logging.getLogger('monitoring-client').setLevel(logging.WARNING) + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + + +# ----- Test Device Driver OpenConfig ------------------------------------------ + +def test_device_openconfig_add_error_cases( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_OPENCONFIG: pytest.skip('Skipping test: No OpenConfig device has been configured') + + with pytest.raises(grpc.RpcError) as e: + DEVICE_OC_WITH_EXTRA_RULES = copy.deepcopy(DEVICE_OC) + DEVICE_OC_WITH_EXTRA_RULES['device_config']['config_rules'].extend(DEVICE_OC_CONNECT_RULES) + DEVICE_OC_WITH_EXTRA_RULES['device_config']['config_rules'].extend(DEVICE_OC_CONFIG_RULES) + device_client.AddDevice(Device(**DEVICE_OC_WITH_EXTRA_RULES)) + assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT + msg_head = 'device.device_config.config_rules([' + msg_tail = ']) is invalid; RPC method AddDevice only accepts connection Config Rules that should start '\ + 'with "_connect/" tag. Others should be configured after adding the device.' + except_msg = str(e.value.details()) + assert except_msg.startswith(msg_head) and except_msg.endswith(msg_tail) + + +def test_device_openconfig_add_correct( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_OPENCONFIG: pytest.skip('Skipping test: No OpenConfig device has been configured') + + DEVICE_OC_WITH_CONNECT_RULES = copy.deepcopy(DEVICE_OC) + DEVICE_OC_WITH_CONNECT_RULES['device_config']['config_rules'].extend(DEVICE_OC_CONNECT_RULES) + device_client.AddDevice(Device(**DEVICE_OC_WITH_CONNECT_RULES)) + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(DEVICE_OC_UUID) # we know the driver exists now + assert driver is not None + + device_data = context_client.GetDevice(DeviceId(**DEVICE_OC_ID)) + config_rules = [ + (ConfigActionEnum.Name(config_rule.action), config_rule.resource_key, config_rule.resource_value) + for config_rule in device_data.device_config.config_rules + ] + LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( + '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) + + +def test_device_openconfig_get( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_OPENCONFIG: pytest.skip('Skipping test: No OpenConfig device has been configured') + + initial_config = device_client.GetInitialConfig(DeviceId(**DEVICE_OC_ID)) + LOGGER.info('initial_config = {:s}'.format(grpc_message_to_json_string(initial_config))) + + device_data = context_client.GetDevice(DeviceId(**DEVICE_OC_ID)) + LOGGER.info('device_data = {:s}'.format(grpc_message_to_json_string(device_data))) + + +def test_device_openconfig_configure( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_OPENCONFIG: pytest.skip('Skipping test: No OpenConfig device has been configured') + if not ENABLE_OPENCONFIG_CONFIGURE: pytest.skip('Skipping test OpenConfig configure') + + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(DEVICE_OC_UUID) # we know the driver exists now + assert driver is not None + + # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. + #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + + DEVICE_OC_WITH_CONFIG_RULES = copy.deepcopy(DEVICE_OC) + DEVICE_OC_WITH_CONFIG_RULES['device_config']['config_rules'].extend(DEVICE_OC_CONFIG_RULES) + device_client.ConfigureDevice(Device(**DEVICE_OC_WITH_CONFIG_RULES)) + + # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. + #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + + device_data = context_client.GetDevice(DeviceId(**DEVICE_OC_ID)) + config_rules = [ + (ConfigActionEnum.Name(config_rule.action), config_rule.resource_key, config_rule.resource_value) + for config_rule in device_data.device_config.config_rules + ] + LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( + '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) + for config_rule in DEVICE_OC_CONFIG_RULES: + config_rule = ( + ConfigActionEnum.Name(config_rule['action']), config_rule['resource_key'], config_rule['resource_value']) + assert config_rule in config_rules + + +def test_device_openconfig_monitor( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService, # pylint: disable=redefined-outer-name + mock_service : MockService_Dependencies): # pylint: disable=redefined-outer-name + + if not ENABLE_OPENCONFIG: pytest.skip('Skipping test: No OpenConfig device has been configured') + if not ENABLE_OPENCONFIG_MONITOR: pytest.skip('Skipping test OpenConfig monitor') + + device_uuid = DEVICE_OC_UUID + json_device_id = DEVICE_OC_ID + device_id = DeviceId(**json_device_id) + device_data = context_client.GetDevice(device_id) + #LOGGER.info('device_data = \n{:s}'.format(str(device_data))) + + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(device_uuid) # we know the driver exists now + assert driver is not None + + SAMPLING_DURATION_SEC = 60.0 + SAMPLING_INTERVAL_SEC = 15.0 + + MONITORING_SETTINGS_LIST = [] + KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED = {} + for endpoint in device_data.device_endpoints: + endpoint_uuid = endpoint.endpoint_id.endpoint_uuid.uuid + for sample_type_id in endpoint.kpi_sample_types: + sample_type_name = str(KpiSampleType.Name(sample_type_id)).upper().replace('KPISAMPLETYPE_', '') + kpi_uuid = '{:s}-{:s}-{:s}-kpi_uuid'.format(device_uuid, endpoint_uuid, str(sample_type_id)) + monitoring_settings = { + 'kpi_id' : {'kpi_id': {'uuid': kpi_uuid}}, + 'kpi_descriptor': { + 'kpi_description': 'Metric {:s} for Endpoint {:s} in Device {:s}'.format( + sample_type_name, endpoint_uuid, device_uuid), + 'kpi_sample_type': sample_type_id, + 'device_id': json_device_id, + 'endpoint_id': json_endpoint_id(json_device_id, endpoint_uuid), + }, + 'sampling_duration_s': SAMPLING_DURATION_SEC, + 'sampling_interval_s': SAMPLING_INTERVAL_SEC, + } + MONITORING_SETTINGS_LIST.append(monitoring_settings) + KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED[kpi_uuid] = 0 + + NUM_SAMPLES_EXPECTED_PER_KPI = SAMPLING_DURATION_SEC / SAMPLING_INTERVAL_SEC + NUM_SAMPLES_EXPECTED = len(MONITORING_SETTINGS_LIST) * NUM_SAMPLES_EXPECTED_PER_KPI + + # Start monitoring the device + t_start_monitoring = datetime.timestamp(datetime.utcnow()) + for monitoring_settings in MONITORING_SETTINGS_LIST: + device_client.MonitorDeviceKpi(MonitoringSettings(**monitoring_settings)) + + # wait to receive the expected number of samples + # if takes more than 1.5 times the sampling duration, assume there is an error + time_ini = time.time() + queue_samples : queue.Queue = mock_service.queue_samples + received_samples = [] + while (len(received_samples) < NUM_SAMPLES_EXPECTED) and (time.time() - time_ini < SAMPLING_DURATION_SEC * 1.5): + try: + received_sample = queue_samples.get(block=True, timeout=SAMPLING_INTERVAL_SEC / NUM_SAMPLES_EXPECTED) + #LOGGER.info('received_sample = {:s}'.format(str(received_sample))) + received_samples.append(received_sample) + except queue.Empty: + continue + + t_end_monitoring = datetime.timestamp(datetime.utcnow()) + + #LOGGER.info('received_samples = {:s}'.format(str(received_samples))) + LOGGER.info('len(received_samples) = {:s}'.format(str(len(received_samples)))) + LOGGER.info('NUM_SAMPLES_EXPECTED = {:s}'.format(str(NUM_SAMPLES_EXPECTED))) + #assert len(received_samples) == NUM_SAMPLES_EXPECTED + for received_sample in received_samples: + kpi_uuid = received_sample.kpi_id.kpi_id.uuid + assert kpi_uuid in KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED + assert isinstance(received_sample.timestamp, str) + try: + timestamp = float(received_sample.timestamp) + except ValueError: + dt_time = dateutil.parser.isoparse(received_sample.timestamp).replace(tzinfo=timezone.utc) + timestamp = float(calendar.timegm(dt_time.timetuple())) + (dt_time.microsecond / 1.e6) + assert timestamp > t_start_monitoring + assert timestamp < t_end_monitoring + assert received_sample.kpi_value.HasField('floatVal') or received_sample.kpi_value.HasField('intVal') + kpi_value = getattr(received_sample.kpi_value, received_sample.kpi_value.WhichOneof('value')) + assert isinstance(kpi_value, (float, int)) + KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED[kpi_uuid] += 1 + + LOGGER.info('KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED = {:s}'.format(str(KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED))) + # TODO: review why num_samples_received per KPI != NUM_SAMPLES_EXPECTED_PER_KPI + #for kpi_uuid, num_samples_received in KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED.items(): + # assert num_samples_received == NUM_SAMPLES_EXPECTED_PER_KPI + + # Unsubscribe monitoring + for kpi_uuid in KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED: + MONITORING_SETTINGS_UNSUBSCRIBE = { + 'kpi_id' : {'kpi_id': {'uuid': kpi_uuid}}, + 'sampling_duration_s': -1, # negative value in sampling_duration_s or sampling_interval_s means unsibscribe + 'sampling_interval_s': -1, # kpi_id is mandatory to unsibscribe + } + device_client.MonitorDeviceKpi(MonitoringSettings(**MONITORING_SETTINGS_UNSUBSCRIBE)) + + +def test_device_openconfig_deconfigure( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_OPENCONFIG: pytest.skip('Skipping test: No OpenConfig device has been configured') + if not ENABLE_OPENCONFIG_DECONFIGURE: pytest.skip('Skipping test OpenConfig deconfigure') + + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(DEVICE_OC_UUID) # we know the driver exists now + assert driver is not None + + # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. + #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + + DEVICE_OC_WITH_DECONFIG_RULES = copy.deepcopy(DEVICE_OC) + DEVICE_OC_WITH_DECONFIG_RULES['device_config']['config_rules'].extend(DEVICE_OC_DECONFIG_RULES) + device_client.ConfigureDevice(Device(**DEVICE_OC_WITH_DECONFIG_RULES)) + + # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. + #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + + device_data = context_client.GetDevice(DeviceId(**DEVICE_OC_ID)) + config_rules = [ + (ConfigActionEnum.Name(config_rule.action), config_rule.resource_key, config_rule.resource_value) + for config_rule in device_data.device_config.config_rules + ] + LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( + '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) + for config_rule in DEVICE_OC_DECONFIG_RULES: + action_set = ConfigActionEnum.Name(ConfigActionEnum.CONFIGACTION_SET) + config_rule = (action_set, config_rule['resource_key'], config_rule['resource_value']) + assert config_rule not in config_rules + + +def test_device_openconfig_delete( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_OPENCONFIG: pytest.skip('Skipping test: No OpenConfig device has been configured') + + device_client.DeleteDevice(DeviceId(**DEVICE_OC_ID)) + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(DEVICE_OC_UUID, {}) + assert driver is None diff --git a/src/device/tests/test_unitary_p4.py b/src/device/tests/test_unitary_p4.py new file mode 100644 index 0000000000000000000000000000000000000000..d8a5d37b8f01685f10ab2d2ec967d09312fc4cc4 --- /dev/null +++ b/src/device/tests/test_unitary_p4.py @@ -0,0 +1,146 @@ +# 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. + +import copy, grpc, logging, pytest +from common.tools.grpc.Tools import grpc_message_to_json_string +from context.client.ContextClient import ContextClient +from context.proto.context_pb2 import DeviceId +from device.client.DeviceClient import DeviceClient +from device.proto.context_pb2 import Device +from device.service.DeviceService import DeviceService +from device.service.driver_api._Driver import _Driver +from .PrepareTestScenario import ( # pylint: disable=unused-import + # be careful, order of symbols is important here! + mock_service, device_service, context_client, device_client, monitoring_client, test_prepare_environment) + +from .mock_p4runtime_service import MockP4RuntimeService +try: + from .device_p4 import( + DEVICE_P4, DEVICE_P4_ID, DEVICE_P4_UUID, DEVICE_P4_ADDRESS, DEVICE_P4_PORT, DEVICE_P4_WORKERS, + DEVICE_P4_GRACE_PERIOD, DEVICE_P4_CONNECT_RULES, DEVICE_P4_CONFIG_RULES) + ENABLE_P4 = True +except ImportError: + ENABLE_P4 = False + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +@pytest.fixture(scope='session') +def p4runtime_service(): + _service = MockP4RuntimeService( + address=DEVICE_P4_ADDRESS, port=DEVICE_P4_PORT, + max_workers=DEVICE_P4_WORKERS, + grace_period=DEVICE_P4_GRACE_PERIOD) + _service.start() + yield _service + _service.stop() + + +# ----- Test Device Driver P4 -------------------------------------------------- + +def test_device_p4_add_error_cases( + context_client: ContextClient, # pylint: disable=redefined-outer-name + device_client: DeviceClient, # pylint: disable=redefined-outer-name + device_service: DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_P4: pytest.skip( + 'Skipping test: No P4 device has been configured') + + with pytest.raises(grpc.RpcError) as e: + device_p4_with_extra_rules = copy.deepcopy(DEVICE_P4) + device_p4_with_extra_rules['device_config']['config_rules'].extend( + DEVICE_P4_CONNECT_RULES) + device_p4_with_extra_rules['device_config']['config_rules'].extend( + DEVICE_P4_CONFIG_RULES) + device_client.AddDevice(Device(**device_p4_with_extra_rules)) + assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT + msg_head = 'device.device_config.config_rules([' + msg_tail = ']) is invalid; RPC method AddDevice only accepts connection Config Rules that should start '\ + 'with "_connect/" tag. Others should be configured after adding the device.' + except_msg = str(e.value.details()) + assert except_msg.startswith(msg_head) and except_msg.endswith(msg_tail) + + +def test_device_p4_add_correct( + context_client: ContextClient, # pylint: disable=redefined-outer-name + device_client: DeviceClient, # pylint: disable=redefined-outer-name + device_service: DeviceService, # pylint: disable=redefined-outer-name + p4runtime_service: MockP4RuntimeService): # pylint: disable=redefined-outer-name + + if not ENABLE_P4: pytest.skip( + 'Skipping test: No P4 device has been configured') + + device_p4_with_connect_rules = copy.deepcopy(DEVICE_P4) + device_p4_with_connect_rules['device_config']['config_rules'].extend( + DEVICE_P4_CONNECT_RULES) + device_client.AddDevice(Device(**device_p4_with_connect_rules)) + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(DEVICE_P4_UUID) + assert driver is not None + + +def test_device_p4_get( + context_client: ContextClient, # pylint: disable=redefined-outer-name + device_client: DeviceClient, # pylint: disable=redefined-outer-name + device_service: DeviceService, # pylint: disable=redefined-outer-name + p4runtime_service: MockP4RuntimeService): # pylint: disable=redefined-outer-name + + if not ENABLE_P4: pytest.skip( + 'Skipping test: No P4 device has been configured') + + initial_config = device_client.GetInitialConfig(DeviceId(**DEVICE_P4_ID)) + LOGGER.info('initial_config = {:s}'.format( + grpc_message_to_json_string(initial_config))) + + device_data = context_client.GetDevice(DeviceId(**DEVICE_P4_ID)) + LOGGER.info('device_data = {:s}'.format( + grpc_message_to_json_string(device_data))) + + +def test_device_p4_configure( + context_client: ContextClient, # pylint: disable=redefined-outer-name + device_client: DeviceClient, # pylint: disable=redefined-outer-name + device_service: DeviceService, # pylint: disable=redefined-outer-name + p4runtime_service: MockP4RuntimeService): # pylint: disable=redefined-outer-name + + if not ENABLE_P4: pytest.skip( + 'Skipping test: No P4 device has been configured') + + pytest.skip('Skipping test for unimplemented method') + + +def test_device_p4_deconfigure( + context_client: ContextClient, # pylint: disable=redefined-outer-name + device_client: DeviceClient, # pylint: disable=redefined-outer-name + device_service: DeviceService, # pylint: disable=redefined-outer-name + p4runtime_service: MockP4RuntimeService): # pylint: disable=redefined-outer-name + + if not ENABLE_P4: pytest.skip( + 'Skipping test: No P4 device has been configured') + + pytest.skip('Skipping test for unimplemented method') + + +def test_device_p4_delete( + context_client: ContextClient, # pylint: disable=redefined-outer-name + device_client: DeviceClient, # pylint: disable=redefined-outer-name + device_service: DeviceService, # pylint: disable=redefined-outer-name + p4runtime_service: MockP4RuntimeService): # pylint: disable=redefined-outer-name + + if not ENABLE_P4: pytest.skip('Skipping test: No P4 device has been configured') + + device_client.DeleteDevice(DeviceId(**DEVICE_P4_ID)) + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(DEVICE_P4_UUID) + assert driver is None diff --git a/src/device/tests/test_unitary_tapi.py b/src/device/tests/test_unitary_tapi.py new file mode 100644 index 0000000000000000000000000000000000000000..ce01619ce6b8144ac81ddd73c700310e23c0b52e --- /dev/null +++ b/src/device/tests/test_unitary_tapi.py @@ -0,0 +1,167 @@ +# 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. + +import copy, grpc, logging, pytest +from common.tools.grpc.Tools import grpc_message_to_json_string +from context.client.ContextClient import ContextClient +from context.proto.context_pb2 import DeviceId +from device.client.DeviceClient import DeviceClient +from device.proto.context_pb2 import ConfigActionEnum, Device +from device.service.DeviceService import DeviceService +from device.service.driver_api._Driver import _Driver +from .PrepareTestScenario import ( # pylint: disable=unused-import + # be careful, order of symbols is important here! + mock_service, device_service, context_client, device_client, monitoring_client, test_prepare_environment) + +try: + from .Device_Transport_Api_CTTC import ( + DEVICE_TAPI, DEVICE_TAPI_CONNECT_RULES, DEVICE_TAPI_UUID, DEVICE_TAPI_ID, DEVICE_TAPI_CONFIG_RULES, + DEVICE_TAPI_DECONFIG_RULES) + ENABLE_TAPI = True +except ImportError: + ENABLE_TAPI = False + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + + +# ----- Test Device Driver TAPI ------------------------------------------------ + +def test_device_tapi_add_error_cases( + device_client : DeviceClient): # pylint: disable=redefined-outer-name + + if not ENABLE_TAPI: pytest.skip('Skipping test: No TAPI device has been configured') + + with pytest.raises(grpc.RpcError) as e: + DEVICE_TAPI_WITH_EXTRA_RULES = copy.deepcopy(DEVICE_TAPI) + DEVICE_TAPI_WITH_EXTRA_RULES['device_config']['config_rules'].extend(DEVICE_TAPI_CONNECT_RULES) + DEVICE_TAPI_WITH_EXTRA_RULES['device_config']['config_rules'].extend(DEVICE_TAPI_CONFIG_RULES) + device_client.AddDevice(Device(**DEVICE_TAPI_WITH_EXTRA_RULES)) + assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT + msg_head = 'device.device_config.config_rules([' + msg_tail = ']) is invalid; RPC method AddDevice only accepts connection Config Rules that should start '\ + 'with "_connect/" tag. Others should be configured after adding the device.' + except_msg = str(e.value.details()) + assert except_msg.startswith(msg_head) and except_msg.endswith(msg_tail) + + +def test_device_tapi_add_correct( + device_client: DeviceClient, # pylint: disable=redefined-outer-name + device_service: DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_TAPI: pytest.skip('Skipping test: No TAPI device has been configured') + + DEVICE_TAPI_WITH_CONNECT_RULES = copy.deepcopy(DEVICE_TAPI) + DEVICE_TAPI_WITH_CONNECT_RULES['device_config']['config_rules'].extend(DEVICE_TAPI_CONNECT_RULES) + device_client.AddDevice(Device(**DEVICE_TAPI_WITH_CONNECT_RULES)) + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver: _Driver = driver_instance_cache.get(DEVICE_TAPI_UUID) + assert driver is not None + + +def test_device_tapi_get( + context_client: ContextClient, # pylint: disable=redefined-outer-name + device_client: DeviceClient): # pylint: disable=redefined-outer-name + + if not ENABLE_TAPI: pytest.skip('Skipping test: No TAPI device has been configured') + + initial_config = device_client.GetInitialConfig(DeviceId(**DEVICE_TAPI_ID)) + LOGGER.info('initial_config = {:s}'.format(grpc_message_to_json_string(initial_config))) + + device_data = context_client.GetDevice(DeviceId(**DEVICE_TAPI_ID)) + LOGGER.info('device_data = {:s}'.format(grpc_message_to_json_string(device_data))) + + +def test_device_tapi_configure( + context_client: ContextClient, # pylint: disable=redefined-outer-name + device_client: DeviceClient, # pylint: disable=redefined-outer-name + device_service: DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_TAPI: pytest.skip('Skipping test: No TAPI device has been configured') + + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(DEVICE_TAPI_UUID) + assert driver is not None + + # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. + #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + + DEVICE_TAPI_WITH_CONFIG_RULES = copy.deepcopy(DEVICE_TAPI) + DEVICE_TAPI_WITH_CONFIG_RULES['device_config']['config_rules'].extend(DEVICE_TAPI_CONFIG_RULES) + device_client.ConfigureDevice(Device(**DEVICE_TAPI_WITH_CONFIG_RULES)) + + # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. + #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + + device_data = context_client.GetDevice(DeviceId(**DEVICE_TAPI_ID)) + config_rules = [ + (ConfigActionEnum.Name(config_rule.action), config_rule.resource_key, config_rule.resource_value) + for config_rule in device_data.device_config.config_rules + ] + LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( + '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) + for config_rule in DEVICE_TAPI_CONFIG_RULES: + config_rule = ( + ConfigActionEnum.Name(config_rule['action']), config_rule['resource_key'], config_rule['resource_value']) + assert config_rule in config_rules + + +def test_device_tapi_deconfigure( + context_client: ContextClient, # pylint: disable=redefined-outer-name + device_client: DeviceClient, # pylint: disable=redefined-outer-name + device_service: DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_TAPI: pytest.skip('Skipping test: No TAPI device has been configured') + + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver: _Driver = driver_instance_cache.get(DEVICE_TAPI_UUID) + assert driver is not None + + # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. + #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + + DEVICE_TAPI_WITH_DECONFIG_RULES = copy.deepcopy(DEVICE_TAPI) + DEVICE_TAPI_WITH_DECONFIG_RULES['device_config']['config_rules'].extend(DEVICE_TAPI_DECONFIG_RULES) + device_client.ConfigureDevice(Device(**DEVICE_TAPI_WITH_DECONFIG_RULES)) + + # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. + #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + + device_data = context_client.GetDevice(DeviceId(**DEVICE_TAPI_ID)) + config_rules = [ + (ConfigActionEnum.Name(config_rule.action), config_rule.resource_key, config_rule.resource_value) + for config_rule in device_data.device_config.config_rules + ] + LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( + '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) + for config_rule in DEVICE_TAPI_DECONFIG_RULES: + action_set = ConfigActionEnum.Name(ConfigActionEnum.CONFIGACTION_SET) + config_rule = (action_set, config_rule['resource_key'], config_rule['resource_value']) + assert config_rule not in config_rules + + +def test_device_tapi_delete( + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_TAPI: pytest.skip('Skipping test: No TAPI device has been configured') + + device_client.DeleteDevice(DeviceId(**DEVICE_TAPI_ID)) + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(DEVICE_TAPI_UUID, {}) + assert driver is None diff --git a/src/dlt/__init__.py b/src/dlt/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/dlt/__init__.py @@ -0,0 +1,14 @@ +# 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. + diff --git a/src/dlt/config/ca.org1.example.com-cert.pem b/src/dlt/config/ca.org1.example.com-cert.pem deleted file mode 100644 index 9c10b97908d70ae16b542f922563dbcba21056c6..0000000000000000000000000000000000000000 --- a/src/dlt/config/ca.org1.example.com-cert.pem +++ /dev/null @@ -1,14 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICJjCCAc2gAwIBAgIULDVQiqifWHypuW50LhHXSJeeFG0wCgYIKoZIzj0EAwIw -cDELMAkGA1UEBhMCVVMxFzAVBgNVBAgTDk5vcnRoIENhcm9saW5hMQ8wDQYDVQQH -EwZEdXJoYW0xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh -Lm9yZzEuZXhhbXBsZS5jb20wHhcNMjExMTIzMTIzNzAwWhcNMzYxMTE5MTIzNzAw -WjBwMQswCQYDVQQGEwJVUzEXMBUGA1UECBMOTm9ydGggQ2Fyb2xpbmExDzANBgNV -BAcTBkR1cmhhbTEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEcMBoGA1UEAxMT -Y2Eub3JnMS5leGFtcGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABFNi -ggnkzv5qQSkIAQ05Y9DUq4teNjbMTdqD0IwdQe+lcYI0wgkR9wpBn5fj2pN093+P -l2crhgyNqZyAuqaylvCjRTBDMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAG -AQH/AgEBMB0GA1UdDgQWBBS44tGlbJ5GIBwATL383Hw0vz8jHDAKBggqhkjOPQQD -AgNHADBEAiAlkKikh7eG8lf0uI7NwBi0QrbnnY4vHf9ErceKwUhZWgIgS9Z9AzBc -n9RAK3v/freT3Exs7b+MK13UeDdejRWS+RE= ------END CERTIFICATE----- diff --git a/src/dlt/connector/__init__.py b/src/dlt/connector/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/dlt/connector/__init__.py @@ -0,0 +1,14 @@ +# 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. + diff --git a/src/dlt/connector/client/__init__.py b/src/dlt/connector/client/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/dlt/connector/client/__init__.py @@ -0,0 +1,14 @@ +# 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. + diff --git a/src/dlt/connector/genproto.sh b/src/dlt/connector/genproto.sh new file mode 100755 index 0000000000000000000000000000000000000000..d06be3d7e2a7bc0ad5887582554f34c57d3bed45 --- /dev/null +++ b/src/dlt/connector/genproto.sh @@ -0,0 +1,49 @@ +#!/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) + +rm -rf proto/*.py +rm -rf proto/__pycache__ +tee proto/__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 + +python -m grpc_tools.protoc -I../../../proto --python_out=proto --grpc_python_out=proto context.proto +python -m grpc_tools.protoc -I../../../proto --python_out=proto --grpc_python_out=proto kpi_sample_types.proto +python -m grpc_tools.protoc -I../../../proto --python_out=proto --grpc_python_out=proto dlt.proto + +rm proto/context_pb2_grpc.py +rm proto/kpi_sample_types_pb2_grpc.py + +sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/context_pb2.py +sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/dlt_pb2.py +sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/dlt_pb2_grpc.py +sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/kpi_sample_types_pb2.py diff --git a/src/dlt/connector/proto/__init__.py b/src/dlt/connector/proto/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/dlt/connector/proto/__init__.py @@ -0,0 +1,14 @@ +# 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. + diff --git a/src/dlt/connector/proto/context_pb2.py b/src/dlt/connector/proto/context_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..50d501d3ac053ad644554331af26e3c40cd426a1 --- /dev/null +++ b/src/dlt/connector/proto/context_pb2.py @@ -0,0 +1,3071 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: context.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from . import kpi_sample_types_pb2 as kpi__sample__types__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='context.proto', + package='context', + syntax='proto3', + serialized_options=None, + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n\rcontext.proto\x12\x07\x63ontext\x1a\x16kpi_sample_types.proto\"\x07\n\x05\x45mpty\"\x14\n\x04Uuid\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"F\n\x05\x45vent\x12\x11\n\ttimestamp\x18\x01 \x01(\x01\x12*\n\nevent_type\x18\x02 \x01(\x0e\x32\x16.context.EventTypeEnum\"0\n\tContextId\x12#\n\x0c\x63ontext_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xb6\x01\n\x07\x43ontext\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12)\n\x0ctopology_ids\x18\x02 \x03(\x0b\x32\x13.context.TopologyId\x12\'\n\x0bservice_ids\x18\x03 \x03(\x0b\x32\x12.context.ServiceId\x12/\n\ncontroller\x18\x04 \x01(\x0b\x32\x1b.context.TeraFlowController\"8\n\rContextIdList\x12\'\n\x0b\x63ontext_ids\x18\x01 \x03(\x0b\x32\x12.context.ContextId\"1\n\x0b\x43ontextList\x12\"\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32\x10.context.Context\"U\n\x0c\x43ontextEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\ncontext_id\x18\x02 \x01(\x0b\x32\x12.context.ContextId\"Z\n\nTopologyId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12$\n\rtopology_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"~\n\x08Topology\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12%\n\ndevice_ids\x18\x02 \x03(\x0b\x32\x11.context.DeviceId\x12!\n\x08link_ids\x18\x03 \x03(\x0b\x32\x0f.context.LinkId\";\n\x0eTopologyIdList\x12)\n\x0ctopology_ids\x18\x01 \x03(\x0b\x32\x13.context.TopologyId\"5\n\x0cTopologyList\x12%\n\ntopologies\x18\x01 \x03(\x0b\x32\x11.context.Topology\"X\n\rTopologyEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12(\n\x0btopology_id\x18\x02 \x01(\x0b\x32\x13.context.TopologyId\".\n\x08\x44\x65viceId\x12\"\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x9a\x02\n\x06\x44\x65vice\x12$\n\tdevice_id\x18\x01 \x01(\x0b\x32\x11.context.DeviceId\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12,\n\rdevice_config\x18\x03 \x01(\x0b\x32\x15.context.DeviceConfig\x12G\n\x19\x64\x65vice_operational_status\x18\x04 \x01(\x0e\x32$.context.DeviceOperationalStatusEnum\x12\x31\n\x0e\x64\x65vice_drivers\x18\x05 \x03(\x0e\x32\x19.context.DeviceDriverEnum\x12+\n\x10\x64\x65vice_endpoints\x18\x06 \x03(\x0b\x32\x11.context.EndPoint\"9\n\x0c\x44\x65viceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"5\n\x0c\x44\x65viceIdList\x12%\n\ndevice_ids\x18\x01 \x03(\x0b\x32\x11.context.DeviceId\".\n\nDeviceList\x12 \n\x07\x64\x65vices\x18\x01 \x03(\x0b\x32\x0f.context.Device\"R\n\x0b\x44\x65viceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"*\n\x06LinkId\x12 \n\tlink_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"X\n\x04Link\x12 \n\x07link_id\x18\x01 \x01(\x0b\x32\x0f.context.LinkId\x12.\n\x11link_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\"/\n\nLinkIdList\x12!\n\x08link_ids\x18\x01 \x03(\x0b\x32\x0f.context.LinkId\"(\n\x08LinkList\x12\x1c\n\x05links\x18\x01 \x03(\x0b\x32\r.context.Link\"L\n\tLinkEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12 \n\x07link_id\x18\x02 \x01(\x0b\x32\x0f.context.LinkId\"X\n\tServiceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12#\n\x0cservice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\xa6\x02\n\x07Service\x12&\n\nservice_id\x18\x01 \x01(\x0b\x32\x12.context.ServiceId\x12.\n\x0cservice_type\x18\x02 \x01(\x0e\x32\x18.context.ServiceTypeEnum\x12\x31\n\x14service_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12\x30\n\x13service_constraints\x18\x04 \x03(\x0b\x32\x13.context.Constraint\x12.\n\x0eservice_status\x18\x05 \x01(\x0b\x32\x16.context.ServiceStatus\x12.\n\x0eservice_config\x18\x06 \x01(\x0b\x32\x16.context.ServiceConfig\"C\n\rServiceStatus\x12\x32\n\x0eservice_status\x18\x01 \x01(\x0e\x32\x1a.context.ServiceStatusEnum\":\n\rServiceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"8\n\rServiceIdList\x12\'\n\x0bservice_ids\x18\x01 \x03(\x0b\x32\x12.context.ServiceId\"1\n\x0bServiceList\x12\"\n\x08services\x18\x01 \x03(\x0b\x32\x10.context.Service\"U\n\x0cServiceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\"T\n\x07SliceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12!\n\nslice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\x95\x02\n\x05Slice\x12\"\n\x08slice_id\x18\x01 \x01(\x0b\x32\x10.context.SliceId\x12/\n\x12slice_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\x12.\n\x11slice_constraints\x18\x03 \x03(\x0b\x32\x13.context.Constraint\x12-\n\x11slice_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\x12,\n\x12slice_subslice_ids\x18\x05 \x03(\x0b\x32\x10.context.SliceId\x12*\n\x0cslice_status\x18\x06 \x01(\x0b\x32\x14.context.SliceStatus\"=\n\x0bSliceStatus\x12.\n\x0cslice_status\x18\x01 \x01(\x0e\x32\x18.context.SliceStatusEnum\"2\n\x0bSliceIdList\x12#\n\tslice_ids\x18\x01 \x03(\x0b\x32\x10.context.SliceId\"+\n\tSliceList\x12\x1e\n\x06slices\x18\x01 \x03(\x0b\x32\x0e.context.Slice\"O\n\nSliceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12\"\n\x08slice_id\x18\x02 \x01(\x0b\x32\x10.context.SliceId\"6\n\x0c\x43onnectionId\x12&\n\x0f\x63onnection_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xc4\x01\n\nConnection\x12,\n\rconnection_id\x18\x01 \x01(\x0b\x32\x15.context.ConnectionId\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\x12\x33\n\x16path_hops_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12+\n\x0fsub_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\"A\n\x10\x43onnectionIdList\x12-\n\x0e\x63onnection_ids\x18\x01 \x03(\x0b\x32\x15.context.ConnectionId\":\n\x0e\x43onnectionList\x12(\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x13.context.Connection\"^\n\x0f\x43onnectionEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12,\n\rconnection_id\x18\x02 \x01(\x0b\x32\x15.context.ConnectionId\"\x82\x01\n\nEndPointId\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\x12$\n\rendpoint_uuid\x18\x03 \x01(\x0b\x32\r.context.Uuid\"\x86\x01\n\x08\x45ndPoint\x12(\n\x0b\x65ndpoint_id\x18\x01 \x01(\x0b\x32\x13.context.EndPointId\x12\x15\n\rendpoint_type\x18\x02 \x01(\t\x12\x39\n\x10kpi_sample_types\x18\x03 \x03(\x0e\x32\x1f.kpi_sample_types.KpiSampleType\"e\n\nConfigRule\x12)\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x19.context.ConfigActionEnum\x12\x14\n\x0cresource_key\x18\x02 \x01(\t\x12\x16\n\x0eresource_value\x18\x03 \x01(\t\"?\n\nConstraint\x12\x17\n\x0f\x63onstraint_type\x18\x01 \x01(\t\x12\x18\n\x10\x63onstraint_value\x18\x02 \x01(\t\"^\n\x12TeraFlowController\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x12\n\nip_address\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\"U\n\x14\x41uthenticationResult\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x15\n\rauthenticated\x18\x02 \x01(\x08*j\n\rEventTypeEnum\x12\x17\n\x13\x45VENTTYPE_UNDEFINED\x10\x00\x12\x14\n\x10\x45VENTTYPE_CREATE\x10\x01\x12\x14\n\x10\x45VENTTYPE_UPDATE\x10\x02\x12\x14\n\x10\x45VENTTYPE_REMOVE\x10\x03*\xc5\x01\n\x10\x44\x65viceDriverEnum\x12\x1a\n\x16\x44\x45VICEDRIVER_UNDEFINED\x10\x00\x12\x1b\n\x17\x44\x45VICEDRIVER_OPENCONFIG\x10\x01\x12\x1e\n\x1a\x44\x45VICEDRIVER_TRANSPORT_API\x10\x02\x12\x13\n\x0f\x44\x45VICEDRIVER_P4\x10\x03\x12&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOGY\x10\x04\x12\x1b\n\x17\x44\x45VICEDRIVER_ONF_TR_352\x10\x05*\x8f\x01\n\x1b\x44\x65viceOperationalStatusEnum\x12%\n!DEVICEOPERATIONALSTATUS_UNDEFINED\x10\x00\x12$\n DEVICEOPERATIONALSTATUS_DISABLED\x10\x01\x12#\n\x1f\x44\x45VICEOPERATIONALSTATUS_ENABLED\x10\x02*\x81\x01\n\x0fServiceTypeEnum\x12\x17\n\x13SERVICETYPE_UNKNOWN\x10\x00\x12\x14\n\x10SERVICETYPE_L3NM\x10\x01\x12\x14\n\x10SERVICETYPE_L2NM\x10\x02\x12)\n%SERVICETYPE_TAPI_CONNECTIVITY_SERVICE\x10\x03*\x88\x01\n\x11ServiceStatusEnum\x12\x1b\n\x17SERVICESTATUS_UNDEFINED\x10\x00\x12\x19\n\x15SERVICESTATUS_PLANNED\x10\x01\x12\x18\n\x14SERVICESTATUS_ACTIVE\x10\x02\x12!\n\x1dSERVICESTATUS_PENDING_REMOVAL\x10\x03*\x8b\x01\n\x0fSliceStatusEnum\x12\x19\n\x15SLICESTATUS_UNDEFINED\x10\x00\x12\x17\n\x13SLICESTATUS_PLANNED\x10\x01\x12\x14\n\x10SLICESTATUS_INIT\x10\x02\x12\x16\n\x12SLICESTATUS_ACTIVE\x10\x03\x12\x16\n\x12SLICESTATUS_DEINIT\x10\x04*]\n\x10\x43onfigActionEnum\x12\x1a\n\x16\x43ONFIGACTION_UNDEFINED\x10\x00\x12\x14\n\x10\x43ONFIGACTION_SET\x10\x01\x12\x17\n\x13\x43ONFIGACTION_DELETE\x10\x02\x32\xef\x12\n\x0e\x43ontextService\x12:\n\x0eListContextIds\x12\x0e.context.Empty\x1a\x16.context.ContextIdList\"\x00\x12\x36\n\x0cListContexts\x12\x0e.context.Empty\x1a\x14.context.ContextList\"\x00\x12\x34\n\nGetContext\x12\x12.context.ContextId\x1a\x10.context.Context\"\x00\x12\x34\n\nSetContext\x12\x10.context.Context\x1a\x12.context.ContextId\"\x00\x12\x35\n\rRemoveContext\x12\x12.context.ContextId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetContextEvents\x12\x0e.context.Empty\x1a\x15.context.ContextEvent\"\x00\x30\x01\x12@\n\x0fListTopologyIds\x12\x12.context.ContextId\x1a\x17.context.TopologyIdList\"\x00\x12=\n\x0eListTopologies\x12\x12.context.ContextId\x1a\x15.context.TopologyList\"\x00\x12\x37\n\x0bGetTopology\x12\x13.context.TopologyId\x1a\x11.context.Topology\"\x00\x12\x37\n\x0bSetTopology\x12\x11.context.Topology\x1a\x13.context.TopologyId\"\x00\x12\x37\n\x0eRemoveTopology\x12\x13.context.TopologyId\x1a\x0e.context.Empty\"\x00\x12?\n\x11GetTopologyEvents\x12\x0e.context.Empty\x1a\x16.context.TopologyEvent\"\x00\x30\x01\x12\x38\n\rListDeviceIds\x12\x0e.context.Empty\x1a\x15.context.DeviceIdList\"\x00\x12\x34\n\x0bListDevices\x12\x0e.context.Empty\x1a\x13.context.DeviceList\"\x00\x12\x31\n\tGetDevice\x12\x11.context.DeviceId\x1a\x0f.context.Device\"\x00\x12\x31\n\tSetDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0cRemoveDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x12;\n\x0fGetDeviceEvents\x12\x0e.context.Empty\x1a\x14.context.DeviceEvent\"\x00\x30\x01\x12\x34\n\x0bListLinkIds\x12\x0e.context.Empty\x1a\x13.context.LinkIdList\"\x00\x12\x30\n\tListLinks\x12\x0e.context.Empty\x1a\x11.context.LinkList\"\x00\x12+\n\x07GetLink\x12\x0f.context.LinkId\x1a\r.context.Link\"\x00\x12+\n\x07SetLink\x12\r.context.Link\x1a\x0f.context.LinkId\"\x00\x12/\n\nRemoveLink\x12\x0f.context.LinkId\x1a\x0e.context.Empty\"\x00\x12\x37\n\rGetLinkEvents\x12\x0e.context.Empty\x1a\x12.context.LinkEvent\"\x00\x30\x01\x12>\n\x0eListServiceIds\x12\x12.context.ContextId\x1a\x16.context.ServiceIdList\"\x00\x12:\n\x0cListServices\x12\x12.context.ContextId\x1a\x14.context.ServiceList\"\x00\x12\x34\n\nGetService\x12\x12.context.ServiceId\x1a\x10.context.Service\"\x00\x12\x34\n\nSetService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rRemoveService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetServiceEvents\x12\x0e.context.Empty\x1a\x15.context.ServiceEvent\"\x00\x30\x01\x12:\n\x0cListSliceIds\x12\x12.context.ContextId\x1a\x14.context.SliceIdList\"\x00\x12\x36\n\nListSlices\x12\x12.context.ContextId\x1a\x12.context.SliceList\"\x00\x12.\n\x08GetSlice\x12\x10.context.SliceId\x1a\x0e.context.Slice\"\x00\x12.\n\x08SetSlice\x12\x0e.context.Slice\x1a\x10.context.SliceId\"\x00\x12\x31\n\x0bRemoveSlice\x12\x10.context.SliceId\x1a\x0e.context.Empty\"\x00\x12\x39\n\x0eGetSliceEvents\x12\x0e.context.Empty\x1a\x13.context.SliceEvent\"\x00\x30\x01\x12\x44\n\x11ListConnectionIds\x12\x12.context.ServiceId\x1a\x19.context.ConnectionIdList\"\x00\x12@\n\x0fListConnections\x12\x12.context.ServiceId\x1a\x17.context.ConnectionList\"\x00\x12=\n\rGetConnection\x12\x15.context.ConnectionId\x1a\x13.context.Connection\"\x00\x12=\n\rSetConnection\x12\x13.context.Connection\x1a\x15.context.ConnectionId\"\x00\x12;\n\x10RemoveConnection\x12\x15.context.ConnectionId\x1a\x0e.context.Empty\"\x00\x12\x43\n\x13GetConnectionEvents\x12\x0e.context.Empty\x1a\x18.context.ConnectionEvent\"\x00\x30\x01\x62\x06proto3' + , + dependencies=[kpi__sample__types__pb2.DESCRIPTOR,]) + +_EVENTTYPEENUM = _descriptor.EnumDescriptor( + name='EventTypeEnum', + full_name='context.EventTypeEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='EVENTTYPE_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='EVENTTYPE_CREATE', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='EVENTTYPE_UPDATE', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='EVENTTYPE_REMOVE', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=4310, + serialized_end=4416, +) +_sym_db.RegisterEnumDescriptor(_EVENTTYPEENUM) + +EventTypeEnum = enum_type_wrapper.EnumTypeWrapper(_EVENTTYPEENUM) +_DEVICEDRIVERENUM = _descriptor.EnumDescriptor( + name='DeviceDriverEnum', + full_name='context.DeviceDriverEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='DEVICEDRIVER_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DEVICEDRIVER_OPENCONFIG', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DEVICEDRIVER_TRANSPORT_API', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DEVICEDRIVER_P4', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DEVICEDRIVER_IETF_NETWORK_TOPOLOGY', index=4, number=4, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DEVICEDRIVER_ONF_TR_352', index=5, number=5, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=4419, + serialized_end=4616, +) +_sym_db.RegisterEnumDescriptor(_DEVICEDRIVERENUM) + +DeviceDriverEnum = enum_type_wrapper.EnumTypeWrapper(_DEVICEDRIVERENUM) +_DEVICEOPERATIONALSTATUSENUM = _descriptor.EnumDescriptor( + name='DeviceOperationalStatusEnum', + full_name='context.DeviceOperationalStatusEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='DEVICEOPERATIONALSTATUS_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DEVICEOPERATIONALSTATUS_DISABLED', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DEVICEOPERATIONALSTATUS_ENABLED', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=4619, + serialized_end=4762, +) +_sym_db.RegisterEnumDescriptor(_DEVICEOPERATIONALSTATUSENUM) + +DeviceOperationalStatusEnum = enum_type_wrapper.EnumTypeWrapper(_DEVICEOPERATIONALSTATUSENUM) +_SERVICETYPEENUM = _descriptor.EnumDescriptor( + name='ServiceTypeEnum', + full_name='context.ServiceTypeEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='SERVICETYPE_UNKNOWN', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SERVICETYPE_L3NM', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SERVICETYPE_L2NM', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SERVICETYPE_TAPI_CONNECTIVITY_SERVICE', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=4765, + serialized_end=4894, +) +_sym_db.RegisterEnumDescriptor(_SERVICETYPEENUM) + +ServiceTypeEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICETYPEENUM) +_SERVICESTATUSENUM = _descriptor.EnumDescriptor( + name='ServiceStatusEnum', + full_name='context.ServiceStatusEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='SERVICESTATUS_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SERVICESTATUS_PLANNED', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SERVICESTATUS_ACTIVE', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SERVICESTATUS_PENDING_REMOVAL', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=4897, + serialized_end=5033, +) +_sym_db.RegisterEnumDescriptor(_SERVICESTATUSENUM) + +ServiceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICESTATUSENUM) +_SLICESTATUSENUM = _descriptor.EnumDescriptor( + name='SliceStatusEnum', + full_name='context.SliceStatusEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_PLANNED', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_INIT', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_ACTIVE', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_DEINIT', index=4, number=4, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=5036, + serialized_end=5175, +) +_sym_db.RegisterEnumDescriptor(_SLICESTATUSENUM) + +SliceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SLICESTATUSENUM) +_CONFIGACTIONENUM = _descriptor.EnumDescriptor( + name='ConfigActionEnum', + full_name='context.ConfigActionEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='CONFIGACTION_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CONFIGACTION_SET', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CONFIGACTION_DELETE', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=5177, + serialized_end=5270, +) +_sym_db.RegisterEnumDescriptor(_CONFIGACTIONENUM) + +ConfigActionEnum = enum_type_wrapper.EnumTypeWrapper(_CONFIGACTIONENUM) +EVENTTYPE_UNDEFINED = 0 +EVENTTYPE_CREATE = 1 +EVENTTYPE_UPDATE = 2 +EVENTTYPE_REMOVE = 3 +DEVICEDRIVER_UNDEFINED = 0 +DEVICEDRIVER_OPENCONFIG = 1 +DEVICEDRIVER_TRANSPORT_API = 2 +DEVICEDRIVER_P4 = 3 +DEVICEDRIVER_IETF_NETWORK_TOPOLOGY = 4 +DEVICEDRIVER_ONF_TR_352 = 5 +DEVICEOPERATIONALSTATUS_UNDEFINED = 0 +DEVICEOPERATIONALSTATUS_DISABLED = 1 +DEVICEOPERATIONALSTATUS_ENABLED = 2 +SERVICETYPE_UNKNOWN = 0 +SERVICETYPE_L3NM = 1 +SERVICETYPE_L2NM = 2 +SERVICETYPE_TAPI_CONNECTIVITY_SERVICE = 3 +SERVICESTATUS_UNDEFINED = 0 +SERVICESTATUS_PLANNED = 1 +SERVICESTATUS_ACTIVE = 2 +SERVICESTATUS_PENDING_REMOVAL = 3 +SLICESTATUS_UNDEFINED = 0 +SLICESTATUS_PLANNED = 1 +SLICESTATUS_INIT = 2 +SLICESTATUS_ACTIVE = 3 +SLICESTATUS_DEINIT = 4 +CONFIGACTION_UNDEFINED = 0 +CONFIGACTION_SET = 1 +CONFIGACTION_DELETE = 2 + + + +_EMPTY = _descriptor.Descriptor( + name='Empty', + full_name='context.Empty', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=50, + serialized_end=57, +) + + +_UUID = _descriptor.Descriptor( + name='Uuid', + full_name='context.Uuid', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='uuid', full_name='context.Uuid.uuid', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=59, + serialized_end=79, +) + + +_EVENT = _descriptor.Descriptor( + name='Event', + full_name='context.Event', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='timestamp', full_name='context.Event.timestamp', index=0, + number=1, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='event_type', full_name='context.Event.event_type', index=1, + number=2, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=81, + serialized_end=151, +) + + +_CONTEXTID = _descriptor.Descriptor( + name='ContextId', + full_name='context.ContextId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_uuid', full_name='context.ContextId.context_uuid', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=153, + serialized_end=201, +) + + +_CONTEXT = _descriptor.Descriptor( + name='Context', + full_name='context.Context', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_id', full_name='context.Context.context_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='topology_ids', full_name='context.Context.topology_ids', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_ids', full_name='context.Context.service_ids', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='controller', full_name='context.Context.controller', index=3, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=204, + serialized_end=386, +) + + +_CONTEXTIDLIST = _descriptor.Descriptor( + name='ContextIdList', + full_name='context.ContextIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_ids', full_name='context.ContextIdList.context_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=388, + serialized_end=444, +) + + +_CONTEXTLIST = _descriptor.Descriptor( + name='ContextList', + full_name='context.ContextList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='contexts', full_name='context.ContextList.contexts', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=446, + serialized_end=495, +) + + +_CONTEXTEVENT = _descriptor.Descriptor( + name='ContextEvent', + full_name='context.ContextEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.ContextEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='context_id', full_name='context.ContextEvent.context_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=497, + serialized_end=582, +) + + +_TOPOLOGYID = _descriptor.Descriptor( + name='TopologyId', + full_name='context.TopologyId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_id', full_name='context.TopologyId.context_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='topology_uuid', full_name='context.TopologyId.topology_uuid', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=584, + serialized_end=674, +) + + +_TOPOLOGY = _descriptor.Descriptor( + name='Topology', + full_name='context.Topology', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='topology_id', full_name='context.Topology.topology_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='device_ids', full_name='context.Topology.device_ids', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='link_ids', full_name='context.Topology.link_ids', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=676, + serialized_end=802, +) + + +_TOPOLOGYIDLIST = _descriptor.Descriptor( + name='TopologyIdList', + full_name='context.TopologyIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='topology_ids', full_name='context.TopologyIdList.topology_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=804, + serialized_end=863, +) + + +_TOPOLOGYLIST = _descriptor.Descriptor( + name='TopologyList', + full_name='context.TopologyList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='topologies', full_name='context.TopologyList.topologies', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=865, + serialized_end=918, +) + + +_TOPOLOGYEVENT = _descriptor.Descriptor( + name='TopologyEvent', + full_name='context.TopologyEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.TopologyEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='topology_id', full_name='context.TopologyEvent.topology_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=920, + serialized_end=1008, +) + + +_DEVICEID = _descriptor.Descriptor( + name='DeviceId', + full_name='context.DeviceId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='device_uuid', full_name='context.DeviceId.device_uuid', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1010, + serialized_end=1056, +) + + +_DEVICE = _descriptor.Descriptor( + name='Device', + full_name='context.Device', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='device_id', full_name='context.Device.device_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='device_type', full_name='context.Device.device_type', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='device_config', full_name='context.Device.device_config', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='device_operational_status', full_name='context.Device.device_operational_status', index=3, + number=4, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='device_drivers', full_name='context.Device.device_drivers', index=4, + number=5, type=14, cpp_type=8, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='device_endpoints', full_name='context.Device.device_endpoints', index=5, + number=6, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1059, + serialized_end=1341, +) + + +_DEVICECONFIG = _descriptor.Descriptor( + name='DeviceConfig', + full_name='context.DeviceConfig', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='config_rules', full_name='context.DeviceConfig.config_rules', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1343, + serialized_end=1400, +) + + +_DEVICEIDLIST = _descriptor.Descriptor( + name='DeviceIdList', + full_name='context.DeviceIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='device_ids', full_name='context.DeviceIdList.device_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1402, + serialized_end=1455, +) + + +_DEVICELIST = _descriptor.Descriptor( + name='DeviceList', + full_name='context.DeviceList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='devices', full_name='context.DeviceList.devices', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1457, + serialized_end=1503, +) + + +_DEVICEEVENT = _descriptor.Descriptor( + name='DeviceEvent', + full_name='context.DeviceEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.DeviceEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='device_id', full_name='context.DeviceEvent.device_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1505, + serialized_end=1587, +) + + +_LINKID = _descriptor.Descriptor( + name='LinkId', + full_name='context.LinkId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='link_uuid', full_name='context.LinkId.link_uuid', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1589, + serialized_end=1631, +) + + +_LINK = _descriptor.Descriptor( + name='Link', + full_name='context.Link', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='link_id', full_name='context.Link.link_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='link_endpoint_ids', full_name='context.Link.link_endpoint_ids', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1633, + serialized_end=1721, +) + + +_LINKIDLIST = _descriptor.Descriptor( + name='LinkIdList', + full_name='context.LinkIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='link_ids', full_name='context.LinkIdList.link_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1723, + serialized_end=1770, +) + + +_LINKLIST = _descriptor.Descriptor( + name='LinkList', + full_name='context.LinkList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='links', full_name='context.LinkList.links', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1772, + serialized_end=1812, +) + + +_LINKEVENT = _descriptor.Descriptor( + name='LinkEvent', + full_name='context.LinkEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.LinkEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='link_id', full_name='context.LinkEvent.link_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1814, + serialized_end=1890, +) + + +_SERVICEID = _descriptor.Descriptor( + name='ServiceId', + full_name='context.ServiceId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_id', full_name='context.ServiceId.context_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_uuid', full_name='context.ServiceId.service_uuid', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1892, + serialized_end=1980, +) + + +_SERVICE = _descriptor.Descriptor( + name='Service', + full_name='context.Service', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='service_id', full_name='context.Service.service_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_type', full_name='context.Service.service_type', index=1, + number=2, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_endpoint_ids', full_name='context.Service.service_endpoint_ids', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_constraints', full_name='context.Service.service_constraints', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_status', full_name='context.Service.service_status', index=4, + number=5, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_config', full_name='context.Service.service_config', index=5, + number=6, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1983, + serialized_end=2277, +) + + +_SERVICESTATUS = _descriptor.Descriptor( + name='ServiceStatus', + full_name='context.ServiceStatus', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='service_status', full_name='context.ServiceStatus.service_status', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2279, + serialized_end=2346, +) + + +_SERVICECONFIG = _descriptor.Descriptor( + name='ServiceConfig', + full_name='context.ServiceConfig', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='config_rules', full_name='context.ServiceConfig.config_rules', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2348, + serialized_end=2406, +) + + +_SERVICEIDLIST = _descriptor.Descriptor( + name='ServiceIdList', + full_name='context.ServiceIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='service_ids', full_name='context.ServiceIdList.service_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2408, + serialized_end=2464, +) + + +_SERVICELIST = _descriptor.Descriptor( + name='ServiceList', + full_name='context.ServiceList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='services', full_name='context.ServiceList.services', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2466, + serialized_end=2515, +) + + +_SERVICEEVENT = _descriptor.Descriptor( + name='ServiceEvent', + full_name='context.ServiceEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.ServiceEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_id', full_name='context.ServiceEvent.service_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2517, + serialized_end=2602, +) + + +_SLICEID = _descriptor.Descriptor( + name='SliceId', + full_name='context.SliceId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_id', full_name='context.SliceId.context_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_uuid', full_name='context.SliceId.slice_uuid', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2604, + serialized_end=2688, +) + + +_SLICE = _descriptor.Descriptor( + name='Slice', + full_name='context.Slice', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_id', full_name='context.Slice.slice_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_endpoint_ids', full_name='context.Slice.slice_endpoint_ids', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_constraints', full_name='context.Slice.slice_constraints', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_service_ids', full_name='context.Slice.slice_service_ids', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_subslice_ids', full_name='context.Slice.slice_subslice_ids', index=4, + number=5, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_status', full_name='context.Slice.slice_status', index=5, + number=6, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2691, + serialized_end=2968, +) + + +_SLICESTATUS = _descriptor.Descriptor( + name='SliceStatus', + full_name='context.SliceStatus', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_status', full_name='context.SliceStatus.slice_status', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2970, + serialized_end=3031, +) + + +_SLICEIDLIST = _descriptor.Descriptor( + name='SliceIdList', + full_name='context.SliceIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_ids', full_name='context.SliceIdList.slice_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3033, + serialized_end=3083, +) + + +_SLICELIST = _descriptor.Descriptor( + name='SliceList', + full_name='context.SliceList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slices', full_name='context.SliceList.slices', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3085, + serialized_end=3128, +) + + +_SLICEEVENT = _descriptor.Descriptor( + name='SliceEvent', + full_name='context.SliceEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.SliceEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_id', full_name='context.SliceEvent.slice_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3130, + serialized_end=3209, +) + + +_CONNECTIONID = _descriptor.Descriptor( + name='ConnectionId', + full_name='context.ConnectionId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='connection_uuid', full_name='context.ConnectionId.connection_uuid', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3211, + serialized_end=3265, +) + + +_CONNECTION = _descriptor.Descriptor( + name='Connection', + full_name='context.Connection', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='connection_id', full_name='context.Connection.connection_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_id', full_name='context.Connection.service_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='path_hops_endpoint_ids', full_name='context.Connection.path_hops_endpoint_ids', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='sub_service_ids', full_name='context.Connection.sub_service_ids', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3268, + serialized_end=3464, +) + + +_CONNECTIONIDLIST = _descriptor.Descriptor( + name='ConnectionIdList', + full_name='context.ConnectionIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='connection_ids', full_name='context.ConnectionIdList.connection_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3466, + serialized_end=3531, +) + + +_CONNECTIONLIST = _descriptor.Descriptor( + name='ConnectionList', + full_name='context.ConnectionList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='connections', full_name='context.ConnectionList.connections', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3533, + serialized_end=3591, +) + + +_CONNECTIONEVENT = _descriptor.Descriptor( + name='ConnectionEvent', + full_name='context.ConnectionEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.ConnectionEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='connection_id', full_name='context.ConnectionEvent.connection_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3593, + serialized_end=3687, +) + + +_ENDPOINTID = _descriptor.Descriptor( + name='EndPointId', + full_name='context.EndPointId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='topology_id', full_name='context.EndPointId.topology_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='device_id', full_name='context.EndPointId.device_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='endpoint_uuid', full_name='context.EndPointId.endpoint_uuid', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3690, + serialized_end=3820, +) + + +_ENDPOINT = _descriptor.Descriptor( + name='EndPoint', + full_name='context.EndPoint', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='endpoint_id', full_name='context.EndPoint.endpoint_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='endpoint_type', full_name='context.EndPoint.endpoint_type', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='kpi_sample_types', full_name='context.EndPoint.kpi_sample_types', index=2, + number=3, type=14, cpp_type=8, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3823, + serialized_end=3957, +) + + +_CONFIGRULE = _descriptor.Descriptor( + name='ConfigRule', + full_name='context.ConfigRule', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='action', full_name='context.ConfigRule.action', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='resource_key', full_name='context.ConfigRule.resource_key', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='resource_value', full_name='context.ConfigRule.resource_value', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3959, + serialized_end=4060, +) + + +_CONSTRAINT = _descriptor.Descriptor( + name='Constraint', + full_name='context.Constraint', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='constraint_type', full_name='context.Constraint.constraint_type', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='constraint_value', full_name='context.Constraint.constraint_value', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=4062, + serialized_end=4125, +) + + +_TERAFLOWCONTROLLER = _descriptor.Descriptor( + name='TeraFlowController', + full_name='context.TeraFlowController', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_id', full_name='context.TeraFlowController.context_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='ip_address', full_name='context.TeraFlowController.ip_address', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='port', full_name='context.TeraFlowController.port', index=2, + number=3, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=4127, + serialized_end=4221, +) + + +_AUTHENTICATIONRESULT = _descriptor.Descriptor( + name='AuthenticationResult', + full_name='context.AuthenticationResult', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_id', full_name='context.AuthenticationResult.context_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='authenticated', full_name='context.AuthenticationResult.authenticated', index=1, + number=2, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=4223, + serialized_end=4308, +) + +_EVENT.fields_by_name['event_type'].enum_type = _EVENTTYPEENUM +_CONTEXTID.fields_by_name['context_uuid'].message_type = _UUID +_CONTEXT.fields_by_name['context_id'].message_type = _CONTEXTID +_CONTEXT.fields_by_name['topology_ids'].message_type = _TOPOLOGYID +_CONTEXT.fields_by_name['service_ids'].message_type = _SERVICEID +_CONTEXT.fields_by_name['controller'].message_type = _TERAFLOWCONTROLLER +_CONTEXTIDLIST.fields_by_name['context_ids'].message_type = _CONTEXTID +_CONTEXTLIST.fields_by_name['contexts'].message_type = _CONTEXT +_CONTEXTEVENT.fields_by_name['event'].message_type = _EVENT +_CONTEXTEVENT.fields_by_name['context_id'].message_type = _CONTEXTID +_TOPOLOGYID.fields_by_name['context_id'].message_type = _CONTEXTID +_TOPOLOGYID.fields_by_name['topology_uuid'].message_type = _UUID +_TOPOLOGY.fields_by_name['topology_id'].message_type = _TOPOLOGYID +_TOPOLOGY.fields_by_name['device_ids'].message_type = _DEVICEID +_TOPOLOGY.fields_by_name['link_ids'].message_type = _LINKID +_TOPOLOGYIDLIST.fields_by_name['topology_ids'].message_type = _TOPOLOGYID +_TOPOLOGYLIST.fields_by_name['topologies'].message_type = _TOPOLOGY +_TOPOLOGYEVENT.fields_by_name['event'].message_type = _EVENT +_TOPOLOGYEVENT.fields_by_name['topology_id'].message_type = _TOPOLOGYID +_DEVICEID.fields_by_name['device_uuid'].message_type = _UUID +_DEVICE.fields_by_name['device_id'].message_type = _DEVICEID +_DEVICE.fields_by_name['device_config'].message_type = _DEVICECONFIG +_DEVICE.fields_by_name['device_operational_status'].enum_type = _DEVICEOPERATIONALSTATUSENUM +_DEVICE.fields_by_name['device_drivers'].enum_type = _DEVICEDRIVERENUM +_DEVICE.fields_by_name['device_endpoints'].message_type = _ENDPOINT +_DEVICECONFIG.fields_by_name['config_rules'].message_type = _CONFIGRULE +_DEVICEIDLIST.fields_by_name['device_ids'].message_type = _DEVICEID +_DEVICELIST.fields_by_name['devices'].message_type = _DEVICE +_DEVICEEVENT.fields_by_name['event'].message_type = _EVENT +_DEVICEEVENT.fields_by_name['device_id'].message_type = _DEVICEID +_LINKID.fields_by_name['link_uuid'].message_type = _UUID +_LINK.fields_by_name['link_id'].message_type = _LINKID +_LINK.fields_by_name['link_endpoint_ids'].message_type = _ENDPOINTID +_LINKIDLIST.fields_by_name['link_ids'].message_type = _LINKID +_LINKLIST.fields_by_name['links'].message_type = _LINK +_LINKEVENT.fields_by_name['event'].message_type = _EVENT +_LINKEVENT.fields_by_name['link_id'].message_type = _LINKID +_SERVICEID.fields_by_name['context_id'].message_type = _CONTEXTID +_SERVICEID.fields_by_name['service_uuid'].message_type = _UUID +_SERVICE.fields_by_name['service_id'].message_type = _SERVICEID +_SERVICE.fields_by_name['service_type'].enum_type = _SERVICETYPEENUM +_SERVICE.fields_by_name['service_endpoint_ids'].message_type = _ENDPOINTID +_SERVICE.fields_by_name['service_constraints'].message_type = _CONSTRAINT +_SERVICE.fields_by_name['service_status'].message_type = _SERVICESTATUS +_SERVICE.fields_by_name['service_config'].message_type = _SERVICECONFIG +_SERVICESTATUS.fields_by_name['service_status'].enum_type = _SERVICESTATUSENUM +_SERVICECONFIG.fields_by_name['config_rules'].message_type = _CONFIGRULE +_SERVICEIDLIST.fields_by_name['service_ids'].message_type = _SERVICEID +_SERVICELIST.fields_by_name['services'].message_type = _SERVICE +_SERVICEEVENT.fields_by_name['event'].message_type = _EVENT +_SERVICEEVENT.fields_by_name['service_id'].message_type = _SERVICEID +_SLICEID.fields_by_name['context_id'].message_type = _CONTEXTID +_SLICEID.fields_by_name['slice_uuid'].message_type = _UUID +_SLICE.fields_by_name['slice_id'].message_type = _SLICEID +_SLICE.fields_by_name['slice_endpoint_ids'].message_type = _ENDPOINTID +_SLICE.fields_by_name['slice_constraints'].message_type = _CONSTRAINT +_SLICE.fields_by_name['slice_service_ids'].message_type = _SERVICEID +_SLICE.fields_by_name['slice_subslice_ids'].message_type = _SLICEID +_SLICE.fields_by_name['slice_status'].message_type = _SLICESTATUS +_SLICESTATUS.fields_by_name['slice_status'].enum_type = _SLICESTATUSENUM +_SLICEIDLIST.fields_by_name['slice_ids'].message_type = _SLICEID +_SLICELIST.fields_by_name['slices'].message_type = _SLICE +_SLICEEVENT.fields_by_name['event'].message_type = _EVENT +_SLICEEVENT.fields_by_name['slice_id'].message_type = _SLICEID +_CONNECTIONID.fields_by_name['connection_uuid'].message_type = _UUID +_CONNECTION.fields_by_name['connection_id'].message_type = _CONNECTIONID +_CONNECTION.fields_by_name['service_id'].message_type = _SERVICEID +_CONNECTION.fields_by_name['path_hops_endpoint_ids'].message_type = _ENDPOINTID +_CONNECTION.fields_by_name['sub_service_ids'].message_type = _SERVICEID +_CONNECTIONIDLIST.fields_by_name['connection_ids'].message_type = _CONNECTIONID +_CONNECTIONLIST.fields_by_name['connections'].message_type = _CONNECTION +_CONNECTIONEVENT.fields_by_name['event'].message_type = _EVENT +_CONNECTIONEVENT.fields_by_name['connection_id'].message_type = _CONNECTIONID +_ENDPOINTID.fields_by_name['topology_id'].message_type = _TOPOLOGYID +_ENDPOINTID.fields_by_name['device_id'].message_type = _DEVICEID +_ENDPOINTID.fields_by_name['endpoint_uuid'].message_type = _UUID +_ENDPOINT.fields_by_name['endpoint_id'].message_type = _ENDPOINTID +_ENDPOINT.fields_by_name['kpi_sample_types'].enum_type = kpi__sample__types__pb2._KPISAMPLETYPE +_CONFIGRULE.fields_by_name['action'].enum_type = _CONFIGACTIONENUM +_TERAFLOWCONTROLLER.fields_by_name['context_id'].message_type = _CONTEXTID +_AUTHENTICATIONRESULT.fields_by_name['context_id'].message_type = _CONTEXTID +DESCRIPTOR.message_types_by_name['Empty'] = _EMPTY +DESCRIPTOR.message_types_by_name['Uuid'] = _UUID +DESCRIPTOR.message_types_by_name['Event'] = _EVENT +DESCRIPTOR.message_types_by_name['ContextId'] = _CONTEXTID +DESCRIPTOR.message_types_by_name['Context'] = _CONTEXT +DESCRIPTOR.message_types_by_name['ContextIdList'] = _CONTEXTIDLIST +DESCRIPTOR.message_types_by_name['ContextList'] = _CONTEXTLIST +DESCRIPTOR.message_types_by_name['ContextEvent'] = _CONTEXTEVENT +DESCRIPTOR.message_types_by_name['TopologyId'] = _TOPOLOGYID +DESCRIPTOR.message_types_by_name['Topology'] = _TOPOLOGY +DESCRIPTOR.message_types_by_name['TopologyIdList'] = _TOPOLOGYIDLIST +DESCRIPTOR.message_types_by_name['TopologyList'] = _TOPOLOGYLIST +DESCRIPTOR.message_types_by_name['TopologyEvent'] = _TOPOLOGYEVENT +DESCRIPTOR.message_types_by_name['DeviceId'] = _DEVICEID +DESCRIPTOR.message_types_by_name['Device'] = _DEVICE +DESCRIPTOR.message_types_by_name['DeviceConfig'] = _DEVICECONFIG +DESCRIPTOR.message_types_by_name['DeviceIdList'] = _DEVICEIDLIST +DESCRIPTOR.message_types_by_name['DeviceList'] = _DEVICELIST +DESCRIPTOR.message_types_by_name['DeviceEvent'] = _DEVICEEVENT +DESCRIPTOR.message_types_by_name['LinkId'] = _LINKID +DESCRIPTOR.message_types_by_name['Link'] = _LINK +DESCRIPTOR.message_types_by_name['LinkIdList'] = _LINKIDLIST +DESCRIPTOR.message_types_by_name['LinkList'] = _LINKLIST +DESCRIPTOR.message_types_by_name['LinkEvent'] = _LINKEVENT +DESCRIPTOR.message_types_by_name['ServiceId'] = _SERVICEID +DESCRIPTOR.message_types_by_name['Service'] = _SERVICE +DESCRIPTOR.message_types_by_name['ServiceStatus'] = _SERVICESTATUS +DESCRIPTOR.message_types_by_name['ServiceConfig'] = _SERVICECONFIG +DESCRIPTOR.message_types_by_name['ServiceIdList'] = _SERVICEIDLIST +DESCRIPTOR.message_types_by_name['ServiceList'] = _SERVICELIST +DESCRIPTOR.message_types_by_name['ServiceEvent'] = _SERVICEEVENT +DESCRIPTOR.message_types_by_name['SliceId'] = _SLICEID +DESCRIPTOR.message_types_by_name['Slice'] = _SLICE +DESCRIPTOR.message_types_by_name['SliceStatus'] = _SLICESTATUS +DESCRIPTOR.message_types_by_name['SliceIdList'] = _SLICEIDLIST +DESCRIPTOR.message_types_by_name['SliceList'] = _SLICELIST +DESCRIPTOR.message_types_by_name['SliceEvent'] = _SLICEEVENT +DESCRIPTOR.message_types_by_name['ConnectionId'] = _CONNECTIONID +DESCRIPTOR.message_types_by_name['Connection'] = _CONNECTION +DESCRIPTOR.message_types_by_name['ConnectionIdList'] = _CONNECTIONIDLIST +DESCRIPTOR.message_types_by_name['ConnectionList'] = _CONNECTIONLIST +DESCRIPTOR.message_types_by_name['ConnectionEvent'] = _CONNECTIONEVENT +DESCRIPTOR.message_types_by_name['EndPointId'] = _ENDPOINTID +DESCRIPTOR.message_types_by_name['EndPoint'] = _ENDPOINT +DESCRIPTOR.message_types_by_name['ConfigRule'] = _CONFIGRULE +DESCRIPTOR.message_types_by_name['Constraint'] = _CONSTRAINT +DESCRIPTOR.message_types_by_name['TeraFlowController'] = _TERAFLOWCONTROLLER +DESCRIPTOR.message_types_by_name['AuthenticationResult'] = _AUTHENTICATIONRESULT +DESCRIPTOR.enum_types_by_name['EventTypeEnum'] = _EVENTTYPEENUM +DESCRIPTOR.enum_types_by_name['DeviceDriverEnum'] = _DEVICEDRIVERENUM +DESCRIPTOR.enum_types_by_name['DeviceOperationalStatusEnum'] = _DEVICEOPERATIONALSTATUSENUM +DESCRIPTOR.enum_types_by_name['ServiceTypeEnum'] = _SERVICETYPEENUM +DESCRIPTOR.enum_types_by_name['ServiceStatusEnum'] = _SERVICESTATUSENUM +DESCRIPTOR.enum_types_by_name['SliceStatusEnum'] = _SLICESTATUSENUM +DESCRIPTOR.enum_types_by_name['ConfigActionEnum'] = _CONFIGACTIONENUM +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +Empty = _reflection.GeneratedProtocolMessageType('Empty', (_message.Message,), { + 'DESCRIPTOR' : _EMPTY, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Empty) + }) +_sym_db.RegisterMessage(Empty) + +Uuid = _reflection.GeneratedProtocolMessageType('Uuid', (_message.Message,), { + 'DESCRIPTOR' : _UUID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Uuid) + }) +_sym_db.RegisterMessage(Uuid) + +Event = _reflection.GeneratedProtocolMessageType('Event', (_message.Message,), { + 'DESCRIPTOR' : _EVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Event) + }) +_sym_db.RegisterMessage(Event) + +ContextId = _reflection.GeneratedProtocolMessageType('ContextId', (_message.Message,), { + 'DESCRIPTOR' : _CONTEXTID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ContextId) + }) +_sym_db.RegisterMessage(ContextId) + +Context = _reflection.GeneratedProtocolMessageType('Context', (_message.Message,), { + 'DESCRIPTOR' : _CONTEXT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Context) + }) +_sym_db.RegisterMessage(Context) + +ContextIdList = _reflection.GeneratedProtocolMessageType('ContextIdList', (_message.Message,), { + 'DESCRIPTOR' : _CONTEXTIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ContextIdList) + }) +_sym_db.RegisterMessage(ContextIdList) + +ContextList = _reflection.GeneratedProtocolMessageType('ContextList', (_message.Message,), { + 'DESCRIPTOR' : _CONTEXTLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ContextList) + }) +_sym_db.RegisterMessage(ContextList) + +ContextEvent = _reflection.GeneratedProtocolMessageType('ContextEvent', (_message.Message,), { + 'DESCRIPTOR' : _CONTEXTEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ContextEvent) + }) +_sym_db.RegisterMessage(ContextEvent) + +TopologyId = _reflection.GeneratedProtocolMessageType('TopologyId', (_message.Message,), { + 'DESCRIPTOR' : _TOPOLOGYID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.TopologyId) + }) +_sym_db.RegisterMessage(TopologyId) + +Topology = _reflection.GeneratedProtocolMessageType('Topology', (_message.Message,), { + 'DESCRIPTOR' : _TOPOLOGY, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Topology) + }) +_sym_db.RegisterMessage(Topology) + +TopologyIdList = _reflection.GeneratedProtocolMessageType('TopologyIdList', (_message.Message,), { + 'DESCRIPTOR' : _TOPOLOGYIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.TopologyIdList) + }) +_sym_db.RegisterMessage(TopologyIdList) + +TopologyList = _reflection.GeneratedProtocolMessageType('TopologyList', (_message.Message,), { + 'DESCRIPTOR' : _TOPOLOGYLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.TopologyList) + }) +_sym_db.RegisterMessage(TopologyList) + +TopologyEvent = _reflection.GeneratedProtocolMessageType('TopologyEvent', (_message.Message,), { + 'DESCRIPTOR' : _TOPOLOGYEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.TopologyEvent) + }) +_sym_db.RegisterMessage(TopologyEvent) + +DeviceId = _reflection.GeneratedProtocolMessageType('DeviceId', (_message.Message,), { + 'DESCRIPTOR' : _DEVICEID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.DeviceId) + }) +_sym_db.RegisterMessage(DeviceId) + +Device = _reflection.GeneratedProtocolMessageType('Device', (_message.Message,), { + 'DESCRIPTOR' : _DEVICE, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Device) + }) +_sym_db.RegisterMessage(Device) + +DeviceConfig = _reflection.GeneratedProtocolMessageType('DeviceConfig', (_message.Message,), { + 'DESCRIPTOR' : _DEVICECONFIG, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.DeviceConfig) + }) +_sym_db.RegisterMessage(DeviceConfig) + +DeviceIdList = _reflection.GeneratedProtocolMessageType('DeviceIdList', (_message.Message,), { + 'DESCRIPTOR' : _DEVICEIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.DeviceIdList) + }) +_sym_db.RegisterMessage(DeviceIdList) + +DeviceList = _reflection.GeneratedProtocolMessageType('DeviceList', (_message.Message,), { + 'DESCRIPTOR' : _DEVICELIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.DeviceList) + }) +_sym_db.RegisterMessage(DeviceList) + +DeviceEvent = _reflection.GeneratedProtocolMessageType('DeviceEvent', (_message.Message,), { + 'DESCRIPTOR' : _DEVICEEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.DeviceEvent) + }) +_sym_db.RegisterMessage(DeviceEvent) + +LinkId = _reflection.GeneratedProtocolMessageType('LinkId', (_message.Message,), { + 'DESCRIPTOR' : _LINKID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.LinkId) + }) +_sym_db.RegisterMessage(LinkId) + +Link = _reflection.GeneratedProtocolMessageType('Link', (_message.Message,), { + 'DESCRIPTOR' : _LINK, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Link) + }) +_sym_db.RegisterMessage(Link) + +LinkIdList = _reflection.GeneratedProtocolMessageType('LinkIdList', (_message.Message,), { + 'DESCRIPTOR' : _LINKIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.LinkIdList) + }) +_sym_db.RegisterMessage(LinkIdList) + +LinkList = _reflection.GeneratedProtocolMessageType('LinkList', (_message.Message,), { + 'DESCRIPTOR' : _LINKLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.LinkList) + }) +_sym_db.RegisterMessage(LinkList) + +LinkEvent = _reflection.GeneratedProtocolMessageType('LinkEvent', (_message.Message,), { + 'DESCRIPTOR' : _LINKEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.LinkEvent) + }) +_sym_db.RegisterMessage(LinkEvent) + +ServiceId = _reflection.GeneratedProtocolMessageType('ServiceId', (_message.Message,), { + 'DESCRIPTOR' : _SERVICEID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ServiceId) + }) +_sym_db.RegisterMessage(ServiceId) + +Service = _reflection.GeneratedProtocolMessageType('Service', (_message.Message,), { + 'DESCRIPTOR' : _SERVICE, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Service) + }) +_sym_db.RegisterMessage(Service) + +ServiceStatus = _reflection.GeneratedProtocolMessageType('ServiceStatus', (_message.Message,), { + 'DESCRIPTOR' : _SERVICESTATUS, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ServiceStatus) + }) +_sym_db.RegisterMessage(ServiceStatus) + +ServiceConfig = _reflection.GeneratedProtocolMessageType('ServiceConfig', (_message.Message,), { + 'DESCRIPTOR' : _SERVICECONFIG, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ServiceConfig) + }) +_sym_db.RegisterMessage(ServiceConfig) + +ServiceIdList = _reflection.GeneratedProtocolMessageType('ServiceIdList', (_message.Message,), { + 'DESCRIPTOR' : _SERVICEIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ServiceIdList) + }) +_sym_db.RegisterMessage(ServiceIdList) + +ServiceList = _reflection.GeneratedProtocolMessageType('ServiceList', (_message.Message,), { + 'DESCRIPTOR' : _SERVICELIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ServiceList) + }) +_sym_db.RegisterMessage(ServiceList) + +ServiceEvent = _reflection.GeneratedProtocolMessageType('ServiceEvent', (_message.Message,), { + 'DESCRIPTOR' : _SERVICEEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ServiceEvent) + }) +_sym_db.RegisterMessage(ServiceEvent) + +SliceId = _reflection.GeneratedProtocolMessageType('SliceId', (_message.Message,), { + 'DESCRIPTOR' : _SLICEID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceId) + }) +_sym_db.RegisterMessage(SliceId) + +Slice = _reflection.GeneratedProtocolMessageType('Slice', (_message.Message,), { + 'DESCRIPTOR' : _SLICE, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Slice) + }) +_sym_db.RegisterMessage(Slice) + +SliceStatus = _reflection.GeneratedProtocolMessageType('SliceStatus', (_message.Message,), { + 'DESCRIPTOR' : _SLICESTATUS, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceStatus) + }) +_sym_db.RegisterMessage(SliceStatus) + +SliceIdList = _reflection.GeneratedProtocolMessageType('SliceIdList', (_message.Message,), { + 'DESCRIPTOR' : _SLICEIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceIdList) + }) +_sym_db.RegisterMessage(SliceIdList) + +SliceList = _reflection.GeneratedProtocolMessageType('SliceList', (_message.Message,), { + 'DESCRIPTOR' : _SLICELIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceList) + }) +_sym_db.RegisterMessage(SliceList) + +SliceEvent = _reflection.GeneratedProtocolMessageType('SliceEvent', (_message.Message,), { + 'DESCRIPTOR' : _SLICEEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceEvent) + }) +_sym_db.RegisterMessage(SliceEvent) + +ConnectionId = _reflection.GeneratedProtocolMessageType('ConnectionId', (_message.Message,), { + 'DESCRIPTOR' : _CONNECTIONID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ConnectionId) + }) +_sym_db.RegisterMessage(ConnectionId) + +Connection = _reflection.GeneratedProtocolMessageType('Connection', (_message.Message,), { + 'DESCRIPTOR' : _CONNECTION, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Connection) + }) +_sym_db.RegisterMessage(Connection) + +ConnectionIdList = _reflection.GeneratedProtocolMessageType('ConnectionIdList', (_message.Message,), { + 'DESCRIPTOR' : _CONNECTIONIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ConnectionIdList) + }) +_sym_db.RegisterMessage(ConnectionIdList) + +ConnectionList = _reflection.GeneratedProtocolMessageType('ConnectionList', (_message.Message,), { + 'DESCRIPTOR' : _CONNECTIONLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ConnectionList) + }) +_sym_db.RegisterMessage(ConnectionList) + +ConnectionEvent = _reflection.GeneratedProtocolMessageType('ConnectionEvent', (_message.Message,), { + 'DESCRIPTOR' : _CONNECTIONEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ConnectionEvent) + }) +_sym_db.RegisterMessage(ConnectionEvent) + +EndPointId = _reflection.GeneratedProtocolMessageType('EndPointId', (_message.Message,), { + 'DESCRIPTOR' : _ENDPOINTID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.EndPointId) + }) +_sym_db.RegisterMessage(EndPointId) + +EndPoint = _reflection.GeneratedProtocolMessageType('EndPoint', (_message.Message,), { + 'DESCRIPTOR' : _ENDPOINT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.EndPoint) + }) +_sym_db.RegisterMessage(EndPoint) + +ConfigRule = _reflection.GeneratedProtocolMessageType('ConfigRule', (_message.Message,), { + 'DESCRIPTOR' : _CONFIGRULE, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ConfigRule) + }) +_sym_db.RegisterMessage(ConfigRule) + +Constraint = _reflection.GeneratedProtocolMessageType('Constraint', (_message.Message,), { + 'DESCRIPTOR' : _CONSTRAINT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Constraint) + }) +_sym_db.RegisterMessage(Constraint) + +TeraFlowController = _reflection.GeneratedProtocolMessageType('TeraFlowController', (_message.Message,), { + 'DESCRIPTOR' : _TERAFLOWCONTROLLER, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.TeraFlowController) + }) +_sym_db.RegisterMessage(TeraFlowController) + +AuthenticationResult = _reflection.GeneratedProtocolMessageType('AuthenticationResult', (_message.Message,), { + 'DESCRIPTOR' : _AUTHENTICATIONRESULT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.AuthenticationResult) + }) +_sym_db.RegisterMessage(AuthenticationResult) + + + +_CONTEXTSERVICE = _descriptor.ServiceDescriptor( + name='ContextService', + full_name='context.ContextService', + file=DESCRIPTOR, + index=0, + serialized_options=None, + create_key=_descriptor._internal_create_key, + serialized_start=5273, + serialized_end=7688, + methods=[ + _descriptor.MethodDescriptor( + name='ListContextIds', + full_name='context.ContextService.ListContextIds', + index=0, + containing_service=None, + input_type=_EMPTY, + output_type=_CONTEXTIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListContexts', + full_name='context.ContextService.ListContexts', + index=1, + containing_service=None, + input_type=_EMPTY, + output_type=_CONTEXTLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetContext', + full_name='context.ContextService.GetContext', + index=2, + containing_service=None, + input_type=_CONTEXTID, + output_type=_CONTEXT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetContext', + full_name='context.ContextService.SetContext', + index=3, + containing_service=None, + input_type=_CONTEXT, + output_type=_CONTEXTID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveContext', + full_name='context.ContextService.RemoveContext', + index=4, + containing_service=None, + input_type=_CONTEXTID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetContextEvents', + full_name='context.ContextService.GetContextEvents', + index=5, + containing_service=None, + input_type=_EMPTY, + output_type=_CONTEXTEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListTopologyIds', + full_name='context.ContextService.ListTopologyIds', + index=6, + containing_service=None, + input_type=_CONTEXTID, + output_type=_TOPOLOGYIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListTopologies', + full_name='context.ContextService.ListTopologies', + index=7, + containing_service=None, + input_type=_CONTEXTID, + output_type=_TOPOLOGYLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetTopology', + full_name='context.ContextService.GetTopology', + index=8, + containing_service=None, + input_type=_TOPOLOGYID, + output_type=_TOPOLOGY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetTopology', + full_name='context.ContextService.SetTopology', + index=9, + containing_service=None, + input_type=_TOPOLOGY, + output_type=_TOPOLOGYID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveTopology', + full_name='context.ContextService.RemoveTopology', + index=10, + containing_service=None, + input_type=_TOPOLOGYID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetTopologyEvents', + full_name='context.ContextService.GetTopologyEvents', + index=11, + containing_service=None, + input_type=_EMPTY, + output_type=_TOPOLOGYEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListDeviceIds', + full_name='context.ContextService.ListDeviceIds', + index=12, + containing_service=None, + input_type=_EMPTY, + output_type=_DEVICEIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListDevices', + full_name='context.ContextService.ListDevices', + index=13, + containing_service=None, + input_type=_EMPTY, + output_type=_DEVICELIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetDevice', + full_name='context.ContextService.GetDevice', + index=14, + containing_service=None, + input_type=_DEVICEID, + output_type=_DEVICE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetDevice', + full_name='context.ContextService.SetDevice', + index=15, + containing_service=None, + input_type=_DEVICE, + output_type=_DEVICEID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveDevice', + full_name='context.ContextService.RemoveDevice', + index=16, + containing_service=None, + input_type=_DEVICEID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetDeviceEvents', + full_name='context.ContextService.GetDeviceEvents', + index=17, + containing_service=None, + input_type=_EMPTY, + output_type=_DEVICEEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListLinkIds', + full_name='context.ContextService.ListLinkIds', + index=18, + containing_service=None, + input_type=_EMPTY, + output_type=_LINKIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListLinks', + full_name='context.ContextService.ListLinks', + index=19, + containing_service=None, + input_type=_EMPTY, + output_type=_LINKLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetLink', + full_name='context.ContextService.GetLink', + index=20, + containing_service=None, + input_type=_LINKID, + output_type=_LINK, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetLink', + full_name='context.ContextService.SetLink', + index=21, + containing_service=None, + input_type=_LINK, + output_type=_LINKID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveLink', + full_name='context.ContextService.RemoveLink', + index=22, + containing_service=None, + input_type=_LINKID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetLinkEvents', + full_name='context.ContextService.GetLinkEvents', + index=23, + containing_service=None, + input_type=_EMPTY, + output_type=_LINKEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListServiceIds', + full_name='context.ContextService.ListServiceIds', + index=24, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SERVICEIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListServices', + full_name='context.ContextService.ListServices', + index=25, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SERVICELIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetService', + full_name='context.ContextService.GetService', + index=26, + containing_service=None, + input_type=_SERVICEID, + output_type=_SERVICE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetService', + full_name='context.ContextService.SetService', + index=27, + containing_service=None, + input_type=_SERVICE, + output_type=_SERVICEID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveService', + full_name='context.ContextService.RemoveService', + index=28, + containing_service=None, + input_type=_SERVICEID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetServiceEvents', + full_name='context.ContextService.GetServiceEvents', + index=29, + containing_service=None, + input_type=_EMPTY, + output_type=_SERVICEEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListSliceIds', + full_name='context.ContextService.ListSliceIds', + index=30, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SLICEIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListSlices', + full_name='context.ContextService.ListSlices', + index=31, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SLICELIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetSlice', + full_name='context.ContextService.GetSlice', + index=32, + containing_service=None, + input_type=_SLICEID, + output_type=_SLICE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetSlice', + full_name='context.ContextService.SetSlice', + index=33, + containing_service=None, + input_type=_SLICE, + output_type=_SLICEID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveSlice', + full_name='context.ContextService.RemoveSlice', + index=34, + containing_service=None, + input_type=_SLICEID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetSliceEvents', + full_name='context.ContextService.GetSliceEvents', + index=35, + containing_service=None, + input_type=_EMPTY, + output_type=_SLICEEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListConnectionIds', + full_name='context.ContextService.ListConnectionIds', + index=36, + containing_service=None, + input_type=_SERVICEID, + output_type=_CONNECTIONIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListConnections', + full_name='context.ContextService.ListConnections', + index=37, + containing_service=None, + input_type=_SERVICEID, + output_type=_CONNECTIONLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetConnection', + full_name='context.ContextService.GetConnection', + index=38, + containing_service=None, + input_type=_CONNECTIONID, + output_type=_CONNECTION, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetConnection', + full_name='context.ContextService.SetConnection', + index=39, + containing_service=None, + input_type=_CONNECTION, + output_type=_CONNECTIONID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveConnection', + full_name='context.ContextService.RemoveConnection', + index=40, + containing_service=None, + input_type=_CONNECTIONID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetConnectionEvents', + full_name='context.ContextService.GetConnectionEvents', + index=41, + containing_service=None, + input_type=_EMPTY, + output_type=_CONNECTIONEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), +]) +_sym_db.RegisterServiceDescriptor(_CONTEXTSERVICE) + +DESCRIPTOR.services_by_name['ContextService'] = _CONTEXTSERVICE + +# @@protoc_insertion_point(module_scope) diff --git a/src/dlt/connector/proto/dlt_pb2.py b/src/dlt/connector/proto/dlt_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..098eb374a8e6fa322bf5e39123e6f6cc6d18f0b4 --- /dev/null +++ b/src/dlt/connector/proto/dlt_pb2.py @@ -0,0 +1,638 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: dlt.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from . import context_pb2 as context__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='dlt.proto', + package='dlt', + syntax='proto3', + serialized_options=None, + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n\tdlt.proto\x12\x03\x64lt\x1a\rcontext.proto\"{\n\x0b\x44ltRecordId\x12\"\n\x0b\x64omain_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\x12$\n\x04type\x18\x02 \x01(\x0e\x32\x16.dlt.DltRecordTypeEnum\x12\"\n\x0brecord_uuid\x18\x03 \x01(\x0b\x32\r.context.Uuid\"s\n\tDltRecord\x12#\n\trecord_id\x18\x01 \x01(\x0b\x32\x10.dlt.DltRecordId\x12.\n\toperation\x18\x02 \x01(\x0e\x32\x1b.dlt.DltRecordOperationEnum\x12\x11\n\tdata_json\x18\x03 \x01(\t\"m\n\x15\x44ltRecordSubscription\x12$\n\x04type\x18\x01 \x03(\x0e\x32\x16.dlt.DltRecordTypeEnum\x12.\n\toperation\x18\x02 \x03(\x0e\x32\x1b.dlt.DltRecordOperationEnum\"T\n\x0e\x44ltRecordEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12#\n\trecord_id\x18\x02 \x01(\x0b\x32\x10.dlt.DltRecordId\"w\n\x0f\x44ltRecordStatus\x12#\n\trecord_id\x18\x01 \x01(\x0b\x32\x10.dlt.DltRecordId\x12(\n\x06status\x18\x02 \x01(\x0e\x32\x18.dlt.DltRecordStatusEnum\x12\x15\n\rerror_message\x18\x03 \x01(\t\"d\n\rDltPeerStatus\x12/\n\ncontroller\x18\x01 \x01(\x0b\x32\x1b.context.TeraFlowController\x12\"\n\x06status\x18\x02 \x01(\x0e\x32\x12.dlt.DltStatusEnum\"6\n\x11\x44ltPeerStatusList\x12!\n\x05peers\x18\x01 \x03(\x0b\x32\x12.dlt.DltPeerStatus*\xcd\x01\n\x11\x44ltRecordTypeEnum\x12\x1b\n\x17\x44LTRECORDTYPE_UNDEFINED\x10\x00\x12\x19\n\x15\x44LTRECORDTYPE_CONTEXT\x10\x01\x12\x1a\n\x16\x44LTRECORDTYPE_TOPOLOGY\x10\x02\x12\x18\n\x14\x44LTRECORDTYPE_DEVICE\x10\x03\x12\x16\n\x12\x44LTRECORDTYPE_LINK\x10\x04\x12\x19\n\x15\x44LTRECORDTYPE_SERVICE\x10\x05\x12\x17\n\x13\x44LTRECORDTYPE_SLICE\x10\x06*\x94\x01\n\x16\x44ltRecordOperationEnum\x12 \n\x1c\x44LTRECORDOPERATION_UNDEFINED\x10\x00\x12\x1a\n\x16\x44LTRECORDOPERATION_ADD\x10\x01\x12\x1d\n\x19\x44LTRECORDOPERATION_UPDATE\x10\x02\x12\x1d\n\x19\x44LTRECORDOPERATION_DELETE\x10\x03*o\n\x13\x44ltRecordStatusEnum\x12\x1d\n\x19\x44LTRECORDSTATUS_UNDEFINED\x10\x00\x12\x1d\n\x19\x44LTRECORDSTATUS_SUCCEEDED\x10\x01\x12\x1a\n\x16\x44LTRECORDSTATUS_FAILED\x10\x02*\x8e\x01\n\rDltStatusEnum\x12\x17\n\x13\x44LTSTATUS_UNDEFINED\x10\x00\x12\x1a\n\x16\x44LTSTATUS_NOTAVAILABLE\x10\x01\x12\x19\n\x15\x44LTSTATUS_INITIALIZED\x10\x02\x12\x17\n\x13\x44LTSTATUS_AVAILABLE\x10\x03\x12\x14\n\x10\x44LTSTATUS_DEINIT\x10\x04\x32\xb8\x02\n\nDltService\x12\x35\n\x0bRecordToDlt\x12\x0e.dlt.DltRecord\x1a\x14.dlt.DltRecordStatus\"\x00\x12\x30\n\nGetFromDlt\x12\x10.dlt.DltRecordId\x1a\x0e.dlt.DltRecord\"\x00\x12\x45\n\x0eSubscribeToDlt\x12\x1a.dlt.DltRecordSubscription\x1a\x13.dlt.DltRecordEvent\"\x00\x30\x01\x12\x41\n\x0cGetDltStatus\x12\x1b.context.TeraFlowController\x1a\x12.dlt.DltPeerStatus\"\x00\x12\x37\n\x0bGetDltPeers\x12\x0e.context.Empty\x1a\x16.dlt.DltPeerStatusList\"\x00\x62\x06proto3' + , + dependencies=[context__pb2.DESCRIPTOR,]) + +_DLTRECORDTYPEENUM = _descriptor.EnumDescriptor( + name='DltRecordTypeEnum', + full_name='dlt.DltRecordTypeEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='DLTRECORDTYPE_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DLTRECORDTYPE_CONTEXT', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DLTRECORDTYPE_TOPOLOGY', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DLTRECORDTYPE_DEVICE', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DLTRECORDTYPE_LINK', index=4, number=4, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DLTRECORDTYPE_SERVICE', index=5, number=5, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DLTRECORDTYPE_SLICE', index=6, number=6, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=752, + serialized_end=957, +) +_sym_db.RegisterEnumDescriptor(_DLTRECORDTYPEENUM) + +DltRecordTypeEnum = enum_type_wrapper.EnumTypeWrapper(_DLTRECORDTYPEENUM) +_DLTRECORDOPERATIONENUM = _descriptor.EnumDescriptor( + name='DltRecordOperationEnum', + full_name='dlt.DltRecordOperationEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='DLTRECORDOPERATION_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DLTRECORDOPERATION_ADD', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DLTRECORDOPERATION_UPDATE', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DLTRECORDOPERATION_DELETE', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=960, + serialized_end=1108, +) +_sym_db.RegisterEnumDescriptor(_DLTRECORDOPERATIONENUM) + +DltRecordOperationEnum = enum_type_wrapper.EnumTypeWrapper(_DLTRECORDOPERATIONENUM) +_DLTRECORDSTATUSENUM = _descriptor.EnumDescriptor( + name='DltRecordStatusEnum', + full_name='dlt.DltRecordStatusEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='DLTRECORDSTATUS_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DLTRECORDSTATUS_SUCCEEDED', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DLTRECORDSTATUS_FAILED', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=1110, + serialized_end=1221, +) +_sym_db.RegisterEnumDescriptor(_DLTRECORDSTATUSENUM) + +DltRecordStatusEnum = enum_type_wrapper.EnumTypeWrapper(_DLTRECORDSTATUSENUM) +_DLTSTATUSENUM = _descriptor.EnumDescriptor( + name='DltStatusEnum', + full_name='dlt.DltStatusEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='DLTSTATUS_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DLTSTATUS_NOTAVAILABLE', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DLTSTATUS_INITIALIZED', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DLTSTATUS_AVAILABLE', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DLTSTATUS_DEINIT', index=4, number=4, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=1224, + serialized_end=1366, +) +_sym_db.RegisterEnumDescriptor(_DLTSTATUSENUM) + +DltStatusEnum = enum_type_wrapper.EnumTypeWrapper(_DLTSTATUSENUM) +DLTRECORDTYPE_UNDEFINED = 0 +DLTRECORDTYPE_CONTEXT = 1 +DLTRECORDTYPE_TOPOLOGY = 2 +DLTRECORDTYPE_DEVICE = 3 +DLTRECORDTYPE_LINK = 4 +DLTRECORDTYPE_SERVICE = 5 +DLTRECORDTYPE_SLICE = 6 +DLTRECORDOPERATION_UNDEFINED = 0 +DLTRECORDOPERATION_ADD = 1 +DLTRECORDOPERATION_UPDATE = 2 +DLTRECORDOPERATION_DELETE = 3 +DLTRECORDSTATUS_UNDEFINED = 0 +DLTRECORDSTATUS_SUCCEEDED = 1 +DLTRECORDSTATUS_FAILED = 2 +DLTSTATUS_UNDEFINED = 0 +DLTSTATUS_NOTAVAILABLE = 1 +DLTSTATUS_INITIALIZED = 2 +DLTSTATUS_AVAILABLE = 3 +DLTSTATUS_DEINIT = 4 + + + +_DLTRECORDID = _descriptor.Descriptor( + name='DltRecordId', + full_name='dlt.DltRecordId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='domain_uuid', full_name='dlt.DltRecordId.domain_uuid', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='type', full_name='dlt.DltRecordId.type', index=1, + number=2, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='record_uuid', full_name='dlt.DltRecordId.record_uuid', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=33, + serialized_end=156, +) + + +_DLTRECORD = _descriptor.Descriptor( + name='DltRecord', + full_name='dlt.DltRecord', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='record_id', full_name='dlt.DltRecord.record_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='operation', full_name='dlt.DltRecord.operation', index=1, + number=2, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='data_json', full_name='dlt.DltRecord.data_json', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=158, + serialized_end=273, +) + + +_DLTRECORDSUBSCRIPTION = _descriptor.Descriptor( + name='DltRecordSubscription', + full_name='dlt.DltRecordSubscription', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='type', full_name='dlt.DltRecordSubscription.type', index=0, + number=1, type=14, cpp_type=8, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='operation', full_name='dlt.DltRecordSubscription.operation', index=1, + number=2, type=14, cpp_type=8, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=275, + serialized_end=384, +) + + +_DLTRECORDEVENT = _descriptor.Descriptor( + name='DltRecordEvent', + full_name='dlt.DltRecordEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='dlt.DltRecordEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='record_id', full_name='dlt.DltRecordEvent.record_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=386, + serialized_end=470, +) + + +_DLTRECORDSTATUS = _descriptor.Descriptor( + name='DltRecordStatus', + full_name='dlt.DltRecordStatus', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='record_id', full_name='dlt.DltRecordStatus.record_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='status', full_name='dlt.DltRecordStatus.status', index=1, + number=2, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='error_message', full_name='dlt.DltRecordStatus.error_message', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=472, + serialized_end=591, +) + + +_DLTPEERSTATUS = _descriptor.Descriptor( + name='DltPeerStatus', + full_name='dlt.DltPeerStatus', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='controller', full_name='dlt.DltPeerStatus.controller', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='status', full_name='dlt.DltPeerStatus.status', index=1, + number=2, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=593, + serialized_end=693, +) + + +_DLTPEERSTATUSLIST = _descriptor.Descriptor( + name='DltPeerStatusList', + full_name='dlt.DltPeerStatusList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='peers', full_name='dlt.DltPeerStatusList.peers', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=695, + serialized_end=749, +) + +_DLTRECORDID.fields_by_name['domain_uuid'].message_type = context__pb2._UUID +_DLTRECORDID.fields_by_name['type'].enum_type = _DLTRECORDTYPEENUM +_DLTRECORDID.fields_by_name['record_uuid'].message_type = context__pb2._UUID +_DLTRECORD.fields_by_name['record_id'].message_type = _DLTRECORDID +_DLTRECORD.fields_by_name['operation'].enum_type = _DLTRECORDOPERATIONENUM +_DLTRECORDSUBSCRIPTION.fields_by_name['type'].enum_type = _DLTRECORDTYPEENUM +_DLTRECORDSUBSCRIPTION.fields_by_name['operation'].enum_type = _DLTRECORDOPERATIONENUM +_DLTRECORDEVENT.fields_by_name['event'].message_type = context__pb2._EVENT +_DLTRECORDEVENT.fields_by_name['record_id'].message_type = _DLTRECORDID +_DLTRECORDSTATUS.fields_by_name['record_id'].message_type = _DLTRECORDID +_DLTRECORDSTATUS.fields_by_name['status'].enum_type = _DLTRECORDSTATUSENUM +_DLTPEERSTATUS.fields_by_name['controller'].message_type = context__pb2._TERAFLOWCONTROLLER +_DLTPEERSTATUS.fields_by_name['status'].enum_type = _DLTSTATUSENUM +_DLTPEERSTATUSLIST.fields_by_name['peers'].message_type = _DLTPEERSTATUS +DESCRIPTOR.message_types_by_name['DltRecordId'] = _DLTRECORDID +DESCRIPTOR.message_types_by_name['DltRecord'] = _DLTRECORD +DESCRIPTOR.message_types_by_name['DltRecordSubscription'] = _DLTRECORDSUBSCRIPTION +DESCRIPTOR.message_types_by_name['DltRecordEvent'] = _DLTRECORDEVENT +DESCRIPTOR.message_types_by_name['DltRecordStatus'] = _DLTRECORDSTATUS +DESCRIPTOR.message_types_by_name['DltPeerStatus'] = _DLTPEERSTATUS +DESCRIPTOR.message_types_by_name['DltPeerStatusList'] = _DLTPEERSTATUSLIST +DESCRIPTOR.enum_types_by_name['DltRecordTypeEnum'] = _DLTRECORDTYPEENUM +DESCRIPTOR.enum_types_by_name['DltRecordOperationEnum'] = _DLTRECORDOPERATIONENUM +DESCRIPTOR.enum_types_by_name['DltRecordStatusEnum'] = _DLTRECORDSTATUSENUM +DESCRIPTOR.enum_types_by_name['DltStatusEnum'] = _DLTSTATUSENUM +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +DltRecordId = _reflection.GeneratedProtocolMessageType('DltRecordId', (_message.Message,), { + 'DESCRIPTOR' : _DLTRECORDID, + '__module__' : 'dlt_pb2' + # @@protoc_insertion_point(class_scope:dlt.DltRecordId) + }) +_sym_db.RegisterMessage(DltRecordId) + +DltRecord = _reflection.GeneratedProtocolMessageType('DltRecord', (_message.Message,), { + 'DESCRIPTOR' : _DLTRECORD, + '__module__' : 'dlt_pb2' + # @@protoc_insertion_point(class_scope:dlt.DltRecord) + }) +_sym_db.RegisterMessage(DltRecord) + +DltRecordSubscription = _reflection.GeneratedProtocolMessageType('DltRecordSubscription', (_message.Message,), { + 'DESCRIPTOR' : _DLTRECORDSUBSCRIPTION, + '__module__' : 'dlt_pb2' + # @@protoc_insertion_point(class_scope:dlt.DltRecordSubscription) + }) +_sym_db.RegisterMessage(DltRecordSubscription) + +DltRecordEvent = _reflection.GeneratedProtocolMessageType('DltRecordEvent', (_message.Message,), { + 'DESCRIPTOR' : _DLTRECORDEVENT, + '__module__' : 'dlt_pb2' + # @@protoc_insertion_point(class_scope:dlt.DltRecordEvent) + }) +_sym_db.RegisterMessage(DltRecordEvent) + +DltRecordStatus = _reflection.GeneratedProtocolMessageType('DltRecordStatus', (_message.Message,), { + 'DESCRIPTOR' : _DLTRECORDSTATUS, + '__module__' : 'dlt_pb2' + # @@protoc_insertion_point(class_scope:dlt.DltRecordStatus) + }) +_sym_db.RegisterMessage(DltRecordStatus) + +DltPeerStatus = _reflection.GeneratedProtocolMessageType('DltPeerStatus', (_message.Message,), { + 'DESCRIPTOR' : _DLTPEERSTATUS, + '__module__' : 'dlt_pb2' + # @@protoc_insertion_point(class_scope:dlt.DltPeerStatus) + }) +_sym_db.RegisterMessage(DltPeerStatus) + +DltPeerStatusList = _reflection.GeneratedProtocolMessageType('DltPeerStatusList', (_message.Message,), { + 'DESCRIPTOR' : _DLTPEERSTATUSLIST, + '__module__' : 'dlt_pb2' + # @@protoc_insertion_point(class_scope:dlt.DltPeerStatusList) + }) +_sym_db.RegisterMessage(DltPeerStatusList) + + + +_DLTSERVICE = _descriptor.ServiceDescriptor( + name='DltService', + full_name='dlt.DltService', + file=DESCRIPTOR, + index=0, + serialized_options=None, + create_key=_descriptor._internal_create_key, + serialized_start=1369, + serialized_end=1681, + methods=[ + _descriptor.MethodDescriptor( + name='RecordToDlt', + full_name='dlt.DltService.RecordToDlt', + index=0, + containing_service=None, + input_type=_DLTRECORD, + output_type=_DLTRECORDSTATUS, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetFromDlt', + full_name='dlt.DltService.GetFromDlt', + index=1, + containing_service=None, + input_type=_DLTRECORDID, + output_type=_DLTRECORD, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SubscribeToDlt', + full_name='dlt.DltService.SubscribeToDlt', + index=2, + containing_service=None, + input_type=_DLTRECORDSUBSCRIPTION, + output_type=_DLTRECORDEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetDltStatus', + full_name='dlt.DltService.GetDltStatus', + index=3, + containing_service=None, + input_type=context__pb2._TERAFLOWCONTROLLER, + output_type=_DLTPEERSTATUS, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetDltPeers', + full_name='dlt.DltService.GetDltPeers', + index=4, + containing_service=None, + input_type=context__pb2._EMPTY, + output_type=_DLTPEERSTATUSLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), +]) +_sym_db.RegisterServiceDescriptor(_DLTSERVICE) + +DESCRIPTOR.services_by_name['DltService'] = _DLTSERVICE + +# @@protoc_insertion_point(module_scope) diff --git a/src/dlt/connector/proto/dlt_pb2_grpc.py b/src/dlt/connector/proto/dlt_pb2_grpc.py new file mode 100644 index 0000000000000000000000000000000000000000..7419d54289c95b6eddbfbfb0c7b02540ada32a64 --- /dev/null +++ b/src/dlt/connector/proto/dlt_pb2_grpc.py @@ -0,0 +1,199 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc + +from . import context_pb2 as context__pb2 +from . import dlt_pb2 as dlt__pb2 + + +class DltServiceStub(object): + """Missing associated documentation comment in .proto file.""" + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.RecordToDlt = channel.unary_unary( + '/dlt.DltService/RecordToDlt', + request_serializer=dlt__pb2.DltRecord.SerializeToString, + response_deserializer=dlt__pb2.DltRecordStatus.FromString, + ) + self.GetFromDlt = channel.unary_unary( + '/dlt.DltService/GetFromDlt', + request_serializer=dlt__pb2.DltRecordId.SerializeToString, + response_deserializer=dlt__pb2.DltRecord.FromString, + ) + self.SubscribeToDlt = channel.unary_stream( + '/dlt.DltService/SubscribeToDlt', + request_serializer=dlt__pb2.DltRecordSubscription.SerializeToString, + response_deserializer=dlt__pb2.DltRecordEvent.FromString, + ) + self.GetDltStatus = channel.unary_unary( + '/dlt.DltService/GetDltStatus', + request_serializer=context__pb2.TeraFlowController.SerializeToString, + response_deserializer=dlt__pb2.DltPeerStatus.FromString, + ) + self.GetDltPeers = channel.unary_unary( + '/dlt.DltService/GetDltPeers', + request_serializer=context__pb2.Empty.SerializeToString, + response_deserializer=dlt__pb2.DltPeerStatusList.FromString, + ) + + +class DltServiceServicer(object): + """Missing associated documentation comment in .proto file.""" + + def RecordToDlt(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetFromDlt(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def SubscribeToDlt(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetDltStatus(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetDltPeers(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_DltServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + 'RecordToDlt': grpc.unary_unary_rpc_method_handler( + servicer.RecordToDlt, + request_deserializer=dlt__pb2.DltRecord.FromString, + response_serializer=dlt__pb2.DltRecordStatus.SerializeToString, + ), + 'GetFromDlt': grpc.unary_unary_rpc_method_handler( + servicer.GetFromDlt, + request_deserializer=dlt__pb2.DltRecordId.FromString, + response_serializer=dlt__pb2.DltRecord.SerializeToString, + ), + 'SubscribeToDlt': grpc.unary_stream_rpc_method_handler( + servicer.SubscribeToDlt, + request_deserializer=dlt__pb2.DltRecordSubscription.FromString, + response_serializer=dlt__pb2.DltRecordEvent.SerializeToString, + ), + 'GetDltStatus': grpc.unary_unary_rpc_method_handler( + servicer.GetDltStatus, + request_deserializer=context__pb2.TeraFlowController.FromString, + response_serializer=dlt__pb2.DltPeerStatus.SerializeToString, + ), + 'GetDltPeers': grpc.unary_unary_rpc_method_handler( + servicer.GetDltPeers, + request_deserializer=context__pb2.Empty.FromString, + response_serializer=dlt__pb2.DltPeerStatusList.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'dlt.DltService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + + + # This class is part of an EXPERIMENTAL API. +class DltService(object): + """Missing associated documentation comment in .proto file.""" + + @staticmethod + def RecordToDlt(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/dlt.DltService/RecordToDlt', + dlt__pb2.DltRecord.SerializeToString, + dlt__pb2.DltRecordStatus.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def GetFromDlt(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/dlt.DltService/GetFromDlt', + dlt__pb2.DltRecordId.SerializeToString, + dlt__pb2.DltRecord.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def SubscribeToDlt(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_stream(request, target, '/dlt.DltService/SubscribeToDlt', + dlt__pb2.DltRecordSubscription.SerializeToString, + dlt__pb2.DltRecordEvent.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def GetDltStatus(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/dlt.DltService/GetDltStatus', + context__pb2.TeraFlowController.SerializeToString, + dlt__pb2.DltPeerStatus.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def GetDltPeers(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/dlt.DltService/GetDltPeers', + context__pb2.Empty.SerializeToString, + dlt__pb2.DltPeerStatusList.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/src/dlt/connector/proto/kpi_sample_types_pb2.py b/src/dlt/connector/proto/kpi_sample_types_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..ea7fd2f82757d4c3db02d7e2c7817e2787b0b490 --- /dev/null +++ b/src/dlt/connector/proto/kpi_sample_types_pb2.py @@ -0,0 +1,78 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: kpi_sample_types.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='kpi_sample_types.proto', + package='kpi_sample_types', + syntax='proto3', + serialized_options=None, + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n\x16kpi_sample_types.proto\x12\x10kpi_sample_types*\xbe\x01\n\rKpiSampleType\x12\x19\n\x15KPISAMPLETYPE_UNKNOWN\x10\x00\x12%\n!KPISAMPLETYPE_PACKETS_TRANSMITTED\x10\x65\x12\"\n\x1eKPISAMPLETYPE_PACKETS_RECEIVED\x10\x66\x12$\n\x1fKPISAMPLETYPE_BYTES_TRANSMITTED\x10\xc9\x01\x12!\n\x1cKPISAMPLETYPE_BYTES_RECEIVED\x10\xca\x01\x62\x06proto3' +) + +_KPISAMPLETYPE = _descriptor.EnumDescriptor( + name='KpiSampleType', + full_name='kpi_sample_types.KpiSampleType', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='KPISAMPLETYPE_UNKNOWN', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='KPISAMPLETYPE_PACKETS_TRANSMITTED', index=1, number=101, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='KPISAMPLETYPE_PACKETS_RECEIVED', index=2, number=102, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='KPISAMPLETYPE_BYTES_TRANSMITTED', index=3, number=201, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='KPISAMPLETYPE_BYTES_RECEIVED', index=4, number=202, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=45, + serialized_end=235, +) +_sym_db.RegisterEnumDescriptor(_KPISAMPLETYPE) + +KpiSampleType = enum_type_wrapper.EnumTypeWrapper(_KPISAMPLETYPE) +KPISAMPLETYPE_UNKNOWN = 0 +KPISAMPLETYPE_PACKETS_TRANSMITTED = 101 +KPISAMPLETYPE_PACKETS_RECEIVED = 102 +KPISAMPLETYPE_BYTES_TRANSMITTED = 201 +KPISAMPLETYPE_BYTES_RECEIVED = 202 + + +DESCRIPTOR.enum_types_by_name['KpiSampleType'] = _KPISAMPLETYPE +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + + +# @@protoc_insertion_point(module_scope) diff --git a/src/dlt/connector/service/__init__.py b/src/dlt/connector/service/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/dlt/connector/service/__init__.py @@ -0,0 +1,14 @@ +# 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. + diff --git a/src/dlt/connector/tests/__init__.py b/src/dlt/connector/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/dlt/connector/tests/__init__.py @@ -0,0 +1,14 @@ +# 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. + diff --git a/src/dlt/.gitignore b/src/dlt/gateway/.gitignore similarity index 100% rename from src/dlt/.gitignore rename to src/dlt/gateway/.gitignore diff --git a/src/dlt/README.md b/src/dlt/gateway/README.md similarity index 100% rename from src/dlt/README.md rename to src/dlt/gateway/README.md diff --git a/src/dlt/build.gradle.kts b/src/dlt/gateway/build.gradle.kts similarity index 100% rename from src/dlt/build.gradle.kts rename to src/dlt/gateway/build.gradle.kts diff --git a/src/dlt/gateway/config/ca.org1.example.com-cert.pem b/src/dlt/gateway/config/ca.org1.example.com-cert.pem new file mode 100644 index 0000000000000000000000000000000000000000..5287a0f2bada9649c0d2ddd8eb8a71b2dac10df7 --- /dev/null +++ b/src/dlt/gateway/config/ca.org1.example.com-cert.pem @@ -0,0 +1,14 @@ +-----BEGIN CERTIFICATE----- +MIICJjCCAc2gAwIBAgIUWZ4l32loO9+FM0FYw61y3dUF5a0wCgYIKoZIzj0EAwIw +cDELMAkGA1UEBhMCVVMxFzAVBgNVBAgTDk5vcnRoIENhcm9saW5hMQ8wDQYDVQQH +EwZEdXJoYW0xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh +Lm9yZzEuZXhhbXBsZS5jb20wHhcNMjIwNzA1MDk0NDAwWhcNMzcwNzAxMDk0NDAw +WjBwMQswCQYDVQQGEwJVUzEXMBUGA1UECBMOTm9ydGggQ2Fyb2xpbmExDzANBgNV +BAcTBkR1cmhhbTEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEcMBoGA1UEAxMT +Y2Eub3JnMS5leGFtcGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABNPg +yfDxHr4ZmFp3HB19f27vfc1YTKBnznLqIFwVad2Y+eXfni8DnTRNGgwdkG9uIK2L +4Y9mwlKG/mTNx629G4GjRTBDMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAG +AQH/AgEBMB0GA1UdDgQWBBSZlT6qe+DAGpEBXyMxzidqCkQ4PjAKBggqhkjOPQQD +AgNHADBEAiAIG5jwBGddB9CwocmjAzFv8+e7+0bvNSwjrG229QogTgIgbTNoC33P +mbR5ChlkUAW2t41hTOCSMIwLAlvEwpeCnAk= +-----END CERTIFICATE----- diff --git a/src/dlt/config/connection-org1.json b/src/dlt/gateway/config/connection-org1.json similarity index 59% rename from src/dlt/config/connection-org1.json rename to src/dlt/gateway/config/connection-org1.json index c28ac57118e8695375187eaf103f1f499f2cf301..320a20806650edaea9de45d0e208bc2b8dea12f0 100644 --- a/src/dlt/config/connection-org1.json +++ b/src/dlt/gateway/config/connection-org1.json @@ -26,7 +26,7 @@ "peer0.org1.example.com": { "url": "grpcs://s2:7051", "tlsCACerts": { - "pem": "-----BEGIN CERTIFICATE-----\nMIICJjCCAc2gAwIBAgIULDVQiqifWHypuW50LhHXSJeeFG0wCgYIKoZIzj0EAwIw\ncDELMAkGA1UEBhMCVVMxFzAVBgNVBAgTDk5vcnRoIENhcm9saW5hMQ8wDQYDVQQH\nEwZEdXJoYW0xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh\nLm9yZzEuZXhhbXBsZS5jb20wHhcNMjExMTIzMTIzNzAwWhcNMzYxMTE5MTIzNzAw\nWjBwMQswCQYDVQQGEwJVUzEXMBUGA1UECBMOTm9ydGggQ2Fyb2xpbmExDzANBgNV\nBAcTBkR1cmhhbTEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEcMBoGA1UEAxMT\nY2Eub3JnMS5leGFtcGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABFNi\nggnkzv5qQSkIAQ05Y9DUq4teNjbMTdqD0IwdQe+lcYI0wgkR9wpBn5fj2pN093+P\nl2crhgyNqZyAuqaylvCjRTBDMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAG\nAQH/AgEBMB0GA1UdDgQWBBS44tGlbJ5GIBwATL383Hw0vz8jHDAKBggqhkjOPQQD\nAgNHADBEAiAlkKikh7eG8lf0uI7NwBi0QrbnnY4vHf9ErceKwUhZWgIgS9Z9AzBc\nn9RAK3v/freT3Exs7b+MK13UeDdejRWS+RE=\n-----END CERTIFICATE-----\n" + "pem": "-----BEGIN CERTIFICATE-----\nMIICJjCCAc2gAwIBAgIUWZ4l32loO9+FM0FYw61y3dUF5a0wCgYIKoZIzj0EAwIw\ncDELMAkGA1UEBhMCVVMxFzAVBgNVBAgTDk5vcnRoIENhcm9saW5hMQ8wDQYDVQQH\nEwZEdXJoYW0xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh\nLm9yZzEuZXhhbXBsZS5jb20wHhcNMjIwNzA1MDk0NDAwWhcNMzcwNzAxMDk0NDAw\nWjBwMQswCQYDVQQGEwJVUzEXMBUGA1UECBMOTm9ydGggQ2Fyb2xpbmExDzANBgNV\nBAcTBkR1cmhhbTEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEcMBoGA1UEAxMT\nY2Eub3JnMS5leGFtcGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABNPg\nyfDxHr4ZmFp3HB19f27vfc1YTKBnznLqIFwVad2Y+eXfni8DnTRNGgwdkG9uIK2L\n4Y9mwlKG/mTNx629G4GjRTBDMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAG\nAQH/AgEBMB0GA1UdDgQWBBSZlT6qe+DAGpEBXyMxzidqCkQ4PjAKBggqhkjOPQQD\nAgNHADBEAiAIG5jwBGddB9CwocmjAzFv8+e7+0bvNSwjrG229QogTgIgbTNoC33P\nmbR5ChlkUAW2t41hTOCSMIwLAlvEwpeCnAk=\n-----END CERTIFICATE-----\n" }, "grpcOptions": { "ssl-target-name-override": "peer0.org1.example.com", @@ -36,7 +36,7 @@ "peer0.org2.example.com": { "url": "grpcs://s2:9051", "tlsCACerts": { - "pem": "-----BEGIN CERTIFICATE-----\nMIICHzCCAcWgAwIBAgIUJiJ5815YVes2sG95oFzj0QWWBKswCgYIKoZIzj0EAwIw\nbDELMAkGA1UEBhMCVUsxEjAQBgNVBAgTCUhhbXBzaGlyZTEQMA4GA1UEBxMHSHVy\nc2xleTEZMBcGA1UEChMQb3JnMi5leGFtcGxlLmNvbTEcMBoGA1UEAxMTY2Eub3Jn\nMi5leGFtcGxlLmNvbTAeFw0yMTExMjMxMjM3MDBaFw0zNjExMTkxMjM3MDBaMGwx\nCzAJBgNVBAYTAlVLMRIwEAYDVQQIEwlIYW1wc2hpcmUxEDAOBgNVBAcTB0h1cnNs\nZXkxGTAXBgNVBAoTEG9yZzIuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2NhLm9yZzIu\nZXhhbXBsZS5jb20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAATdQw+PQyT3Ql5M\nv/xvafYFhU5Jtl0CwYyrXTtRajpPnlPnNvXUqVMxmdSR+4m2WBYyBdZ8IhGaayb/\nrOro8Mpko0UwQzAOBgNVHQ8BAf8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBATAd\nBgNVHQ4EFgQUrsPP1HIS6O+JeWL2ct/ujkfP7dEwCgYIKoZIzj0EAwIDSAAwRQIh\nAMynA2Q/cbMXEHihnQdpdEz/83jGAokp7dKMHst02b3gAiA0XReJWdc0AUXZtbSq\nZG8mXOJeZu0Zro9DuQUEDPBfDQ==\n-----END CERTIFICATE-----\n" + "pem": "-----BEGIN CERTIFICATE-----\nMIICHzCCAcWgAwIBAgIUejv57h6dJkVIM2R1YnlqykkvG7gwCgYIKoZIzj0EAwIw\nbDELMAkGA1UEBhMCVUsxEjAQBgNVBAgTCUhhbXBzaGlyZTEQMA4GA1UEBxMHSHVy\nc2xleTEZMBcGA1UEChMQb3JnMi5leGFtcGxlLmNvbTEcMBoGA1UEAxMTY2Eub3Jn\nMi5leGFtcGxlLmNvbTAeFw0yMjA3MDUwOTQ0MDBaFw0zNzA3MDEwOTQ0MDBaMGwx\nCzAJBgNVBAYTAlVLMRIwEAYDVQQIEwlIYW1wc2hpcmUxEDAOBgNVBAcTB0h1cnNs\nZXkxGTAXBgNVBAoTEG9yZzIuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2NhLm9yZzIu\nZXhhbXBsZS5jb20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAASFZqoisCIgZyMM\n8e0YBA+jxH/+Fc4Y4OkEl5uGRXGl9s0OemCdvhlX9K+esX2DVk1st1PMfTEj/six\n9XPpVqzNo0UwQzAOBgNVHQ8BAf8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBATAd\nBgNVHQ4EFgQUPEyzGBlZEjguoJB16wAmoH2bAh8wCgYIKoZIzj0EAwIDSAAwRQIh\nAL6DAWgrqRtbYoQ0oYAr/2vze0JtQcXoqiQKlyvYkUBbAiB/uSHBk3NwjzI8t8iW\nzQzr5eNy5JwOO0SWwPEv4Ev9iQ==\n-----END CERTIFICATE-----\n" }, "grpcOptions": { "ssl-target-name-override": "peer0.org2.example.com", @@ -50,7 +50,7 @@ "caName": "ca-org1", "tlsCACerts": { "pem": [ - "-----BEGIN CERTIFICATE-----\nMIICJjCCAc2gAwIBAgIULDVQiqifWHypuW50LhHXSJeeFG0wCgYIKoZIzj0EAwIw\ncDELMAkGA1UEBhMCVVMxFzAVBgNVBAgTDk5vcnRoIENhcm9saW5hMQ8wDQYDVQQH\nEwZEdXJoYW0xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh\nLm9yZzEuZXhhbXBsZS5jb20wHhcNMjExMTIzMTIzNzAwWhcNMzYxMTE5MTIzNzAw\nWjBwMQswCQYDVQQGEwJVUzEXMBUGA1UECBMOTm9ydGggQ2Fyb2xpbmExDzANBgNV\nBAcTBkR1cmhhbTEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEcMBoGA1UEAxMT\nY2Eub3JnMS5leGFtcGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABFNi\nggnkzv5qQSkIAQ05Y9DUq4teNjbMTdqD0IwdQe+lcYI0wgkR9wpBn5fj2pN093+P\nl2crhgyNqZyAuqaylvCjRTBDMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAG\nAQH/AgEBMB0GA1UdDgQWBBS44tGlbJ5GIBwATL383Hw0vz8jHDAKBggqhkjOPQQD\nAgNHADBEAiAlkKikh7eG8lf0uI7NwBi0QrbnnY4vHf9ErceKwUhZWgIgS9Z9AzBc\nn9RAK3v/freT3Exs7b+MK13UeDdejRWS+RE=\n-----END CERTIFICATE-----\n" + "-----BEGIN CERTIFICATE-----\nMIICJjCCAc2gAwIBAgIUWZ4l32loO9+FM0FYw61y3dUF5a0wCgYIKoZIzj0EAwIw\ncDELMAkGA1UEBhMCVVMxFzAVBgNVBAgTDk5vcnRoIENhcm9saW5hMQ8wDQYDVQQH\nEwZEdXJoYW0xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh\nLm9yZzEuZXhhbXBsZS5jb20wHhcNMjIwNzA1MDk0NDAwWhcNMzcwNzAxMDk0NDAw\nWjBwMQswCQYDVQQGEwJVUzEXMBUGA1UECBMOTm9ydGggQ2Fyb2xpbmExDzANBgNV\nBAcTBkR1cmhhbTEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEcMBoGA1UEAxMT\nY2Eub3JnMS5leGFtcGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABNPg\nyfDxHr4ZmFp3HB19f27vfc1YTKBnznLqIFwVad2Y+eXfni8DnTRNGgwdkG9uIK2L\n4Y9mwlKG/mTNx629G4GjRTBDMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAG\nAQH/AgEBMB0GA1UdDgQWBBSZlT6qe+DAGpEBXyMxzidqCkQ4PjAKBggqhkjOPQQD\nAgNHADBEAiAIG5jwBGddB9CwocmjAzFv8+e7+0bvNSwjrG229QogTgIgbTNoC33P\nmbR5ChlkUAW2t41hTOCSMIwLAlvEwpeCnAk=\n-----END CERTIFICATE-----\n" ] }, "httpOptions": { @@ -62,7 +62,7 @@ "orderer0.example.com": { "url": "grpcs://s2:7050", "tlsCACerts": { - "pem": "-----BEGIN CERTIFICATE-----\nMIICCzCCAbGgAwIBAgIUDr4RiMRC/q95iWAfWiZTLTdDoDUwCgYIKoZIzj0EAwIw\nYjELMAkGA1UEBhMCVVMxETAPBgNVBAgTCE5ldyBZb3JrMREwDwYDVQQHEwhOZXcg\nWW9yazEUMBIGA1UEChMLZXhhbXBsZS5jb20xFzAVBgNVBAMTDmNhLmV4YW1wbGUu\nY29tMB4XDTIxMTEyMzEyMzcwMFoXDTM2MTExOTEyMzcwMFowYjELMAkGA1UEBhMC\nVVMxETAPBgNVBAgTCE5ldyBZb3JrMREwDwYDVQQHEwhOZXcgWW9yazEUMBIGA1UE\nChMLZXhhbXBsZS5jb20xFzAVBgNVBAMTDmNhLmV4YW1wbGUuY29tMFkwEwYHKoZI\nzj0CAQYIKoZIzj0DAQcDQgAE4ErISW/k5iZv0n7n1qpbOZcRMNmn8VqAOX4UIELm\nQ51neULt9T3pxdGEsq7B5O1ncB/RdZwf+3dihBHjngXerKNFMEMwDgYDVR0PAQH/\nBAQDAgEGMBIGA1UdEwEB/wQIMAYBAf8CAQEwHQYDVR0OBBYEFP2/1CHK9OdPjs/9\np1mh3t+pyujsMAoGCCqGSM49BAMCA0gAMEUCIQDETOC8hB9EaEvdc2sdEtcNeyXu\nYryyf6I5tJC13E2hOQIgef+ymHy6eXf0jNkY6DXz041THa/67dSrXaZGgaTh4LI=\n-----END CERTIFICATE-----\n" + "pem": "-----BEGIN CERTIFICATE-----\nMIICCjCCAbGgAwIBAgIURV0KgZTOagIAIU7wRcSg/mKl5RUwCgYIKoZIzj0EAwIw\nYjELMAkGA1UEBhMCVVMxETAPBgNVBAgTCE5ldyBZb3JrMREwDwYDVQQHEwhOZXcg\nWW9yazEUMBIGA1UEChMLZXhhbXBsZS5jb20xFzAVBgNVBAMTDmNhLmV4YW1wbGUu\nY29tMB4XDTIyMDcwNTA5NDQwMFoXDTM3MDcwMTA5NDQwMFowYjELMAkGA1UEBhMC\nVVMxETAPBgNVBAgTCE5ldyBZb3JrMREwDwYDVQQHEwhOZXcgWW9yazEUMBIGA1UE\nChMLZXhhbXBsZS5jb20xFzAVBgNVBAMTDmNhLmV4YW1wbGUuY29tMFkwEwYHKoZI\nzj0CAQYIKoZIzj0DAQcDQgAEWrOugtJgVLAKZRw9jaC15RUbVuTm0ZmsqNyiQrKQ\nYawLE6fs+QIU7WQ25fxlYtmGB2S8nofGCDuwaoTevW0GoaNFMEMwDgYDVR0PAQH/\nBAQDAgEGMBIGA1UdEwEB/wQIMAYBAf8CAQEwHQYDVR0OBBYEFLKBzGXaQg2Irr57\npjoFYZ9F1NoNMAoGCCqGSM49BAMCA0cAMEQCIB1YdgOEsATw2GeaFmq6nqWg0JDT\np456JB/reFmnPWdJAiBPo5H9sMh+MpP4R5ue7nuwYK7SEJ1DOJqWMlPuNhVgtA==\n-----END CERTIFICATE-----\n" }, "grpcOptions": { "ssl-target-name-override": "orderer0.example.com", diff --git a/src/dlt/gradle.properties b/src/dlt/gateway/gradle.properties similarity index 100% rename from src/dlt/gradle.properties rename to src/dlt/gateway/gradle.properties diff --git a/src/dlt/gradle/wrapper/gradle-wrapper.jar b/src/dlt/gateway/gradle/wrapper/gradle-wrapper.jar similarity index 100% rename from src/dlt/gradle/wrapper/gradle-wrapper.jar rename to src/dlt/gateway/gradle/wrapper/gradle-wrapper.jar diff --git a/src/dlt/gradle/wrapper/gradle-wrapper.properties b/src/dlt/gateway/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from src/dlt/gradle/wrapper/gradle-wrapper.properties rename to src/dlt/gateway/gradle/wrapper/gradle-wrapper.properties diff --git a/src/dlt/gradlew b/src/dlt/gateway/gradlew similarity index 100% rename from src/dlt/gradlew rename to src/dlt/gateway/gradlew diff --git a/src/dlt/gradlew.bat b/src/dlt/gateway/gradlew.bat similarity index 100% rename from src/dlt/gradlew.bat rename to src/dlt/gateway/gradlew.bat diff --git a/src/dlt/settings.gradle.kts b/src/dlt/gateway/settings.gradle.kts similarity index 100% rename from src/dlt/settings.gradle.kts rename to src/dlt/gateway/settings.gradle.kts diff --git a/src/dlt/src/main/kotlin/Main.kt b/src/dlt/gateway/src/main/kotlin/Main.kt similarity index 97% rename from src/dlt/src/main/kotlin/Main.kt rename to src/dlt/gateway/src/main/kotlin/Main.kt index d6298cc2890a8cec8ea9af4a05bbabb5ab8f3b4d..68a820ee9feb622a5f3d8429dd56b905b0e1a1b4 100644 --- a/src/dlt/src/main/kotlin/Main.kt +++ b/src/dlt/gateway/src/main/kotlin/Main.kt @@ -125,8 +125,7 @@ suspend fun main(args: Array<String>) { } try { - val newRecord = Config.DltRecord.newBuilder().setId(id).setOperation(Config.DltRecordOperation.DISABLE) - .setType(Config.DltRecordType.SLICE).setJson("{}").build() + val newRecord = Config.DltRecord.newBuilder().setId(id).setOperation(Config.DltRecordOperation.DISABLE).build() val result = client.post<ByteArray>("http://localhost:8080/dlt/record") { body = newRecord.toByteArray() } diff --git a/src/dlt/src/main/kotlin/fabric/ConnectGateway.kt b/src/dlt/gateway/src/main/kotlin/fabric/ConnectGateway.kt similarity index 100% rename from src/dlt/src/main/kotlin/fabric/ConnectGateway.kt rename to src/dlt/gateway/src/main/kotlin/fabric/ConnectGateway.kt diff --git a/src/dlt/src/main/kotlin/fabric/EnrollAdmin.kt b/src/dlt/gateway/src/main/kotlin/fabric/EnrollAdmin.kt similarity index 100% rename from src/dlt/src/main/kotlin/fabric/EnrollAdmin.kt rename to src/dlt/gateway/src/main/kotlin/fabric/EnrollAdmin.kt diff --git a/src/dlt/src/main/kotlin/fabric/FabricConnector.kt b/src/dlt/gateway/src/main/kotlin/fabric/FabricConnector.kt similarity index 90% rename from src/dlt/src/main/kotlin/fabric/FabricConnector.kt rename to src/dlt/gateway/src/main/kotlin/fabric/FabricConnector.kt index 0918f59e1f616af4deae3835cc2f48ae6c932902..d7c163954ec4f1b63b5e646e714d493050e114c0 100644 --- a/src/dlt/src/main/kotlin/fabric/FabricConnector.kt +++ b/src/dlt/gateway/src/main/kotlin/fabric/FabricConnector.kt @@ -38,6 +38,7 @@ package fabric import org.hyperledger.fabric.gateway.Contract +import org.hyperledger.fabric.gateway.ContractEvent import org.hyperledger.fabric.gateway.Wallet import org.hyperledger.fabric.gateway.Wallets import org.hyperledger.fabric.sdk.security.CryptoSuiteFactory @@ -45,6 +46,7 @@ import org.hyperledger.fabric_ca.sdk.HFCAClient import proto.Config import java.nio.file.Paths import java.util.* +import java.util.function.Consumer class FabricConnector(val config: Config.DltConfig) { private val caClient: HFCAClient @@ -63,6 +65,7 @@ class FabricConnector(val config: Config.DltConfig) { // Create a wallet for managing identities wallet = Wallets.newFileSystemWallet(Paths.get(config.wallet)) contract = connect() + subscribeForEvents() } fun connect(): Contract { @@ -102,4 +105,13 @@ class FabricConnector(val config: Config.DltConfig) { fun deleteData(uuid: String): String { return String(contract.submitTransaction("DeactivateRecord", uuid)) } + + private fun subscribeForEvents() { + val consumer = Consumer { + event: ContractEvent? -> run { + println(event?.payload?.get()?.let { String(it) }) + } + } + contract.addContractListener(consumer) + } } \ No newline at end of file diff --git a/src/dlt/src/main/kotlin/fabric/RegisterUser.kt b/src/dlt/gateway/src/main/kotlin/fabric/RegisterUser.kt similarity index 100% rename from src/dlt/src/main/kotlin/fabric/RegisterUser.kt rename to src/dlt/gateway/src/main/kotlin/fabric/RegisterUser.kt diff --git a/src/dlt/src/main/kotlin/http/Server.kt b/src/dlt/gateway/src/main/kotlin/http/Server.kt similarity index 100% rename from src/dlt/src/main/kotlin/http/Server.kt rename to src/dlt/gateway/src/main/kotlin/http/Server.kt diff --git a/src/dlt/src/main/kotlin/proto/Config.proto b/src/dlt/gateway/src/main/kotlin/proto/Config.proto similarity index 100% rename from src/dlt/src/main/kotlin/proto/Config.proto rename to src/dlt/gateway/src/main/kotlin/proto/Config.proto diff --git a/src/interdomain/.gitlab-ci.yml b/src/interdomain/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..a91f9e4edb8cae14029897df3aafa2b6f1bea3a9 --- /dev/null +++ b/src/interdomain/.gitlab-ci.yml @@ -0,0 +1,102 @@ +# 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. + +# Build, tag and push the Docker image to the GitLab registry +build service: + variables: + IMAGE_NAME: 'service' # name of the microservice + IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) + stage: build + before_script: + - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY + script: + - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile ./src/ + - docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" + - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" + after_script: + - docker images --filter="dangling=true" --quiet | xargs -r docker rmi + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - changes: + - src/$IMAGE_NAME/**/*.{py,in,yml} + - src/$IMAGE_NAME/Dockerfile + - src/$IMAGE_NAME/tests/*.py + - manifests/${IMAGE_NAME}service.yaml + - .gitlab-ci.yml + +# Apply unit test to the component +unit test service: + variables: + IMAGE_NAME: 'service' # name of the microservice + IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) + stage: unit_test + needs: + - build service + before_script: + - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY + - if docker network list | grep teraflowbridge; then echo "teraflowbridge is already created"; else docker network create -d bridge teraflowbridge; fi + - if docker container ls | grep $IMAGE_NAME; then docker rm -f $IMAGE_NAME; else echo "$IMAGE_NAME image is not in the system"; fi + script: + - docker pull "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" + - docker run --name $IMAGE_NAME -d -p 3030:3030 -v "$PWD/src/$IMAGE_NAME/tests:/opt/results" --network=teraflowbridge $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG + - sleep 5 + - docker ps -a + - docker logs $IMAGE_NAME + - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml" + - docker exec -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing" + coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' + after_script: + - docker rm -f $IMAGE_NAME + - docker network rm teraflowbridge + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - changes: + - src/$IMAGE_NAME/**/*.{py,in,yml} + - src/$IMAGE_NAME/Dockerfile + - src/$IMAGE_NAME/tests/*.py + - src/$IMAGE_NAME/tests/Dockerfile + - manifests/${IMAGE_NAME}service.yaml + - .gitlab-ci.yml + artifacts: + when: always + reports: + junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml + +# Deployment of the service in Kubernetes Cluster +deploy service: + variables: + IMAGE_NAME: 'service' # name of the microservice + IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) + stage: deploy + needs: + - unit test service + # - integ_test execute + script: + - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/${IMAGE_NAME}service.yaml' + - kubectl version + - kubectl get all + - kubectl apply -f "manifests/${IMAGE_NAME}service.yaml" + - kubectl get all + # environment: + # name: test + # url: https://example.com + # kubernetes: + # namespace: test + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + when: manual + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + when: manual diff --git a/src/interdomain/Config.py b/src/interdomain/Config.py new file mode 100644 index 0000000000000000000000000000000000000000..ee5cd04118354f4ad2fb36d04eb507aae2412190 --- /dev/null +++ b/src/interdomain/Config.py @@ -0,0 +1,33 @@ +# 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. + +import logging + +# General settings +LOG_LEVEL = logging.WARNING + +# gRPC settings +GRPC_SERVICE_PORT = 10010 +GRPC_MAX_WORKERS = 10 +GRPC_GRACE_PERIOD = 60 + +# Prometheus settings +METRICS_PORT = 9192 + +# Dependency micro-service connection settings +CONTEXT_SERVICE_HOST = '127.0.0.1' +CONTEXT_SERVICE_PORT = 1010 + +SLICE_SERVICE_HOST = '127.0.0.1' +SLICE_SERVICE_PORT = 4040 diff --git a/src/interdomain/Dockerfile b/src/interdomain/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..35c7dbeba4f7c7fb2cbcd8fbc479ba51a7c8dbcd --- /dev/null +++ b/src/interdomain/Dockerfile @@ -0,0 +1,54 @@ +# 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. + +FROM python:3-slim + +# Install dependencies +RUN apt-get --yes --quiet --quiet update && \ + apt-get --yes --quiet --quiet install wget g++ && \ + rm -rf /var/lib/apt/lists/* + +# Set Python to show logs as they occur +ENV PYTHONUNBUFFERED=0 + +# Download the gRPC health probe +RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \ + wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \ + chmod +x /bin/grpc_health_probe + +# Get generic Python packages +RUN python3 -m pip install --upgrade pip setuptools wheel pip-tools + +# Set working directory +WORKDIR /var/teraflow + +# Create module sub-folders +RUN mkdir -p /var/teraflow/interdomain + +# Get Python packages per module +COPY interdomain/requirements.in interdomain/requirements.in +RUN pip-compile --output-file=interdomain/requirements.txt interdomain/requirements.in +RUN python3 -m pip install -r interdomain/requirements.txt + +# Add files into working directory +COPY common/. common +COPY context/. context +COPY device/. device +COPY interdomain/. interdomain +COPY monitoring/. monitoring +COPY service/. service +COPY slice/. slice + +# Start interdomain service +ENTRYPOINT ["python", "-m", "interdomain.service"] diff --git a/src/interdomain/__init__.py b/src/interdomain/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/interdomain/__init__.py @@ -0,0 +1,14 @@ +# 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. + diff --git a/src/interdomain/client/InterdomainClient.py b/src/interdomain/client/InterdomainClient.py new file mode 100644 index 0000000000000000000000000000000000000000..a34f31537e2dab3747c5499c640b0b73a4392cf9 --- /dev/null +++ b/src/interdomain/client/InterdomainClient.py @@ -0,0 +1,81 @@ +# 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. + +import grpc, logging +from common.Constants import ServiceNameEnum +from common.Settings import get_service_host, get_service_port_grpc +from common.tools.client.RetryDecorator import retry, delay_exponential +from common.tools.grpc.Tools import grpc_message_to_json_string +from interdomain.proto.context_pb2 import AuthenticationResult, Slice, SliceId, SliceStatus, TeraFlowController +from interdomain.proto.interdomain_pb2_grpc import InterdomainServiceStub + +LOGGER = logging.getLogger(__name__) +MAX_RETRIES = 15 +DELAY_FUNCTION = delay_exponential(initial=0.01, increment=2.0, maximum=5.0) +RETRY_DECORATOR = retry(max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + +class InterdomainClient: + def __init__(self, host=None, port=None): + if not host: host = get_service_host(ServiceNameEnum.INTERDOMAIN) + if not port: port = get_service_port_grpc(ServiceNameEnum.INTERDOMAIN) + self.endpoint = '{:s}:{:s}'.format(str(host), str(port)) + LOGGER.debug('Creating channel to {:s}...'.format(self.endpoint)) + self.channel = None + self.stub = None + self.connect() + LOGGER.debug('Channel created') + + def connect(self): + self.channel = grpc.insecure_channel(self.endpoint) + self.stub = InterdomainServiceStub(self.channel) + + def close(self): + if self.channel is not None: self.channel.close() + self.channel = None + self.stub = None + + @RETRY_DECORATOR + def RequestSlice(self, request : Slice) -> SliceId: + LOGGER.debug('RequestSlice request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.RequestSlice(request) + LOGGER.debug('RequestSlice result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def Authenticate(self, request : TeraFlowController) -> AuthenticationResult: + LOGGER.debug('Authenticate request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.Authenticate(request) + LOGGER.debug('Authenticate result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def LookUpSlice(self, request : Slice) -> SliceId: + LOGGER.debug('LookUpSlice request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.LookUpSlice(request) + LOGGER.debug('LookUpSlice result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def OrderSliceFromCatalog(self, request : Slice) -> SliceStatus: + LOGGER.debug('OrderSliceFromCatalog request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.OrderSliceFromCatalog(request) + LOGGER.debug('OrderSliceFromCatalog result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def CreateSliceAndAddToCatalog(self, request : Slice) -> SliceStatus: + LOGGER.debug('CreateSliceAndAddToCatalog request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.CreateSliceAndAddToCatalog(request) + LOGGER.debug('CreateSliceAndAddToCatalog result: {:s}'.format(grpc_message_to_json_string(response))) + return response diff --git a/src/interdomain/client/__init__.py b/src/interdomain/client/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/interdomain/client/__init__.py @@ -0,0 +1,14 @@ +# 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. + diff --git a/src/interdomain/genproto.sh b/src/interdomain/genproto.sh new file mode 100755 index 0000000000000000000000000000000000000000..908b7aed683608673068dc0bebf60763691e933f --- /dev/null +++ b/src/interdomain/genproto.sh @@ -0,0 +1,52 @@ +#!/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) + +rm -rf proto/*.py +rm -rf proto/__pycache__ +tee proto/__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 + +python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto context.proto +python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto kpi_sample_types.proto +python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto interdomain.proto +python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto slice.proto + +rm proto/context_pb2_grpc.py +rm proto/kpi_sample_types_pb2_grpc.py +rm proto/slice_pb2_grpc.py + +sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/context_pb2.py +sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/kpi_sample_types_pb2.py +sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/interdomain_pb2.py +sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/interdomain_pb2_grpc.py +sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/slice_pb2.py diff --git a/src/interdomain/proto/__init__.py b/src/interdomain/proto/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/interdomain/proto/__init__.py @@ -0,0 +1,14 @@ +# 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. + diff --git a/src/interdomain/proto/context_pb2.py b/src/interdomain/proto/context_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..50d501d3ac053ad644554331af26e3c40cd426a1 --- /dev/null +++ b/src/interdomain/proto/context_pb2.py @@ -0,0 +1,3071 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: context.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from . import kpi_sample_types_pb2 as kpi__sample__types__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='context.proto', + package='context', + syntax='proto3', + serialized_options=None, + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n\rcontext.proto\x12\x07\x63ontext\x1a\x16kpi_sample_types.proto\"\x07\n\x05\x45mpty\"\x14\n\x04Uuid\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"F\n\x05\x45vent\x12\x11\n\ttimestamp\x18\x01 \x01(\x01\x12*\n\nevent_type\x18\x02 \x01(\x0e\x32\x16.context.EventTypeEnum\"0\n\tContextId\x12#\n\x0c\x63ontext_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xb6\x01\n\x07\x43ontext\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12)\n\x0ctopology_ids\x18\x02 \x03(\x0b\x32\x13.context.TopologyId\x12\'\n\x0bservice_ids\x18\x03 \x03(\x0b\x32\x12.context.ServiceId\x12/\n\ncontroller\x18\x04 \x01(\x0b\x32\x1b.context.TeraFlowController\"8\n\rContextIdList\x12\'\n\x0b\x63ontext_ids\x18\x01 \x03(\x0b\x32\x12.context.ContextId\"1\n\x0b\x43ontextList\x12\"\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32\x10.context.Context\"U\n\x0c\x43ontextEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\ncontext_id\x18\x02 \x01(\x0b\x32\x12.context.ContextId\"Z\n\nTopologyId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12$\n\rtopology_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"~\n\x08Topology\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12%\n\ndevice_ids\x18\x02 \x03(\x0b\x32\x11.context.DeviceId\x12!\n\x08link_ids\x18\x03 \x03(\x0b\x32\x0f.context.LinkId\";\n\x0eTopologyIdList\x12)\n\x0ctopology_ids\x18\x01 \x03(\x0b\x32\x13.context.TopologyId\"5\n\x0cTopologyList\x12%\n\ntopologies\x18\x01 \x03(\x0b\x32\x11.context.Topology\"X\n\rTopologyEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12(\n\x0btopology_id\x18\x02 \x01(\x0b\x32\x13.context.TopologyId\".\n\x08\x44\x65viceId\x12\"\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x9a\x02\n\x06\x44\x65vice\x12$\n\tdevice_id\x18\x01 \x01(\x0b\x32\x11.context.DeviceId\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12,\n\rdevice_config\x18\x03 \x01(\x0b\x32\x15.context.DeviceConfig\x12G\n\x19\x64\x65vice_operational_status\x18\x04 \x01(\x0e\x32$.context.DeviceOperationalStatusEnum\x12\x31\n\x0e\x64\x65vice_drivers\x18\x05 \x03(\x0e\x32\x19.context.DeviceDriverEnum\x12+\n\x10\x64\x65vice_endpoints\x18\x06 \x03(\x0b\x32\x11.context.EndPoint\"9\n\x0c\x44\x65viceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"5\n\x0c\x44\x65viceIdList\x12%\n\ndevice_ids\x18\x01 \x03(\x0b\x32\x11.context.DeviceId\".\n\nDeviceList\x12 \n\x07\x64\x65vices\x18\x01 \x03(\x0b\x32\x0f.context.Device\"R\n\x0b\x44\x65viceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"*\n\x06LinkId\x12 \n\tlink_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"X\n\x04Link\x12 \n\x07link_id\x18\x01 \x01(\x0b\x32\x0f.context.LinkId\x12.\n\x11link_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\"/\n\nLinkIdList\x12!\n\x08link_ids\x18\x01 \x03(\x0b\x32\x0f.context.LinkId\"(\n\x08LinkList\x12\x1c\n\x05links\x18\x01 \x03(\x0b\x32\r.context.Link\"L\n\tLinkEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12 \n\x07link_id\x18\x02 \x01(\x0b\x32\x0f.context.LinkId\"X\n\tServiceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12#\n\x0cservice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\xa6\x02\n\x07Service\x12&\n\nservice_id\x18\x01 \x01(\x0b\x32\x12.context.ServiceId\x12.\n\x0cservice_type\x18\x02 \x01(\x0e\x32\x18.context.ServiceTypeEnum\x12\x31\n\x14service_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12\x30\n\x13service_constraints\x18\x04 \x03(\x0b\x32\x13.context.Constraint\x12.\n\x0eservice_status\x18\x05 \x01(\x0b\x32\x16.context.ServiceStatus\x12.\n\x0eservice_config\x18\x06 \x01(\x0b\x32\x16.context.ServiceConfig\"C\n\rServiceStatus\x12\x32\n\x0eservice_status\x18\x01 \x01(\x0e\x32\x1a.context.ServiceStatusEnum\":\n\rServiceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"8\n\rServiceIdList\x12\'\n\x0bservice_ids\x18\x01 \x03(\x0b\x32\x12.context.ServiceId\"1\n\x0bServiceList\x12\"\n\x08services\x18\x01 \x03(\x0b\x32\x10.context.Service\"U\n\x0cServiceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\"T\n\x07SliceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12!\n\nslice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\x95\x02\n\x05Slice\x12\"\n\x08slice_id\x18\x01 \x01(\x0b\x32\x10.context.SliceId\x12/\n\x12slice_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\x12.\n\x11slice_constraints\x18\x03 \x03(\x0b\x32\x13.context.Constraint\x12-\n\x11slice_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\x12,\n\x12slice_subslice_ids\x18\x05 \x03(\x0b\x32\x10.context.SliceId\x12*\n\x0cslice_status\x18\x06 \x01(\x0b\x32\x14.context.SliceStatus\"=\n\x0bSliceStatus\x12.\n\x0cslice_status\x18\x01 \x01(\x0e\x32\x18.context.SliceStatusEnum\"2\n\x0bSliceIdList\x12#\n\tslice_ids\x18\x01 \x03(\x0b\x32\x10.context.SliceId\"+\n\tSliceList\x12\x1e\n\x06slices\x18\x01 \x03(\x0b\x32\x0e.context.Slice\"O\n\nSliceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12\"\n\x08slice_id\x18\x02 \x01(\x0b\x32\x10.context.SliceId\"6\n\x0c\x43onnectionId\x12&\n\x0f\x63onnection_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xc4\x01\n\nConnection\x12,\n\rconnection_id\x18\x01 \x01(\x0b\x32\x15.context.ConnectionId\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\x12\x33\n\x16path_hops_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12+\n\x0fsub_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\"A\n\x10\x43onnectionIdList\x12-\n\x0e\x63onnection_ids\x18\x01 \x03(\x0b\x32\x15.context.ConnectionId\":\n\x0e\x43onnectionList\x12(\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x13.context.Connection\"^\n\x0f\x43onnectionEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12,\n\rconnection_id\x18\x02 \x01(\x0b\x32\x15.context.ConnectionId\"\x82\x01\n\nEndPointId\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\x12$\n\rendpoint_uuid\x18\x03 \x01(\x0b\x32\r.context.Uuid\"\x86\x01\n\x08\x45ndPoint\x12(\n\x0b\x65ndpoint_id\x18\x01 \x01(\x0b\x32\x13.context.EndPointId\x12\x15\n\rendpoint_type\x18\x02 \x01(\t\x12\x39\n\x10kpi_sample_types\x18\x03 \x03(\x0e\x32\x1f.kpi_sample_types.KpiSampleType\"e\n\nConfigRule\x12)\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x19.context.ConfigActionEnum\x12\x14\n\x0cresource_key\x18\x02 \x01(\t\x12\x16\n\x0eresource_value\x18\x03 \x01(\t\"?\n\nConstraint\x12\x17\n\x0f\x63onstraint_type\x18\x01 \x01(\t\x12\x18\n\x10\x63onstraint_value\x18\x02 \x01(\t\"^\n\x12TeraFlowController\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x12\n\nip_address\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\"U\n\x14\x41uthenticationResult\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x15\n\rauthenticated\x18\x02 \x01(\x08*j\n\rEventTypeEnum\x12\x17\n\x13\x45VENTTYPE_UNDEFINED\x10\x00\x12\x14\n\x10\x45VENTTYPE_CREATE\x10\x01\x12\x14\n\x10\x45VENTTYPE_UPDATE\x10\x02\x12\x14\n\x10\x45VENTTYPE_REMOVE\x10\x03*\xc5\x01\n\x10\x44\x65viceDriverEnum\x12\x1a\n\x16\x44\x45VICEDRIVER_UNDEFINED\x10\x00\x12\x1b\n\x17\x44\x45VICEDRIVER_OPENCONFIG\x10\x01\x12\x1e\n\x1a\x44\x45VICEDRIVER_TRANSPORT_API\x10\x02\x12\x13\n\x0f\x44\x45VICEDRIVER_P4\x10\x03\x12&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOGY\x10\x04\x12\x1b\n\x17\x44\x45VICEDRIVER_ONF_TR_352\x10\x05*\x8f\x01\n\x1b\x44\x65viceOperationalStatusEnum\x12%\n!DEVICEOPERATIONALSTATUS_UNDEFINED\x10\x00\x12$\n DEVICEOPERATIONALSTATUS_DISABLED\x10\x01\x12#\n\x1f\x44\x45VICEOPERATIONALSTATUS_ENABLED\x10\x02*\x81\x01\n\x0fServiceTypeEnum\x12\x17\n\x13SERVICETYPE_UNKNOWN\x10\x00\x12\x14\n\x10SERVICETYPE_L3NM\x10\x01\x12\x14\n\x10SERVICETYPE_L2NM\x10\x02\x12)\n%SERVICETYPE_TAPI_CONNECTIVITY_SERVICE\x10\x03*\x88\x01\n\x11ServiceStatusEnum\x12\x1b\n\x17SERVICESTATUS_UNDEFINED\x10\x00\x12\x19\n\x15SERVICESTATUS_PLANNED\x10\x01\x12\x18\n\x14SERVICESTATUS_ACTIVE\x10\x02\x12!\n\x1dSERVICESTATUS_PENDING_REMOVAL\x10\x03*\x8b\x01\n\x0fSliceStatusEnum\x12\x19\n\x15SLICESTATUS_UNDEFINED\x10\x00\x12\x17\n\x13SLICESTATUS_PLANNED\x10\x01\x12\x14\n\x10SLICESTATUS_INIT\x10\x02\x12\x16\n\x12SLICESTATUS_ACTIVE\x10\x03\x12\x16\n\x12SLICESTATUS_DEINIT\x10\x04*]\n\x10\x43onfigActionEnum\x12\x1a\n\x16\x43ONFIGACTION_UNDEFINED\x10\x00\x12\x14\n\x10\x43ONFIGACTION_SET\x10\x01\x12\x17\n\x13\x43ONFIGACTION_DELETE\x10\x02\x32\xef\x12\n\x0e\x43ontextService\x12:\n\x0eListContextIds\x12\x0e.context.Empty\x1a\x16.context.ContextIdList\"\x00\x12\x36\n\x0cListContexts\x12\x0e.context.Empty\x1a\x14.context.ContextList\"\x00\x12\x34\n\nGetContext\x12\x12.context.ContextId\x1a\x10.context.Context\"\x00\x12\x34\n\nSetContext\x12\x10.context.Context\x1a\x12.context.ContextId\"\x00\x12\x35\n\rRemoveContext\x12\x12.context.ContextId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetContextEvents\x12\x0e.context.Empty\x1a\x15.context.ContextEvent\"\x00\x30\x01\x12@\n\x0fListTopologyIds\x12\x12.context.ContextId\x1a\x17.context.TopologyIdList\"\x00\x12=\n\x0eListTopologies\x12\x12.context.ContextId\x1a\x15.context.TopologyList\"\x00\x12\x37\n\x0bGetTopology\x12\x13.context.TopologyId\x1a\x11.context.Topology\"\x00\x12\x37\n\x0bSetTopology\x12\x11.context.Topology\x1a\x13.context.TopologyId\"\x00\x12\x37\n\x0eRemoveTopology\x12\x13.context.TopologyId\x1a\x0e.context.Empty\"\x00\x12?\n\x11GetTopologyEvents\x12\x0e.context.Empty\x1a\x16.context.TopologyEvent\"\x00\x30\x01\x12\x38\n\rListDeviceIds\x12\x0e.context.Empty\x1a\x15.context.DeviceIdList\"\x00\x12\x34\n\x0bListDevices\x12\x0e.context.Empty\x1a\x13.context.DeviceList\"\x00\x12\x31\n\tGetDevice\x12\x11.context.DeviceId\x1a\x0f.context.Device\"\x00\x12\x31\n\tSetDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0cRemoveDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x12;\n\x0fGetDeviceEvents\x12\x0e.context.Empty\x1a\x14.context.DeviceEvent\"\x00\x30\x01\x12\x34\n\x0bListLinkIds\x12\x0e.context.Empty\x1a\x13.context.LinkIdList\"\x00\x12\x30\n\tListLinks\x12\x0e.context.Empty\x1a\x11.context.LinkList\"\x00\x12+\n\x07GetLink\x12\x0f.context.LinkId\x1a\r.context.Link\"\x00\x12+\n\x07SetLink\x12\r.context.Link\x1a\x0f.context.LinkId\"\x00\x12/\n\nRemoveLink\x12\x0f.context.LinkId\x1a\x0e.context.Empty\"\x00\x12\x37\n\rGetLinkEvents\x12\x0e.context.Empty\x1a\x12.context.LinkEvent\"\x00\x30\x01\x12>\n\x0eListServiceIds\x12\x12.context.ContextId\x1a\x16.context.ServiceIdList\"\x00\x12:\n\x0cListServices\x12\x12.context.ContextId\x1a\x14.context.ServiceList\"\x00\x12\x34\n\nGetService\x12\x12.context.ServiceId\x1a\x10.context.Service\"\x00\x12\x34\n\nSetService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rRemoveService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetServiceEvents\x12\x0e.context.Empty\x1a\x15.context.ServiceEvent\"\x00\x30\x01\x12:\n\x0cListSliceIds\x12\x12.context.ContextId\x1a\x14.context.SliceIdList\"\x00\x12\x36\n\nListSlices\x12\x12.context.ContextId\x1a\x12.context.SliceList\"\x00\x12.\n\x08GetSlice\x12\x10.context.SliceId\x1a\x0e.context.Slice\"\x00\x12.\n\x08SetSlice\x12\x0e.context.Slice\x1a\x10.context.SliceId\"\x00\x12\x31\n\x0bRemoveSlice\x12\x10.context.SliceId\x1a\x0e.context.Empty\"\x00\x12\x39\n\x0eGetSliceEvents\x12\x0e.context.Empty\x1a\x13.context.SliceEvent\"\x00\x30\x01\x12\x44\n\x11ListConnectionIds\x12\x12.context.ServiceId\x1a\x19.context.ConnectionIdList\"\x00\x12@\n\x0fListConnections\x12\x12.context.ServiceId\x1a\x17.context.ConnectionList\"\x00\x12=\n\rGetConnection\x12\x15.context.ConnectionId\x1a\x13.context.Connection\"\x00\x12=\n\rSetConnection\x12\x13.context.Connection\x1a\x15.context.ConnectionId\"\x00\x12;\n\x10RemoveConnection\x12\x15.context.ConnectionId\x1a\x0e.context.Empty\"\x00\x12\x43\n\x13GetConnectionEvents\x12\x0e.context.Empty\x1a\x18.context.ConnectionEvent\"\x00\x30\x01\x62\x06proto3' + , + dependencies=[kpi__sample__types__pb2.DESCRIPTOR,]) + +_EVENTTYPEENUM = _descriptor.EnumDescriptor( + name='EventTypeEnum', + full_name='context.EventTypeEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='EVENTTYPE_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='EVENTTYPE_CREATE', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='EVENTTYPE_UPDATE', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='EVENTTYPE_REMOVE', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=4310, + serialized_end=4416, +) +_sym_db.RegisterEnumDescriptor(_EVENTTYPEENUM) + +EventTypeEnum = enum_type_wrapper.EnumTypeWrapper(_EVENTTYPEENUM) +_DEVICEDRIVERENUM = _descriptor.EnumDescriptor( + name='DeviceDriverEnum', + full_name='context.DeviceDriverEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='DEVICEDRIVER_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DEVICEDRIVER_OPENCONFIG', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DEVICEDRIVER_TRANSPORT_API', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DEVICEDRIVER_P4', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DEVICEDRIVER_IETF_NETWORK_TOPOLOGY', index=4, number=4, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DEVICEDRIVER_ONF_TR_352', index=5, number=5, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=4419, + serialized_end=4616, +) +_sym_db.RegisterEnumDescriptor(_DEVICEDRIVERENUM) + +DeviceDriverEnum = enum_type_wrapper.EnumTypeWrapper(_DEVICEDRIVERENUM) +_DEVICEOPERATIONALSTATUSENUM = _descriptor.EnumDescriptor( + name='DeviceOperationalStatusEnum', + full_name='context.DeviceOperationalStatusEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='DEVICEOPERATIONALSTATUS_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DEVICEOPERATIONALSTATUS_DISABLED', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DEVICEOPERATIONALSTATUS_ENABLED', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=4619, + serialized_end=4762, +) +_sym_db.RegisterEnumDescriptor(_DEVICEOPERATIONALSTATUSENUM) + +DeviceOperationalStatusEnum = enum_type_wrapper.EnumTypeWrapper(_DEVICEOPERATIONALSTATUSENUM) +_SERVICETYPEENUM = _descriptor.EnumDescriptor( + name='ServiceTypeEnum', + full_name='context.ServiceTypeEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='SERVICETYPE_UNKNOWN', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SERVICETYPE_L3NM', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SERVICETYPE_L2NM', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SERVICETYPE_TAPI_CONNECTIVITY_SERVICE', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=4765, + serialized_end=4894, +) +_sym_db.RegisterEnumDescriptor(_SERVICETYPEENUM) + +ServiceTypeEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICETYPEENUM) +_SERVICESTATUSENUM = _descriptor.EnumDescriptor( + name='ServiceStatusEnum', + full_name='context.ServiceStatusEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='SERVICESTATUS_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SERVICESTATUS_PLANNED', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SERVICESTATUS_ACTIVE', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SERVICESTATUS_PENDING_REMOVAL', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=4897, + serialized_end=5033, +) +_sym_db.RegisterEnumDescriptor(_SERVICESTATUSENUM) + +ServiceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICESTATUSENUM) +_SLICESTATUSENUM = _descriptor.EnumDescriptor( + name='SliceStatusEnum', + full_name='context.SliceStatusEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_PLANNED', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_INIT', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_ACTIVE', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_DEINIT', index=4, number=4, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=5036, + serialized_end=5175, +) +_sym_db.RegisterEnumDescriptor(_SLICESTATUSENUM) + +SliceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SLICESTATUSENUM) +_CONFIGACTIONENUM = _descriptor.EnumDescriptor( + name='ConfigActionEnum', + full_name='context.ConfigActionEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='CONFIGACTION_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CONFIGACTION_SET', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CONFIGACTION_DELETE', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=5177, + serialized_end=5270, +) +_sym_db.RegisterEnumDescriptor(_CONFIGACTIONENUM) + +ConfigActionEnum = enum_type_wrapper.EnumTypeWrapper(_CONFIGACTIONENUM) +EVENTTYPE_UNDEFINED = 0 +EVENTTYPE_CREATE = 1 +EVENTTYPE_UPDATE = 2 +EVENTTYPE_REMOVE = 3 +DEVICEDRIVER_UNDEFINED = 0 +DEVICEDRIVER_OPENCONFIG = 1 +DEVICEDRIVER_TRANSPORT_API = 2 +DEVICEDRIVER_P4 = 3 +DEVICEDRIVER_IETF_NETWORK_TOPOLOGY = 4 +DEVICEDRIVER_ONF_TR_352 = 5 +DEVICEOPERATIONALSTATUS_UNDEFINED = 0 +DEVICEOPERATIONALSTATUS_DISABLED = 1 +DEVICEOPERATIONALSTATUS_ENABLED = 2 +SERVICETYPE_UNKNOWN = 0 +SERVICETYPE_L3NM = 1 +SERVICETYPE_L2NM = 2 +SERVICETYPE_TAPI_CONNECTIVITY_SERVICE = 3 +SERVICESTATUS_UNDEFINED = 0 +SERVICESTATUS_PLANNED = 1 +SERVICESTATUS_ACTIVE = 2 +SERVICESTATUS_PENDING_REMOVAL = 3 +SLICESTATUS_UNDEFINED = 0 +SLICESTATUS_PLANNED = 1 +SLICESTATUS_INIT = 2 +SLICESTATUS_ACTIVE = 3 +SLICESTATUS_DEINIT = 4 +CONFIGACTION_UNDEFINED = 0 +CONFIGACTION_SET = 1 +CONFIGACTION_DELETE = 2 + + + +_EMPTY = _descriptor.Descriptor( + name='Empty', + full_name='context.Empty', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=50, + serialized_end=57, +) + + +_UUID = _descriptor.Descriptor( + name='Uuid', + full_name='context.Uuid', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='uuid', full_name='context.Uuid.uuid', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=59, + serialized_end=79, +) + + +_EVENT = _descriptor.Descriptor( + name='Event', + full_name='context.Event', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='timestamp', full_name='context.Event.timestamp', index=0, + number=1, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='event_type', full_name='context.Event.event_type', index=1, + number=2, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=81, + serialized_end=151, +) + + +_CONTEXTID = _descriptor.Descriptor( + name='ContextId', + full_name='context.ContextId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_uuid', full_name='context.ContextId.context_uuid', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=153, + serialized_end=201, +) + + +_CONTEXT = _descriptor.Descriptor( + name='Context', + full_name='context.Context', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_id', full_name='context.Context.context_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='topology_ids', full_name='context.Context.topology_ids', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_ids', full_name='context.Context.service_ids', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='controller', full_name='context.Context.controller', index=3, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=204, + serialized_end=386, +) + + +_CONTEXTIDLIST = _descriptor.Descriptor( + name='ContextIdList', + full_name='context.ContextIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_ids', full_name='context.ContextIdList.context_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=388, + serialized_end=444, +) + + +_CONTEXTLIST = _descriptor.Descriptor( + name='ContextList', + full_name='context.ContextList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='contexts', full_name='context.ContextList.contexts', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=446, + serialized_end=495, +) + + +_CONTEXTEVENT = _descriptor.Descriptor( + name='ContextEvent', + full_name='context.ContextEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.ContextEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='context_id', full_name='context.ContextEvent.context_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=497, + serialized_end=582, +) + + +_TOPOLOGYID = _descriptor.Descriptor( + name='TopologyId', + full_name='context.TopologyId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_id', full_name='context.TopologyId.context_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='topology_uuid', full_name='context.TopologyId.topology_uuid', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=584, + serialized_end=674, +) + + +_TOPOLOGY = _descriptor.Descriptor( + name='Topology', + full_name='context.Topology', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='topology_id', full_name='context.Topology.topology_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='device_ids', full_name='context.Topology.device_ids', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='link_ids', full_name='context.Topology.link_ids', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=676, + serialized_end=802, +) + + +_TOPOLOGYIDLIST = _descriptor.Descriptor( + name='TopologyIdList', + full_name='context.TopologyIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='topology_ids', full_name='context.TopologyIdList.topology_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=804, + serialized_end=863, +) + + +_TOPOLOGYLIST = _descriptor.Descriptor( + name='TopologyList', + full_name='context.TopologyList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='topologies', full_name='context.TopologyList.topologies', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=865, + serialized_end=918, +) + + +_TOPOLOGYEVENT = _descriptor.Descriptor( + name='TopologyEvent', + full_name='context.TopologyEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.TopologyEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='topology_id', full_name='context.TopologyEvent.topology_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=920, + serialized_end=1008, +) + + +_DEVICEID = _descriptor.Descriptor( + name='DeviceId', + full_name='context.DeviceId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='device_uuid', full_name='context.DeviceId.device_uuid', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1010, + serialized_end=1056, +) + + +_DEVICE = _descriptor.Descriptor( + name='Device', + full_name='context.Device', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='device_id', full_name='context.Device.device_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='device_type', full_name='context.Device.device_type', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='device_config', full_name='context.Device.device_config', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='device_operational_status', full_name='context.Device.device_operational_status', index=3, + number=4, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='device_drivers', full_name='context.Device.device_drivers', index=4, + number=5, type=14, cpp_type=8, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='device_endpoints', full_name='context.Device.device_endpoints', index=5, + number=6, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1059, + serialized_end=1341, +) + + +_DEVICECONFIG = _descriptor.Descriptor( + name='DeviceConfig', + full_name='context.DeviceConfig', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='config_rules', full_name='context.DeviceConfig.config_rules', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1343, + serialized_end=1400, +) + + +_DEVICEIDLIST = _descriptor.Descriptor( + name='DeviceIdList', + full_name='context.DeviceIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='device_ids', full_name='context.DeviceIdList.device_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1402, + serialized_end=1455, +) + + +_DEVICELIST = _descriptor.Descriptor( + name='DeviceList', + full_name='context.DeviceList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='devices', full_name='context.DeviceList.devices', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1457, + serialized_end=1503, +) + + +_DEVICEEVENT = _descriptor.Descriptor( + name='DeviceEvent', + full_name='context.DeviceEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.DeviceEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='device_id', full_name='context.DeviceEvent.device_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1505, + serialized_end=1587, +) + + +_LINKID = _descriptor.Descriptor( + name='LinkId', + full_name='context.LinkId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='link_uuid', full_name='context.LinkId.link_uuid', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1589, + serialized_end=1631, +) + + +_LINK = _descriptor.Descriptor( + name='Link', + full_name='context.Link', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='link_id', full_name='context.Link.link_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='link_endpoint_ids', full_name='context.Link.link_endpoint_ids', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1633, + serialized_end=1721, +) + + +_LINKIDLIST = _descriptor.Descriptor( + name='LinkIdList', + full_name='context.LinkIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='link_ids', full_name='context.LinkIdList.link_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1723, + serialized_end=1770, +) + + +_LINKLIST = _descriptor.Descriptor( + name='LinkList', + full_name='context.LinkList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='links', full_name='context.LinkList.links', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1772, + serialized_end=1812, +) + + +_LINKEVENT = _descriptor.Descriptor( + name='LinkEvent', + full_name='context.LinkEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.LinkEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='link_id', full_name='context.LinkEvent.link_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1814, + serialized_end=1890, +) + + +_SERVICEID = _descriptor.Descriptor( + name='ServiceId', + full_name='context.ServiceId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_id', full_name='context.ServiceId.context_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_uuid', full_name='context.ServiceId.service_uuid', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1892, + serialized_end=1980, +) + + +_SERVICE = _descriptor.Descriptor( + name='Service', + full_name='context.Service', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='service_id', full_name='context.Service.service_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_type', full_name='context.Service.service_type', index=1, + number=2, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_endpoint_ids', full_name='context.Service.service_endpoint_ids', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_constraints', full_name='context.Service.service_constraints', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_status', full_name='context.Service.service_status', index=4, + number=5, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_config', full_name='context.Service.service_config', index=5, + number=6, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1983, + serialized_end=2277, +) + + +_SERVICESTATUS = _descriptor.Descriptor( + name='ServiceStatus', + full_name='context.ServiceStatus', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='service_status', full_name='context.ServiceStatus.service_status', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2279, + serialized_end=2346, +) + + +_SERVICECONFIG = _descriptor.Descriptor( + name='ServiceConfig', + full_name='context.ServiceConfig', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='config_rules', full_name='context.ServiceConfig.config_rules', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2348, + serialized_end=2406, +) + + +_SERVICEIDLIST = _descriptor.Descriptor( + name='ServiceIdList', + full_name='context.ServiceIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='service_ids', full_name='context.ServiceIdList.service_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2408, + serialized_end=2464, +) + + +_SERVICELIST = _descriptor.Descriptor( + name='ServiceList', + full_name='context.ServiceList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='services', full_name='context.ServiceList.services', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2466, + serialized_end=2515, +) + + +_SERVICEEVENT = _descriptor.Descriptor( + name='ServiceEvent', + full_name='context.ServiceEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.ServiceEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_id', full_name='context.ServiceEvent.service_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2517, + serialized_end=2602, +) + + +_SLICEID = _descriptor.Descriptor( + name='SliceId', + full_name='context.SliceId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_id', full_name='context.SliceId.context_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_uuid', full_name='context.SliceId.slice_uuid', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2604, + serialized_end=2688, +) + + +_SLICE = _descriptor.Descriptor( + name='Slice', + full_name='context.Slice', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_id', full_name='context.Slice.slice_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_endpoint_ids', full_name='context.Slice.slice_endpoint_ids', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_constraints', full_name='context.Slice.slice_constraints', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_service_ids', full_name='context.Slice.slice_service_ids', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_subslice_ids', full_name='context.Slice.slice_subslice_ids', index=4, + number=5, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_status', full_name='context.Slice.slice_status', index=5, + number=6, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2691, + serialized_end=2968, +) + + +_SLICESTATUS = _descriptor.Descriptor( + name='SliceStatus', + full_name='context.SliceStatus', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_status', full_name='context.SliceStatus.slice_status', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2970, + serialized_end=3031, +) + + +_SLICEIDLIST = _descriptor.Descriptor( + name='SliceIdList', + full_name='context.SliceIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_ids', full_name='context.SliceIdList.slice_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3033, + serialized_end=3083, +) + + +_SLICELIST = _descriptor.Descriptor( + name='SliceList', + full_name='context.SliceList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slices', full_name='context.SliceList.slices', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3085, + serialized_end=3128, +) + + +_SLICEEVENT = _descriptor.Descriptor( + name='SliceEvent', + full_name='context.SliceEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.SliceEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_id', full_name='context.SliceEvent.slice_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3130, + serialized_end=3209, +) + + +_CONNECTIONID = _descriptor.Descriptor( + name='ConnectionId', + full_name='context.ConnectionId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='connection_uuid', full_name='context.ConnectionId.connection_uuid', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3211, + serialized_end=3265, +) + + +_CONNECTION = _descriptor.Descriptor( + name='Connection', + full_name='context.Connection', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='connection_id', full_name='context.Connection.connection_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_id', full_name='context.Connection.service_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='path_hops_endpoint_ids', full_name='context.Connection.path_hops_endpoint_ids', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='sub_service_ids', full_name='context.Connection.sub_service_ids', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3268, + serialized_end=3464, +) + + +_CONNECTIONIDLIST = _descriptor.Descriptor( + name='ConnectionIdList', + full_name='context.ConnectionIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='connection_ids', full_name='context.ConnectionIdList.connection_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3466, + serialized_end=3531, +) + + +_CONNECTIONLIST = _descriptor.Descriptor( + name='ConnectionList', + full_name='context.ConnectionList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='connections', full_name='context.ConnectionList.connections', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3533, + serialized_end=3591, +) + + +_CONNECTIONEVENT = _descriptor.Descriptor( + name='ConnectionEvent', + full_name='context.ConnectionEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.ConnectionEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='connection_id', full_name='context.ConnectionEvent.connection_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3593, + serialized_end=3687, +) + + +_ENDPOINTID = _descriptor.Descriptor( + name='EndPointId', + full_name='context.EndPointId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='topology_id', full_name='context.EndPointId.topology_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='device_id', full_name='context.EndPointId.device_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='endpoint_uuid', full_name='context.EndPointId.endpoint_uuid', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3690, + serialized_end=3820, +) + + +_ENDPOINT = _descriptor.Descriptor( + name='EndPoint', + full_name='context.EndPoint', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='endpoint_id', full_name='context.EndPoint.endpoint_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='endpoint_type', full_name='context.EndPoint.endpoint_type', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='kpi_sample_types', full_name='context.EndPoint.kpi_sample_types', index=2, + number=3, type=14, cpp_type=8, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3823, + serialized_end=3957, +) + + +_CONFIGRULE = _descriptor.Descriptor( + name='ConfigRule', + full_name='context.ConfigRule', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='action', full_name='context.ConfigRule.action', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='resource_key', full_name='context.ConfigRule.resource_key', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='resource_value', full_name='context.ConfigRule.resource_value', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3959, + serialized_end=4060, +) + + +_CONSTRAINT = _descriptor.Descriptor( + name='Constraint', + full_name='context.Constraint', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='constraint_type', full_name='context.Constraint.constraint_type', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='constraint_value', full_name='context.Constraint.constraint_value', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=4062, + serialized_end=4125, +) + + +_TERAFLOWCONTROLLER = _descriptor.Descriptor( + name='TeraFlowController', + full_name='context.TeraFlowController', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_id', full_name='context.TeraFlowController.context_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='ip_address', full_name='context.TeraFlowController.ip_address', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='port', full_name='context.TeraFlowController.port', index=2, + number=3, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=4127, + serialized_end=4221, +) + + +_AUTHENTICATIONRESULT = _descriptor.Descriptor( + name='AuthenticationResult', + full_name='context.AuthenticationResult', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_id', full_name='context.AuthenticationResult.context_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='authenticated', full_name='context.AuthenticationResult.authenticated', index=1, + number=2, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=4223, + serialized_end=4308, +) + +_EVENT.fields_by_name['event_type'].enum_type = _EVENTTYPEENUM +_CONTEXTID.fields_by_name['context_uuid'].message_type = _UUID +_CONTEXT.fields_by_name['context_id'].message_type = _CONTEXTID +_CONTEXT.fields_by_name['topology_ids'].message_type = _TOPOLOGYID +_CONTEXT.fields_by_name['service_ids'].message_type = _SERVICEID +_CONTEXT.fields_by_name['controller'].message_type = _TERAFLOWCONTROLLER +_CONTEXTIDLIST.fields_by_name['context_ids'].message_type = _CONTEXTID +_CONTEXTLIST.fields_by_name['contexts'].message_type = _CONTEXT +_CONTEXTEVENT.fields_by_name['event'].message_type = _EVENT +_CONTEXTEVENT.fields_by_name['context_id'].message_type = _CONTEXTID +_TOPOLOGYID.fields_by_name['context_id'].message_type = _CONTEXTID +_TOPOLOGYID.fields_by_name['topology_uuid'].message_type = _UUID +_TOPOLOGY.fields_by_name['topology_id'].message_type = _TOPOLOGYID +_TOPOLOGY.fields_by_name['device_ids'].message_type = _DEVICEID +_TOPOLOGY.fields_by_name['link_ids'].message_type = _LINKID +_TOPOLOGYIDLIST.fields_by_name['topology_ids'].message_type = _TOPOLOGYID +_TOPOLOGYLIST.fields_by_name['topologies'].message_type = _TOPOLOGY +_TOPOLOGYEVENT.fields_by_name['event'].message_type = _EVENT +_TOPOLOGYEVENT.fields_by_name['topology_id'].message_type = _TOPOLOGYID +_DEVICEID.fields_by_name['device_uuid'].message_type = _UUID +_DEVICE.fields_by_name['device_id'].message_type = _DEVICEID +_DEVICE.fields_by_name['device_config'].message_type = _DEVICECONFIG +_DEVICE.fields_by_name['device_operational_status'].enum_type = _DEVICEOPERATIONALSTATUSENUM +_DEVICE.fields_by_name['device_drivers'].enum_type = _DEVICEDRIVERENUM +_DEVICE.fields_by_name['device_endpoints'].message_type = _ENDPOINT +_DEVICECONFIG.fields_by_name['config_rules'].message_type = _CONFIGRULE +_DEVICEIDLIST.fields_by_name['device_ids'].message_type = _DEVICEID +_DEVICELIST.fields_by_name['devices'].message_type = _DEVICE +_DEVICEEVENT.fields_by_name['event'].message_type = _EVENT +_DEVICEEVENT.fields_by_name['device_id'].message_type = _DEVICEID +_LINKID.fields_by_name['link_uuid'].message_type = _UUID +_LINK.fields_by_name['link_id'].message_type = _LINKID +_LINK.fields_by_name['link_endpoint_ids'].message_type = _ENDPOINTID +_LINKIDLIST.fields_by_name['link_ids'].message_type = _LINKID +_LINKLIST.fields_by_name['links'].message_type = _LINK +_LINKEVENT.fields_by_name['event'].message_type = _EVENT +_LINKEVENT.fields_by_name['link_id'].message_type = _LINKID +_SERVICEID.fields_by_name['context_id'].message_type = _CONTEXTID +_SERVICEID.fields_by_name['service_uuid'].message_type = _UUID +_SERVICE.fields_by_name['service_id'].message_type = _SERVICEID +_SERVICE.fields_by_name['service_type'].enum_type = _SERVICETYPEENUM +_SERVICE.fields_by_name['service_endpoint_ids'].message_type = _ENDPOINTID +_SERVICE.fields_by_name['service_constraints'].message_type = _CONSTRAINT +_SERVICE.fields_by_name['service_status'].message_type = _SERVICESTATUS +_SERVICE.fields_by_name['service_config'].message_type = _SERVICECONFIG +_SERVICESTATUS.fields_by_name['service_status'].enum_type = _SERVICESTATUSENUM +_SERVICECONFIG.fields_by_name['config_rules'].message_type = _CONFIGRULE +_SERVICEIDLIST.fields_by_name['service_ids'].message_type = _SERVICEID +_SERVICELIST.fields_by_name['services'].message_type = _SERVICE +_SERVICEEVENT.fields_by_name['event'].message_type = _EVENT +_SERVICEEVENT.fields_by_name['service_id'].message_type = _SERVICEID +_SLICEID.fields_by_name['context_id'].message_type = _CONTEXTID +_SLICEID.fields_by_name['slice_uuid'].message_type = _UUID +_SLICE.fields_by_name['slice_id'].message_type = _SLICEID +_SLICE.fields_by_name['slice_endpoint_ids'].message_type = _ENDPOINTID +_SLICE.fields_by_name['slice_constraints'].message_type = _CONSTRAINT +_SLICE.fields_by_name['slice_service_ids'].message_type = _SERVICEID +_SLICE.fields_by_name['slice_subslice_ids'].message_type = _SLICEID +_SLICE.fields_by_name['slice_status'].message_type = _SLICESTATUS +_SLICESTATUS.fields_by_name['slice_status'].enum_type = _SLICESTATUSENUM +_SLICEIDLIST.fields_by_name['slice_ids'].message_type = _SLICEID +_SLICELIST.fields_by_name['slices'].message_type = _SLICE +_SLICEEVENT.fields_by_name['event'].message_type = _EVENT +_SLICEEVENT.fields_by_name['slice_id'].message_type = _SLICEID +_CONNECTIONID.fields_by_name['connection_uuid'].message_type = _UUID +_CONNECTION.fields_by_name['connection_id'].message_type = _CONNECTIONID +_CONNECTION.fields_by_name['service_id'].message_type = _SERVICEID +_CONNECTION.fields_by_name['path_hops_endpoint_ids'].message_type = _ENDPOINTID +_CONNECTION.fields_by_name['sub_service_ids'].message_type = _SERVICEID +_CONNECTIONIDLIST.fields_by_name['connection_ids'].message_type = _CONNECTIONID +_CONNECTIONLIST.fields_by_name['connections'].message_type = _CONNECTION +_CONNECTIONEVENT.fields_by_name['event'].message_type = _EVENT +_CONNECTIONEVENT.fields_by_name['connection_id'].message_type = _CONNECTIONID +_ENDPOINTID.fields_by_name['topology_id'].message_type = _TOPOLOGYID +_ENDPOINTID.fields_by_name['device_id'].message_type = _DEVICEID +_ENDPOINTID.fields_by_name['endpoint_uuid'].message_type = _UUID +_ENDPOINT.fields_by_name['endpoint_id'].message_type = _ENDPOINTID +_ENDPOINT.fields_by_name['kpi_sample_types'].enum_type = kpi__sample__types__pb2._KPISAMPLETYPE +_CONFIGRULE.fields_by_name['action'].enum_type = _CONFIGACTIONENUM +_TERAFLOWCONTROLLER.fields_by_name['context_id'].message_type = _CONTEXTID +_AUTHENTICATIONRESULT.fields_by_name['context_id'].message_type = _CONTEXTID +DESCRIPTOR.message_types_by_name['Empty'] = _EMPTY +DESCRIPTOR.message_types_by_name['Uuid'] = _UUID +DESCRIPTOR.message_types_by_name['Event'] = _EVENT +DESCRIPTOR.message_types_by_name['ContextId'] = _CONTEXTID +DESCRIPTOR.message_types_by_name['Context'] = _CONTEXT +DESCRIPTOR.message_types_by_name['ContextIdList'] = _CONTEXTIDLIST +DESCRIPTOR.message_types_by_name['ContextList'] = _CONTEXTLIST +DESCRIPTOR.message_types_by_name['ContextEvent'] = _CONTEXTEVENT +DESCRIPTOR.message_types_by_name['TopologyId'] = _TOPOLOGYID +DESCRIPTOR.message_types_by_name['Topology'] = _TOPOLOGY +DESCRIPTOR.message_types_by_name['TopologyIdList'] = _TOPOLOGYIDLIST +DESCRIPTOR.message_types_by_name['TopologyList'] = _TOPOLOGYLIST +DESCRIPTOR.message_types_by_name['TopologyEvent'] = _TOPOLOGYEVENT +DESCRIPTOR.message_types_by_name['DeviceId'] = _DEVICEID +DESCRIPTOR.message_types_by_name['Device'] = _DEVICE +DESCRIPTOR.message_types_by_name['DeviceConfig'] = _DEVICECONFIG +DESCRIPTOR.message_types_by_name['DeviceIdList'] = _DEVICEIDLIST +DESCRIPTOR.message_types_by_name['DeviceList'] = _DEVICELIST +DESCRIPTOR.message_types_by_name['DeviceEvent'] = _DEVICEEVENT +DESCRIPTOR.message_types_by_name['LinkId'] = _LINKID +DESCRIPTOR.message_types_by_name['Link'] = _LINK +DESCRIPTOR.message_types_by_name['LinkIdList'] = _LINKIDLIST +DESCRIPTOR.message_types_by_name['LinkList'] = _LINKLIST +DESCRIPTOR.message_types_by_name['LinkEvent'] = _LINKEVENT +DESCRIPTOR.message_types_by_name['ServiceId'] = _SERVICEID +DESCRIPTOR.message_types_by_name['Service'] = _SERVICE +DESCRIPTOR.message_types_by_name['ServiceStatus'] = _SERVICESTATUS +DESCRIPTOR.message_types_by_name['ServiceConfig'] = _SERVICECONFIG +DESCRIPTOR.message_types_by_name['ServiceIdList'] = _SERVICEIDLIST +DESCRIPTOR.message_types_by_name['ServiceList'] = _SERVICELIST +DESCRIPTOR.message_types_by_name['ServiceEvent'] = _SERVICEEVENT +DESCRIPTOR.message_types_by_name['SliceId'] = _SLICEID +DESCRIPTOR.message_types_by_name['Slice'] = _SLICE +DESCRIPTOR.message_types_by_name['SliceStatus'] = _SLICESTATUS +DESCRIPTOR.message_types_by_name['SliceIdList'] = _SLICEIDLIST +DESCRIPTOR.message_types_by_name['SliceList'] = _SLICELIST +DESCRIPTOR.message_types_by_name['SliceEvent'] = _SLICEEVENT +DESCRIPTOR.message_types_by_name['ConnectionId'] = _CONNECTIONID +DESCRIPTOR.message_types_by_name['Connection'] = _CONNECTION +DESCRIPTOR.message_types_by_name['ConnectionIdList'] = _CONNECTIONIDLIST +DESCRIPTOR.message_types_by_name['ConnectionList'] = _CONNECTIONLIST +DESCRIPTOR.message_types_by_name['ConnectionEvent'] = _CONNECTIONEVENT +DESCRIPTOR.message_types_by_name['EndPointId'] = _ENDPOINTID +DESCRIPTOR.message_types_by_name['EndPoint'] = _ENDPOINT +DESCRIPTOR.message_types_by_name['ConfigRule'] = _CONFIGRULE +DESCRIPTOR.message_types_by_name['Constraint'] = _CONSTRAINT +DESCRIPTOR.message_types_by_name['TeraFlowController'] = _TERAFLOWCONTROLLER +DESCRIPTOR.message_types_by_name['AuthenticationResult'] = _AUTHENTICATIONRESULT +DESCRIPTOR.enum_types_by_name['EventTypeEnum'] = _EVENTTYPEENUM +DESCRIPTOR.enum_types_by_name['DeviceDriverEnum'] = _DEVICEDRIVERENUM +DESCRIPTOR.enum_types_by_name['DeviceOperationalStatusEnum'] = _DEVICEOPERATIONALSTATUSENUM +DESCRIPTOR.enum_types_by_name['ServiceTypeEnum'] = _SERVICETYPEENUM +DESCRIPTOR.enum_types_by_name['ServiceStatusEnum'] = _SERVICESTATUSENUM +DESCRIPTOR.enum_types_by_name['SliceStatusEnum'] = _SLICESTATUSENUM +DESCRIPTOR.enum_types_by_name['ConfigActionEnum'] = _CONFIGACTIONENUM +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +Empty = _reflection.GeneratedProtocolMessageType('Empty', (_message.Message,), { + 'DESCRIPTOR' : _EMPTY, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Empty) + }) +_sym_db.RegisterMessage(Empty) + +Uuid = _reflection.GeneratedProtocolMessageType('Uuid', (_message.Message,), { + 'DESCRIPTOR' : _UUID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Uuid) + }) +_sym_db.RegisterMessage(Uuid) + +Event = _reflection.GeneratedProtocolMessageType('Event', (_message.Message,), { + 'DESCRIPTOR' : _EVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Event) + }) +_sym_db.RegisterMessage(Event) + +ContextId = _reflection.GeneratedProtocolMessageType('ContextId', (_message.Message,), { + 'DESCRIPTOR' : _CONTEXTID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ContextId) + }) +_sym_db.RegisterMessage(ContextId) + +Context = _reflection.GeneratedProtocolMessageType('Context', (_message.Message,), { + 'DESCRIPTOR' : _CONTEXT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Context) + }) +_sym_db.RegisterMessage(Context) + +ContextIdList = _reflection.GeneratedProtocolMessageType('ContextIdList', (_message.Message,), { + 'DESCRIPTOR' : _CONTEXTIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ContextIdList) + }) +_sym_db.RegisterMessage(ContextIdList) + +ContextList = _reflection.GeneratedProtocolMessageType('ContextList', (_message.Message,), { + 'DESCRIPTOR' : _CONTEXTLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ContextList) + }) +_sym_db.RegisterMessage(ContextList) + +ContextEvent = _reflection.GeneratedProtocolMessageType('ContextEvent', (_message.Message,), { + 'DESCRIPTOR' : _CONTEXTEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ContextEvent) + }) +_sym_db.RegisterMessage(ContextEvent) + +TopologyId = _reflection.GeneratedProtocolMessageType('TopologyId', (_message.Message,), { + 'DESCRIPTOR' : _TOPOLOGYID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.TopologyId) + }) +_sym_db.RegisterMessage(TopologyId) + +Topology = _reflection.GeneratedProtocolMessageType('Topology', (_message.Message,), { + 'DESCRIPTOR' : _TOPOLOGY, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Topology) + }) +_sym_db.RegisterMessage(Topology) + +TopologyIdList = _reflection.GeneratedProtocolMessageType('TopologyIdList', (_message.Message,), { + 'DESCRIPTOR' : _TOPOLOGYIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.TopologyIdList) + }) +_sym_db.RegisterMessage(TopologyIdList) + +TopologyList = _reflection.GeneratedProtocolMessageType('TopologyList', (_message.Message,), { + 'DESCRIPTOR' : _TOPOLOGYLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.TopologyList) + }) +_sym_db.RegisterMessage(TopologyList) + +TopologyEvent = _reflection.GeneratedProtocolMessageType('TopologyEvent', (_message.Message,), { + 'DESCRIPTOR' : _TOPOLOGYEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.TopologyEvent) + }) +_sym_db.RegisterMessage(TopologyEvent) + +DeviceId = _reflection.GeneratedProtocolMessageType('DeviceId', (_message.Message,), { + 'DESCRIPTOR' : _DEVICEID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.DeviceId) + }) +_sym_db.RegisterMessage(DeviceId) + +Device = _reflection.GeneratedProtocolMessageType('Device', (_message.Message,), { + 'DESCRIPTOR' : _DEVICE, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Device) + }) +_sym_db.RegisterMessage(Device) + +DeviceConfig = _reflection.GeneratedProtocolMessageType('DeviceConfig', (_message.Message,), { + 'DESCRIPTOR' : _DEVICECONFIG, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.DeviceConfig) + }) +_sym_db.RegisterMessage(DeviceConfig) + +DeviceIdList = _reflection.GeneratedProtocolMessageType('DeviceIdList', (_message.Message,), { + 'DESCRIPTOR' : _DEVICEIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.DeviceIdList) + }) +_sym_db.RegisterMessage(DeviceIdList) + +DeviceList = _reflection.GeneratedProtocolMessageType('DeviceList', (_message.Message,), { + 'DESCRIPTOR' : _DEVICELIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.DeviceList) + }) +_sym_db.RegisterMessage(DeviceList) + +DeviceEvent = _reflection.GeneratedProtocolMessageType('DeviceEvent', (_message.Message,), { + 'DESCRIPTOR' : _DEVICEEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.DeviceEvent) + }) +_sym_db.RegisterMessage(DeviceEvent) + +LinkId = _reflection.GeneratedProtocolMessageType('LinkId', (_message.Message,), { + 'DESCRIPTOR' : _LINKID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.LinkId) + }) +_sym_db.RegisterMessage(LinkId) + +Link = _reflection.GeneratedProtocolMessageType('Link', (_message.Message,), { + 'DESCRIPTOR' : _LINK, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Link) + }) +_sym_db.RegisterMessage(Link) + +LinkIdList = _reflection.GeneratedProtocolMessageType('LinkIdList', (_message.Message,), { + 'DESCRIPTOR' : _LINKIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.LinkIdList) + }) +_sym_db.RegisterMessage(LinkIdList) + +LinkList = _reflection.GeneratedProtocolMessageType('LinkList', (_message.Message,), { + 'DESCRIPTOR' : _LINKLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.LinkList) + }) +_sym_db.RegisterMessage(LinkList) + +LinkEvent = _reflection.GeneratedProtocolMessageType('LinkEvent', (_message.Message,), { + 'DESCRIPTOR' : _LINKEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.LinkEvent) + }) +_sym_db.RegisterMessage(LinkEvent) + +ServiceId = _reflection.GeneratedProtocolMessageType('ServiceId', (_message.Message,), { + 'DESCRIPTOR' : _SERVICEID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ServiceId) + }) +_sym_db.RegisterMessage(ServiceId) + +Service = _reflection.GeneratedProtocolMessageType('Service', (_message.Message,), { + 'DESCRIPTOR' : _SERVICE, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Service) + }) +_sym_db.RegisterMessage(Service) + +ServiceStatus = _reflection.GeneratedProtocolMessageType('ServiceStatus', (_message.Message,), { + 'DESCRIPTOR' : _SERVICESTATUS, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ServiceStatus) + }) +_sym_db.RegisterMessage(ServiceStatus) + +ServiceConfig = _reflection.GeneratedProtocolMessageType('ServiceConfig', (_message.Message,), { + 'DESCRIPTOR' : _SERVICECONFIG, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ServiceConfig) + }) +_sym_db.RegisterMessage(ServiceConfig) + +ServiceIdList = _reflection.GeneratedProtocolMessageType('ServiceIdList', (_message.Message,), { + 'DESCRIPTOR' : _SERVICEIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ServiceIdList) + }) +_sym_db.RegisterMessage(ServiceIdList) + +ServiceList = _reflection.GeneratedProtocolMessageType('ServiceList', (_message.Message,), { + 'DESCRIPTOR' : _SERVICELIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ServiceList) + }) +_sym_db.RegisterMessage(ServiceList) + +ServiceEvent = _reflection.GeneratedProtocolMessageType('ServiceEvent', (_message.Message,), { + 'DESCRIPTOR' : _SERVICEEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ServiceEvent) + }) +_sym_db.RegisterMessage(ServiceEvent) + +SliceId = _reflection.GeneratedProtocolMessageType('SliceId', (_message.Message,), { + 'DESCRIPTOR' : _SLICEID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceId) + }) +_sym_db.RegisterMessage(SliceId) + +Slice = _reflection.GeneratedProtocolMessageType('Slice', (_message.Message,), { + 'DESCRIPTOR' : _SLICE, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Slice) + }) +_sym_db.RegisterMessage(Slice) + +SliceStatus = _reflection.GeneratedProtocolMessageType('SliceStatus', (_message.Message,), { + 'DESCRIPTOR' : _SLICESTATUS, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceStatus) + }) +_sym_db.RegisterMessage(SliceStatus) + +SliceIdList = _reflection.GeneratedProtocolMessageType('SliceIdList', (_message.Message,), { + 'DESCRIPTOR' : _SLICEIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceIdList) + }) +_sym_db.RegisterMessage(SliceIdList) + +SliceList = _reflection.GeneratedProtocolMessageType('SliceList', (_message.Message,), { + 'DESCRIPTOR' : _SLICELIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceList) + }) +_sym_db.RegisterMessage(SliceList) + +SliceEvent = _reflection.GeneratedProtocolMessageType('SliceEvent', (_message.Message,), { + 'DESCRIPTOR' : _SLICEEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceEvent) + }) +_sym_db.RegisterMessage(SliceEvent) + +ConnectionId = _reflection.GeneratedProtocolMessageType('ConnectionId', (_message.Message,), { + 'DESCRIPTOR' : _CONNECTIONID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ConnectionId) + }) +_sym_db.RegisterMessage(ConnectionId) + +Connection = _reflection.GeneratedProtocolMessageType('Connection', (_message.Message,), { + 'DESCRIPTOR' : _CONNECTION, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Connection) + }) +_sym_db.RegisterMessage(Connection) + +ConnectionIdList = _reflection.GeneratedProtocolMessageType('ConnectionIdList', (_message.Message,), { + 'DESCRIPTOR' : _CONNECTIONIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ConnectionIdList) + }) +_sym_db.RegisterMessage(ConnectionIdList) + +ConnectionList = _reflection.GeneratedProtocolMessageType('ConnectionList', (_message.Message,), { + 'DESCRIPTOR' : _CONNECTIONLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ConnectionList) + }) +_sym_db.RegisterMessage(ConnectionList) + +ConnectionEvent = _reflection.GeneratedProtocolMessageType('ConnectionEvent', (_message.Message,), { + 'DESCRIPTOR' : _CONNECTIONEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ConnectionEvent) + }) +_sym_db.RegisterMessage(ConnectionEvent) + +EndPointId = _reflection.GeneratedProtocolMessageType('EndPointId', (_message.Message,), { + 'DESCRIPTOR' : _ENDPOINTID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.EndPointId) + }) +_sym_db.RegisterMessage(EndPointId) + +EndPoint = _reflection.GeneratedProtocolMessageType('EndPoint', (_message.Message,), { + 'DESCRIPTOR' : _ENDPOINT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.EndPoint) + }) +_sym_db.RegisterMessage(EndPoint) + +ConfigRule = _reflection.GeneratedProtocolMessageType('ConfigRule', (_message.Message,), { + 'DESCRIPTOR' : _CONFIGRULE, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ConfigRule) + }) +_sym_db.RegisterMessage(ConfigRule) + +Constraint = _reflection.GeneratedProtocolMessageType('Constraint', (_message.Message,), { + 'DESCRIPTOR' : _CONSTRAINT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Constraint) + }) +_sym_db.RegisterMessage(Constraint) + +TeraFlowController = _reflection.GeneratedProtocolMessageType('TeraFlowController', (_message.Message,), { + 'DESCRIPTOR' : _TERAFLOWCONTROLLER, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.TeraFlowController) + }) +_sym_db.RegisterMessage(TeraFlowController) + +AuthenticationResult = _reflection.GeneratedProtocolMessageType('AuthenticationResult', (_message.Message,), { + 'DESCRIPTOR' : _AUTHENTICATIONRESULT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.AuthenticationResult) + }) +_sym_db.RegisterMessage(AuthenticationResult) + + + +_CONTEXTSERVICE = _descriptor.ServiceDescriptor( + name='ContextService', + full_name='context.ContextService', + file=DESCRIPTOR, + index=0, + serialized_options=None, + create_key=_descriptor._internal_create_key, + serialized_start=5273, + serialized_end=7688, + methods=[ + _descriptor.MethodDescriptor( + name='ListContextIds', + full_name='context.ContextService.ListContextIds', + index=0, + containing_service=None, + input_type=_EMPTY, + output_type=_CONTEXTIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListContexts', + full_name='context.ContextService.ListContexts', + index=1, + containing_service=None, + input_type=_EMPTY, + output_type=_CONTEXTLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetContext', + full_name='context.ContextService.GetContext', + index=2, + containing_service=None, + input_type=_CONTEXTID, + output_type=_CONTEXT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetContext', + full_name='context.ContextService.SetContext', + index=3, + containing_service=None, + input_type=_CONTEXT, + output_type=_CONTEXTID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveContext', + full_name='context.ContextService.RemoveContext', + index=4, + containing_service=None, + input_type=_CONTEXTID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetContextEvents', + full_name='context.ContextService.GetContextEvents', + index=5, + containing_service=None, + input_type=_EMPTY, + output_type=_CONTEXTEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListTopologyIds', + full_name='context.ContextService.ListTopologyIds', + index=6, + containing_service=None, + input_type=_CONTEXTID, + output_type=_TOPOLOGYIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListTopologies', + full_name='context.ContextService.ListTopologies', + index=7, + containing_service=None, + input_type=_CONTEXTID, + output_type=_TOPOLOGYLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetTopology', + full_name='context.ContextService.GetTopology', + index=8, + containing_service=None, + input_type=_TOPOLOGYID, + output_type=_TOPOLOGY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetTopology', + full_name='context.ContextService.SetTopology', + index=9, + containing_service=None, + input_type=_TOPOLOGY, + output_type=_TOPOLOGYID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveTopology', + full_name='context.ContextService.RemoveTopology', + index=10, + containing_service=None, + input_type=_TOPOLOGYID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetTopologyEvents', + full_name='context.ContextService.GetTopologyEvents', + index=11, + containing_service=None, + input_type=_EMPTY, + output_type=_TOPOLOGYEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListDeviceIds', + full_name='context.ContextService.ListDeviceIds', + index=12, + containing_service=None, + input_type=_EMPTY, + output_type=_DEVICEIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListDevices', + full_name='context.ContextService.ListDevices', + index=13, + containing_service=None, + input_type=_EMPTY, + output_type=_DEVICELIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetDevice', + full_name='context.ContextService.GetDevice', + index=14, + containing_service=None, + input_type=_DEVICEID, + output_type=_DEVICE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetDevice', + full_name='context.ContextService.SetDevice', + index=15, + containing_service=None, + input_type=_DEVICE, + output_type=_DEVICEID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveDevice', + full_name='context.ContextService.RemoveDevice', + index=16, + containing_service=None, + input_type=_DEVICEID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetDeviceEvents', + full_name='context.ContextService.GetDeviceEvents', + index=17, + containing_service=None, + input_type=_EMPTY, + output_type=_DEVICEEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListLinkIds', + full_name='context.ContextService.ListLinkIds', + index=18, + containing_service=None, + input_type=_EMPTY, + output_type=_LINKIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListLinks', + full_name='context.ContextService.ListLinks', + index=19, + containing_service=None, + input_type=_EMPTY, + output_type=_LINKLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetLink', + full_name='context.ContextService.GetLink', + index=20, + containing_service=None, + input_type=_LINKID, + output_type=_LINK, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetLink', + full_name='context.ContextService.SetLink', + index=21, + containing_service=None, + input_type=_LINK, + output_type=_LINKID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveLink', + full_name='context.ContextService.RemoveLink', + index=22, + containing_service=None, + input_type=_LINKID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetLinkEvents', + full_name='context.ContextService.GetLinkEvents', + index=23, + containing_service=None, + input_type=_EMPTY, + output_type=_LINKEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListServiceIds', + full_name='context.ContextService.ListServiceIds', + index=24, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SERVICEIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListServices', + full_name='context.ContextService.ListServices', + index=25, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SERVICELIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetService', + full_name='context.ContextService.GetService', + index=26, + containing_service=None, + input_type=_SERVICEID, + output_type=_SERVICE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetService', + full_name='context.ContextService.SetService', + index=27, + containing_service=None, + input_type=_SERVICE, + output_type=_SERVICEID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveService', + full_name='context.ContextService.RemoveService', + index=28, + containing_service=None, + input_type=_SERVICEID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetServiceEvents', + full_name='context.ContextService.GetServiceEvents', + index=29, + containing_service=None, + input_type=_EMPTY, + output_type=_SERVICEEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListSliceIds', + full_name='context.ContextService.ListSliceIds', + index=30, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SLICEIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListSlices', + full_name='context.ContextService.ListSlices', + index=31, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SLICELIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetSlice', + full_name='context.ContextService.GetSlice', + index=32, + containing_service=None, + input_type=_SLICEID, + output_type=_SLICE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetSlice', + full_name='context.ContextService.SetSlice', + index=33, + containing_service=None, + input_type=_SLICE, + output_type=_SLICEID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveSlice', + full_name='context.ContextService.RemoveSlice', + index=34, + containing_service=None, + input_type=_SLICEID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetSliceEvents', + full_name='context.ContextService.GetSliceEvents', + index=35, + containing_service=None, + input_type=_EMPTY, + output_type=_SLICEEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListConnectionIds', + full_name='context.ContextService.ListConnectionIds', + index=36, + containing_service=None, + input_type=_SERVICEID, + output_type=_CONNECTIONIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListConnections', + full_name='context.ContextService.ListConnections', + index=37, + containing_service=None, + input_type=_SERVICEID, + output_type=_CONNECTIONLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetConnection', + full_name='context.ContextService.GetConnection', + index=38, + containing_service=None, + input_type=_CONNECTIONID, + output_type=_CONNECTION, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetConnection', + full_name='context.ContextService.SetConnection', + index=39, + containing_service=None, + input_type=_CONNECTION, + output_type=_CONNECTIONID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveConnection', + full_name='context.ContextService.RemoveConnection', + index=40, + containing_service=None, + input_type=_CONNECTIONID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetConnectionEvents', + full_name='context.ContextService.GetConnectionEvents', + index=41, + containing_service=None, + input_type=_EMPTY, + output_type=_CONNECTIONEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), +]) +_sym_db.RegisterServiceDescriptor(_CONTEXTSERVICE) + +DESCRIPTOR.services_by_name['ContextService'] = _CONTEXTSERVICE + +# @@protoc_insertion_point(module_scope) diff --git a/src/interdomain/proto/interdomain_pb2.py b/src/interdomain/proto/interdomain_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..3f2dff89f4f102cd6e19c52417f26504b8015f21 --- /dev/null +++ b/src/interdomain/proto/interdomain_pb2.py @@ -0,0 +1,98 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: interdomain.proto +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from . import context_pb2 as context__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='interdomain.proto', + package='interdomain', + syntax='proto3', + serialized_options=None, + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n\x11interdomain.proto\x12\x0binterdomain\x1a\rcontext.proto2\xc4\x02\n\x12InterdomainService\x12\x32\n\x0cRequestSlice\x12\x0e.context.Slice\x1a\x10.context.SliceId\"\x00\x12L\n\x0c\x41uthenticate\x12\x1b.context.TeraFlowController\x1a\x1d.context.AuthenticationResult\"\x00\x12\x31\n\x0bLookUpSlice\x12\x0e.context.Slice\x1a\x10.context.SliceId\"\x00\x12\x39\n\x15OrderSliceFromCatalog\x12\x0e.context.Slice\x1a\x0e.context.Slice\"\x00\x12>\n\x1a\x43reateSliceAndAddToCatalog\x12\x0e.context.Slice\x1a\x0e.context.Slice\"\x00\x62\x06proto3' + , + dependencies=[context__pb2.DESCRIPTOR,]) + + + +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + + + +_INTERDOMAINSERVICE = _descriptor.ServiceDescriptor( + name='InterdomainService', + full_name='interdomain.InterdomainService', + file=DESCRIPTOR, + index=0, + serialized_options=None, + create_key=_descriptor._internal_create_key, + serialized_start=50, + serialized_end=374, + methods=[ + _descriptor.MethodDescriptor( + name='RequestSlice', + full_name='interdomain.InterdomainService.RequestSlice', + index=0, + containing_service=None, + input_type=context__pb2._SLICE, + output_type=context__pb2._SLICEID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='Authenticate', + full_name='interdomain.InterdomainService.Authenticate', + index=1, + containing_service=None, + input_type=context__pb2._TERAFLOWCONTROLLER, + output_type=context__pb2._AUTHENTICATIONRESULT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='LookUpSlice', + full_name='interdomain.InterdomainService.LookUpSlice', + index=2, + containing_service=None, + input_type=context__pb2._SLICE, + output_type=context__pb2._SLICEID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='OrderSliceFromCatalog', + full_name='interdomain.InterdomainService.OrderSliceFromCatalog', + index=3, + containing_service=None, + input_type=context__pb2._SLICE, + output_type=context__pb2._SLICE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='CreateSliceAndAddToCatalog', + full_name='interdomain.InterdomainService.CreateSliceAndAddToCatalog', + index=4, + containing_service=None, + input_type=context__pb2._SLICE, + output_type=context__pb2._SLICE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), +]) +_sym_db.RegisterServiceDescriptor(_INTERDOMAINSERVICE) + +DESCRIPTOR.services_by_name['InterdomainService'] = _INTERDOMAINSERVICE + +# @@protoc_insertion_point(module_scope) diff --git a/src/interdomain/proto/interdomain_pb2_grpc.py b/src/interdomain/proto/interdomain_pb2_grpc.py new file mode 100644 index 0000000000000000000000000000000000000000..0973228d0dd09b47353d93b36a4457290beb3068 --- /dev/null +++ b/src/interdomain/proto/interdomain_pb2_grpc.py @@ -0,0 +1,198 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc + +from . import context_pb2 as context__pb2 + + +class InterdomainServiceStub(object): + """Missing associated documentation comment in .proto file.""" + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.RequestSlice = channel.unary_unary( + '/interdomain.InterdomainService/RequestSlice', + request_serializer=context__pb2.Slice.SerializeToString, + response_deserializer=context__pb2.SliceId.FromString, + ) + self.Authenticate = channel.unary_unary( + '/interdomain.InterdomainService/Authenticate', + request_serializer=context__pb2.TeraFlowController.SerializeToString, + response_deserializer=context__pb2.AuthenticationResult.FromString, + ) + self.LookUpSlice = channel.unary_unary( + '/interdomain.InterdomainService/LookUpSlice', + request_serializer=context__pb2.Slice.SerializeToString, + response_deserializer=context__pb2.SliceId.FromString, + ) + self.OrderSliceFromCatalog = channel.unary_unary( + '/interdomain.InterdomainService/OrderSliceFromCatalog', + request_serializer=context__pb2.Slice.SerializeToString, + response_deserializer=context__pb2.Slice.FromString, + ) + self.CreateSliceAndAddToCatalog = channel.unary_unary( + '/interdomain.InterdomainService/CreateSliceAndAddToCatalog', + request_serializer=context__pb2.Slice.SerializeToString, + response_deserializer=context__pb2.Slice.FromString, + ) + + +class InterdomainServiceServicer(object): + """Missing associated documentation comment in .proto file.""" + + def RequestSlice(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Authenticate(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def LookUpSlice(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def OrderSliceFromCatalog(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def CreateSliceAndAddToCatalog(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_InterdomainServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + 'RequestSlice': grpc.unary_unary_rpc_method_handler( + servicer.RequestSlice, + request_deserializer=context__pb2.Slice.FromString, + response_serializer=context__pb2.SliceId.SerializeToString, + ), + 'Authenticate': grpc.unary_unary_rpc_method_handler( + servicer.Authenticate, + request_deserializer=context__pb2.TeraFlowController.FromString, + response_serializer=context__pb2.AuthenticationResult.SerializeToString, + ), + 'LookUpSlice': grpc.unary_unary_rpc_method_handler( + servicer.LookUpSlice, + request_deserializer=context__pb2.Slice.FromString, + response_serializer=context__pb2.SliceId.SerializeToString, + ), + 'OrderSliceFromCatalog': grpc.unary_unary_rpc_method_handler( + servicer.OrderSliceFromCatalog, + request_deserializer=context__pb2.Slice.FromString, + response_serializer=context__pb2.Slice.SerializeToString, + ), + 'CreateSliceAndAddToCatalog': grpc.unary_unary_rpc_method_handler( + servicer.CreateSliceAndAddToCatalog, + request_deserializer=context__pb2.Slice.FromString, + response_serializer=context__pb2.Slice.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'interdomain.InterdomainService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + + + # This class is part of an EXPERIMENTAL API. +class InterdomainService(object): + """Missing associated documentation comment in .proto file.""" + + @staticmethod + def RequestSlice(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/interdomain.InterdomainService/RequestSlice', + context__pb2.Slice.SerializeToString, + context__pb2.SliceId.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def Authenticate(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/interdomain.InterdomainService/Authenticate', + context__pb2.TeraFlowController.SerializeToString, + context__pb2.AuthenticationResult.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def LookUpSlice(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/interdomain.InterdomainService/LookUpSlice', + context__pb2.Slice.SerializeToString, + context__pb2.SliceId.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def OrderSliceFromCatalog(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/interdomain.InterdomainService/OrderSliceFromCatalog', + context__pb2.Slice.SerializeToString, + context__pb2.Slice.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def CreateSliceAndAddToCatalog(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/interdomain.InterdomainService/CreateSliceAndAddToCatalog', + context__pb2.Slice.SerializeToString, + context__pb2.Slice.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/src/interdomain/proto/kpi_sample_types_pb2.py b/src/interdomain/proto/kpi_sample_types_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..ea7fd2f82757d4c3db02d7e2c7817e2787b0b490 --- /dev/null +++ b/src/interdomain/proto/kpi_sample_types_pb2.py @@ -0,0 +1,78 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: kpi_sample_types.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='kpi_sample_types.proto', + package='kpi_sample_types', + syntax='proto3', + serialized_options=None, + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n\x16kpi_sample_types.proto\x12\x10kpi_sample_types*\xbe\x01\n\rKpiSampleType\x12\x19\n\x15KPISAMPLETYPE_UNKNOWN\x10\x00\x12%\n!KPISAMPLETYPE_PACKETS_TRANSMITTED\x10\x65\x12\"\n\x1eKPISAMPLETYPE_PACKETS_RECEIVED\x10\x66\x12$\n\x1fKPISAMPLETYPE_BYTES_TRANSMITTED\x10\xc9\x01\x12!\n\x1cKPISAMPLETYPE_BYTES_RECEIVED\x10\xca\x01\x62\x06proto3' +) + +_KPISAMPLETYPE = _descriptor.EnumDescriptor( + name='KpiSampleType', + full_name='kpi_sample_types.KpiSampleType', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='KPISAMPLETYPE_UNKNOWN', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='KPISAMPLETYPE_PACKETS_TRANSMITTED', index=1, number=101, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='KPISAMPLETYPE_PACKETS_RECEIVED', index=2, number=102, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='KPISAMPLETYPE_BYTES_TRANSMITTED', index=3, number=201, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='KPISAMPLETYPE_BYTES_RECEIVED', index=4, number=202, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=45, + serialized_end=235, +) +_sym_db.RegisterEnumDescriptor(_KPISAMPLETYPE) + +KpiSampleType = enum_type_wrapper.EnumTypeWrapper(_KPISAMPLETYPE) +KPISAMPLETYPE_UNKNOWN = 0 +KPISAMPLETYPE_PACKETS_TRANSMITTED = 101 +KPISAMPLETYPE_PACKETS_RECEIVED = 102 +KPISAMPLETYPE_BYTES_TRANSMITTED = 201 +KPISAMPLETYPE_BYTES_RECEIVED = 202 + + +DESCRIPTOR.enum_types_by_name['KpiSampleType'] = _KPISAMPLETYPE +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + + +# @@protoc_insertion_point(module_scope) diff --git a/src/interdomain/proto/slice_pb2.py b/src/interdomain/proto/slice_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..1e2a5f31cbbfa8f0d8ca664301b85d9e28a15782 --- /dev/null +++ b/src/interdomain/proto/slice_pb2.py @@ -0,0 +1,78 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: slice.proto +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from . import context_pb2 as context__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='slice.proto', + package='slice', + syntax='proto3', + serialized_options=None, + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n\x0bslice.proto\x12\x05slice\x1a\rcontext.proto2\xa7\x01\n\x0cSliceService\x12\x31\n\x0b\x43reateSlice\x12\x0e.context.Slice\x1a\x10.context.SliceId\"\x00\x12\x31\n\x0bUpdateSlice\x12\x0e.context.Slice\x1a\x10.context.SliceId\"\x00\x12\x31\n\x0b\x44\x65leteSlice\x12\x10.context.SliceId\x1a\x0e.context.Empty\"\x00\x62\x06proto3' + , + dependencies=[context__pb2.DESCRIPTOR,]) + + + +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + + + +_SLICESERVICE = _descriptor.ServiceDescriptor( + name='SliceService', + full_name='slice.SliceService', + file=DESCRIPTOR, + index=0, + serialized_options=None, + create_key=_descriptor._internal_create_key, + serialized_start=38, + serialized_end=205, + methods=[ + _descriptor.MethodDescriptor( + name='CreateSlice', + full_name='slice.SliceService.CreateSlice', + index=0, + containing_service=None, + input_type=context__pb2._SLICE, + output_type=context__pb2._SLICEID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='UpdateSlice', + full_name='slice.SliceService.UpdateSlice', + index=1, + containing_service=None, + input_type=context__pb2._SLICE, + output_type=context__pb2._SLICEID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='DeleteSlice', + full_name='slice.SliceService.DeleteSlice', + index=2, + containing_service=None, + input_type=context__pb2._SLICEID, + output_type=context__pb2._EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), +]) +_sym_db.RegisterServiceDescriptor(_SLICESERVICE) + +DESCRIPTOR.services_by_name['SliceService'] = _SLICESERVICE + +# @@protoc_insertion_point(module_scope) diff --git a/src/interdomain/requirements.in b/src/interdomain/requirements.in new file mode 100644 index 0000000000000000000000000000000000000000..162ecde82a076fce597850ac8d71de3880c9a5eb --- /dev/null +++ b/src/interdomain/requirements.in @@ -0,0 +1,6 @@ +grpcio==1.43.0 +grpcio-health-checking==1.43.0 +prometheus-client==0.13.0 +protobuf==3.19.3 +pytest==6.2.5 +pytest-benchmark==3.4.1 diff --git a/src/interdomain/service/InterdomainService.py b/src/interdomain/service/InterdomainService.py new file mode 100644 index 0000000000000000000000000000000000000000..cca6bcb85869b53d644e510e8581de20f1e9c825 --- /dev/null +++ b/src/interdomain/service/InterdomainService.py @@ -0,0 +1,29 @@ +# 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. + +from common.Constants import ServiceNameEnum +from common.Settings import get_service_port_grpc +from common.tools.service.GenericGrpcService import GenericGrpcService +from interdomain.proto.interdomain_pb2_grpc import add_InterdomainServiceServicer_to_server +from .InterdomainServiceServicerImpl import InterdomainServiceServicerImpl +from .RemoteDomainClients import RemoteDomainClients + +class InterdomainService(GenericGrpcService): + def __init__(self, remote_domain_clients : RemoteDomainClients, cls_name: str = __name__) -> None: + port = get_service_port_grpc(ServiceNameEnum.INTERDOMAIN) + super().__init__(port, cls_name=cls_name) + self.interdomain_servicer = InterdomainServiceServicerImpl(remote_domain_clients) + + def install_servicers(self): + add_InterdomainServiceServicer_to_server(self.interdomain_servicer, self.server) diff --git a/src/interdomain/service/InterdomainServiceServicerImpl.py b/src/interdomain/service/InterdomainServiceServicerImpl.py new file mode 100644 index 0000000000000000000000000000000000000000..20ae74eef816fdb3fbf7352913673cb51f222ba8 --- /dev/null +++ b/src/interdomain/service/InterdomainServiceServicerImpl.py @@ -0,0 +1,153 @@ +# 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. + +import grpc, logging +from common.rpc_method_wrapper.Decorator import create_metrics, safe_and_metered_rpc_method +#from common.tools.grpc.Tools import grpc_message_to_json_string +from context.client.ContextClient import ContextClient +from context.proto.context_pb2 import SliceStatusEnum +from interdomain.proto.context_pb2 import AuthenticationResult, Slice, SliceId, SliceStatus, TeraFlowController +from interdomain.proto.interdomain_pb2_grpc import InterdomainServiceServicer +from interdomain.service.RemoteDomainClients import RemoteDomainClients +from slice.client.SliceClient import SliceClient + +LOGGER = logging.getLogger(__name__) + +SERVICE_NAME = 'Interdomain' +METHOD_NAMES = ['RequestSlice', 'Authenticate', 'LookUpSlice', 'OrderSliceFromCatalog', 'CreateSliceAndAddToCatalog'] +METRICS = create_metrics(SERVICE_NAME, METHOD_NAMES) + +class InterdomainServiceServicerImpl(InterdomainServiceServicer): + def __init__(self, remote_domain_clients : RemoteDomainClients): + LOGGER.debug('Creating Servicer...') + self.remote_domain_clients = remote_domain_clients + LOGGER.debug('Servicer Created') + + @safe_and_metered_rpc_method(METRICS, LOGGER) + def RequestSlice(self, request : Slice, context : grpc.ServicerContext) -> SliceId: + context_client = ContextClient() + slice_client = SliceClient() + + domains_to_endpoints = {} + local_domain_uuid = None + for slice_endpoint_id in request.slice_endpoint_ids: + device_uuid = slice_endpoint_id.device_id.device_uuid.uuid + domain_uuid = device_uuid.split('@')[1] + endpoints = domains_to_endpoints.setdefault(domain_uuid, []) + endpoints.append(slice_endpoint_id) + if local_domain_uuid is None: local_domain_uuid = domain_uuid + + reply = Slice() + reply.CopyFrom(request) + + # decompose remote slices + for domain_uuid, slice_endpoint_ids in domains_to_endpoints.items(): + if domain_uuid == local_domain_uuid: continue + + remote_slice_request = Slice() + remote_slice_request.slice_id.context_id.context_uuid.uuid = request.slice_id.context_id.context_uuid.uuid + remote_slice_request.slice_id.slice_uuid.uuid = \ + request.slice_id.slice_uuid.uuid + ':subslice@' + local_domain_uuid + remote_slice_request.slice_status.slice_status = request.slice_status.slice_status + for endpoint_id in slice_endpoint_ids: + slice_endpoint_id = remote_slice_request.slice_endpoint_ids.add() + slice_endpoint_id.device_id.device_uuid.uuid = endpoint_id.device_id.device_uuid.uuid + slice_endpoint_id.endpoint_uuid.uuid = endpoint_id.endpoint_uuid.uuid + + # add endpoint connecting to remote domain + if domain_uuid == 'D1': + slice_endpoint_id = remote_slice_request.slice_endpoint_ids.add() + slice_endpoint_id.device_id.device_uuid.uuid = 'R4@D1' + slice_endpoint_id.endpoint_uuid.uuid = '2/1' + elif domain_uuid == 'D2': + slice_endpoint_id = remote_slice_request.slice_endpoint_ids.add() + slice_endpoint_id.device_id.device_uuid.uuid = 'R1@D2' + slice_endpoint_id.endpoint_uuid.uuid = '2/1' + + interdomain_client = self.remote_domain_clients.get_peer('remote-teraflow') + remote_slice_reply = interdomain_client.LookUpSlice(remote_slice_request) + if remote_slice_reply == remote_slice_request.slice_id: # pylint: disable=no-member + # successful case + remote_slice = interdomain_client.OrderSliceFromCatalog(remote_slice_request) + if remote_slice.slice_status.slice_status != SliceStatusEnum.SLICESTATUS_ACTIVE: + raise Exception('Remote Slice creation failed. Wrong Slice status returned') + else: + # not in catalog + remote_slice = interdomain_client.CreateSliceAndAddToCatalog(remote_slice_request) + if remote_slice.slice_status.slice_status != SliceStatusEnum.SLICESTATUS_ACTIVE: + raise Exception('Remote Slice creation failed. Wrong Slice status returned') + + #context_client.SetSlice(remote_slice) + #subslice_id = reply.slice_subslice_ids.add() + #subslice_id.CopyFrom(remote_slice.slice_id) + + local_slice_request = Slice() + local_slice_request.slice_id.context_id.context_uuid.uuid = request.slice_id.context_id.context_uuid.uuid + local_slice_request.slice_id.slice_uuid.uuid = request.slice_id.slice_uuid.uuid + ':subslice' + local_slice_request.slice_status.slice_status = request.slice_status.slice_status + for endpoint_id in domains_to_endpoints[local_domain_uuid]: + slice_endpoint_id = local_slice_request.slice_endpoint_ids.add() + slice_endpoint_id.CopyFrom(endpoint_id) + + # add endpoint connecting to remote domain + if local_domain_uuid == 'D1': + slice_endpoint_id = local_slice_request.slice_endpoint_ids.add() + slice_endpoint_id.device_id.device_uuid.uuid = 'R4@D1' + slice_endpoint_id.endpoint_uuid.uuid = '2/1' + elif local_domain_uuid == 'D2': + slice_endpoint_id = local_slice_request.slice_endpoint_ids.add() + slice_endpoint_id.device_id.device_uuid.uuid = 'R1@D2' + slice_endpoint_id.endpoint_uuid.uuid = '2/1' + + local_slice_reply = slice_client.CreateSlice(local_slice_request) + if local_slice_reply != local_slice_request.slice_id: # pylint: disable=no-member + raise Exception('Local Slice creation failed. Wrong Slice Id was returned') + + subslice_id = reply.slice_subslice_ids.add() + subslice_id.context_id.context_uuid.uuid = local_slice_request.slice_id.context_id.context_uuid.uuid + subslice_id.slice_uuid.uuid = local_slice_request.slice_id.slice_uuid.uuid + + context_client.SetSlice(reply) + return reply.slice_id + + @safe_and_metered_rpc_method(METRICS, LOGGER) + def Authenticate(self, request : TeraFlowController, context : grpc.ServicerContext) -> AuthenticationResult: + auth_result = AuthenticationResult() + auth_result.context_id.CopyFrom(request.context_id) # pylint: disable=no-member + auth_result.authenticated = True + return auth_result + + @safe_and_metered_rpc_method(METRICS, LOGGER) + def LookUpSlice(self, request : Slice, context : grpc.ServicerContext) -> SliceId: + try: + context_client = ContextClient() + slice_ = context_client.GetSlice(request.slice_id) + return slice_.slice_id + except grpc.RpcError: + #LOGGER.exception('Unable to get slice({:s})'.format(grpc_message_to_json_string(request.slice_id))) + return SliceId() + + @safe_and_metered_rpc_method(METRICS, LOGGER) + def OrderSliceFromCatalog(self, request : Slice, context : grpc.ServicerContext) -> Slice: + raise NotImplementedError('OrderSliceFromCatalog') + #return Slice() + + @safe_and_metered_rpc_method(METRICS, LOGGER) + def CreateSliceAndAddToCatalog(self, request : Slice, context : grpc.ServicerContext) -> Slice: + context_client = ContextClient() + slice_client = SliceClient() + reply = slice_client.CreateSlice(request) + if reply != request.slice_id: # pylint: disable=no-member + raise Exception('Slice creation failed. Wrong Slice Id was returned') + return context_client.GetSlice(request.slice_id) diff --git a/src/interdomain/service/RemoteDomainClients.py b/src/interdomain/service/RemoteDomainClients.py new file mode 100644 index 0000000000000000000000000000000000000000..8fde3f4422b2febc7374f08536c0015bfd4719e4 --- /dev/null +++ b/src/interdomain/service/RemoteDomainClients.py @@ -0,0 +1,56 @@ +# 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. + +import logging, socket +from common.Constants import DEFAULT_CONTEXT_UUID +from common.Settings import get_setting +from interdomain.Config import GRPC_SERVICE_PORT +from interdomain.client.InterdomainClient import InterdomainClient +from interdomain.proto.context_pb2 import TeraFlowController + +LOGGER = logging.getLogger(__name__) + +class RemoteDomainClients: + def __init__(self) -> None: + self.peer_domain = {} + + def add_peer( + self, domain_name : str, host : str, port : int, context_uuid : str = DEFAULT_CONTEXT_UUID + ) -> None: + while True: + try: + remote_teraflow_ip = socket.gethostbyname(host) + if len(remote_teraflow_ip) > 0: break + except socket.gaierror as e: + if str(e) == '[Errno -2] Name or service not known': continue + + interdomain_client = InterdomainClient(host=host, port=port) + request = TeraFlowController() + request.context_id.context_uuid.uuid = DEFAULT_CONTEXT_UUID # pylint: disable=no-member + request.ip_address = get_setting('INTERDOMAINSERVICE_SERVICE_HOST', default='0.0.0.0') + request.port = int(get_setting('INTERDOMAINSERVICE_SERVICE_PORT_GRPC', default=GRPC_SERVICE_PORT)) + + reply = interdomain_client.Authenticate(request) + if not reply.authenticated: + msg = 'Authentication against {:s}:{:d} rejected' + raise Exception(msg.format(str(remote_teraflow_ip), GRPC_SERVICE_PORT)) + + self.peer_domain[domain_name] = interdomain_client + + def get_peer(self, domain_name : str) -> InterdomainClient: + LOGGER.warning('peers: {:s}'.format(str(self.peer_domain))) + return self.peer_domain.get(domain_name) + + def remove_peer(self, domain_name : str) -> None: + return self.peer_domain.pop(domain_name, None) diff --git a/src/interdomain/service/__init__.py b/src/interdomain/service/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/interdomain/service/__init__.py @@ -0,0 +1,14 @@ +# 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. + diff --git a/src/interdomain/service/__main__.py b/src/interdomain/service/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..c0a078f4ded85ab957011d21d56c97c8d303dc2a --- /dev/null +++ b/src/interdomain/service/__main__.py @@ -0,0 +1,75 @@ +# 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. + +import logging, signal, sys, threading +from prometheus_client import start_http_server +from common.Constants import ServiceNameEnum +from common.Settings import ( + ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_log_level, get_metrics_port, + get_service_port_grpc, wait_for_environment_variables) +from .InterdomainService import InterdomainService +from .RemoteDomainClients import RemoteDomainClients + +terminate = threading.Event() +LOGGER : logging.Logger = None + +def signal_handler(signal, frame): # pylint: disable=redefined-outer-name + LOGGER.warning('Terminate signal received') + terminate.set() + +def main(): + global LOGGER # pylint: disable=global-statement + + log_level = get_log_level() + logging.basicConfig(level=log_level) + LOGGER = logging.getLogger(__name__) + + wait_for_environment_variables([ + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_HOST ), + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC), + get_env_var_name(ServiceNameEnum.SLICE, ENVVAR_SUFIX_SERVICE_HOST ), + get_env_var_name(ServiceNameEnum.SLICE, ENVVAR_SUFIX_SERVICE_PORT_GRPC), + ]) + + signal.signal(signal.SIGINT, signal_handler) + signal.signal(signal.SIGTERM, signal_handler) + + LOGGER.info('Starting...') + + # Start metrics server + metrics_port = get_metrics_port() + start_http_server(metrics_port) + + # Define remote domain clients + remote_domain_clients = RemoteDomainClients() + + # Starting Interdomain service + grpc_service = InterdomainService(remote_domain_clients) + grpc_service.start() + + # TODO: improve with configuration the definition of the remote peers + interdomain_service_port_grpc = get_service_port_grpc(ServiceNameEnum.INTERDOMAIN) + remote_domain_clients.add_peer('remote-teraflow', 'remote-teraflow', interdomain_service_port_grpc) + + # Wait for Ctrl+C or termination signal + while not terminate.wait(timeout=0.1): pass + + LOGGER.info('Terminating...') + grpc_service.stop() + + LOGGER.info('Bye') + return 0 + +if __name__ == '__main__': + sys.exit(main()) diff --git a/src/interdomain/tests/__init__.py b/src/interdomain/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/interdomain/tests/__init__.py @@ -0,0 +1,14 @@ +# 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. + diff --git a/src/interdomain/tests/test_unitary.py b/src/interdomain/tests/test_unitary.py new file mode 100644 index 0000000000000000000000000000000000000000..7fe1acc7cec5cbf3663dc7db68c45a22b56d3a6d --- /dev/null +++ b/src/interdomain/tests/test_unitary.py @@ -0,0 +1,143 @@ +# 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. + + +#import logging, grpc +#import os +#import sqlite3 +# +#import pytest +#from typing import Tuple +# +#from interdomain.proto import context_pb2, kpi_sample_types_pb2, monitoring_pb2 +#from interdomain.client.interdomain_client import InterdomainClient +#from interdomain.Config import GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD +#from interdomain.service.InterdomainService import InterdomainService +# +#from common.orm.Database import Database +#from common.orm.Factory import get_database_backend, BackendEnum as DatabaseBackendEnum +#from common.message_broker.Factory import get_messagebroker_backend, BackendEnum as MessageBrokerBackendEnum +#from common.message_broker.MessageBroker import MessageBroker +# +#LOGGER = logging.getLogger(__name__) +#LOGGER.setLevel(logging.DEBUG) +# +############################ +## Tests Setup +############################ +# +#SERVER_ADDRESS = '127.0.0.1' +#LISTEN_ADDRESS = '[::]' +#GRPC_PORT_MONITORING = 9090 +# +#GRPC_PORT_CONTEXT = 10000 + grpc_port_context # avoid privileged ports +# +#SCENARIOS = [ # comment/uncomment scenarios to activate/deactivate them in the test unit +# ('all_inmemory', DatabaseBackendEnum.INMEMORY, {}, MessageBrokerBackendEnum.INMEMORY, {} ), +#] +# +# +## This fixture will be requested by test cases and last during testing session +#@pytest.fixture(scope='session') +#def interdomain_service(): +# LOGGER.warning('interdomain_service begin') +# +# interdomain_port = GRPC_INTERDOMAIN_PORT +# max_workers = GRPC_MAX_WORKERS +# grace_period = GRPC_GRACE_PERIOD +# +# LOGGER.info('Initializing InterdomainService...') +# grpc_service = InterdomainService(port=interdomain_port, max_workers=max_workers, grace_period=grace_period) +# server = grpc_service.start() +# +# # yield the server, when test finishes, execution will resume to stop it +# LOGGER.warning('interdomain_service yielding') +# yield server +# +# LOGGER.info('Terminating InterdomainService...') +# grpc_service.stop() +# +## This fixture will be requested by test cases and last during testing session. +## The client requires the server, so client fixture has the server as dependency. +#@pytest.fixture(scope='session') +#def interdomain_client(interdomain_service): +# LOGGER.warning('interdomain_client begin') +# client = InterdomainClient(server=SERVER_ADDRESS, port=GRPC_PORT_INTERDOMAIN) # instantiate the client +# LOGGER.warning('interdomain_client returning') +# return client +# +## This fixture will be requested by test cases and last during testing session. +#@pytest.fixture(scope='session') +#def create_TeraFlowController(): +# LOGGER.warning('create_TeraFlowController begin') +# # form request +# tf_ctl = context_pb2.TeraFlowController() +# tf_ctl.context_id = context_pb2.ContextId() +# tf_ctl.context_id.context_uuid = context_pb2.Uuid() +# tf_ctl.context_id.context_uuid.uuid = str(1) +# tf_ctl.ip_address = "127.0.0.1" +# tf_ctl.port = 9090 +# return tf_ctl +# +#@pytest.fixture(scope='session') +#def create_TransportSlice(): +# LOGGER.warning('create_TransportSlice begin') +# +# # form request +# slice_req = slice_pb2.TransportSlice() +# slice_req.contextId = context_pb2.ContextId() +# slice_req.contextId.context_uuid = context_pb2.Uuid() +# slice_req.contextId.context_uuid.uuid = str(1) +# slice_req.slice_id = context_pb2.Uuid() +# slice_req.slice_id.context_uuid.uuid = str(1) +# +# return slice_req +# +# +############################ +## Tests Implementation +############################ +# +# +## Test case that makes use of client fixture to test server's CreateKpi method +#def test_Authenticate(interdomain_client,create_TeraFlowController): +# # make call to server +# LOGGER.warning('test_Authenticate requesting') +# response = interdomain_client.Authenticate(create_TeraFlowController) +# LOGGER.debug(str(response)) +# assert isinstance(response, context.AuthenticationResult) +# +## Test case that makes use of client fixture to test server's MonitorKpi method +#def test_LookUpSlice(interdomain_client,create_TransportSlice): +# LOGGER.warning('test_LookUpSlice begin') +# +# response = interdomain_client.LookUpSlice(create_TransportSlice) +# LOGGER.debug(str(response)) +# assert isinstance(response, slice.SliceId) +# +## Test case that makes use of client fixture to test server's GetStreamKpi method +#def test_CreateSliceAndAddToCatalog(interdomain_client,create_TransportSlice): +# LOGGER.warning('test_CreateSliceAndAddToCatalog begin') +# response = interdomain_client.CreateSliceAndAddToCatalog(create_TransportSlice) +# LOGGER.debug(str(response)) +# assert isinstance(response, slice.SliceId) +# +## Test case that makes use of client fixture to test server's IncludeKpi method +#def test_OrderSliceFromCatalog(interdomain_client,create_TransportSlice): +# # make call to server +# LOGGER.warning('test_OrderSliceFromCatalog requesting') +# response = interdomain_client.OrderSliceFromCatalog(create_TransportSlice) +# LOGGER.debug(str(response)) +# assert isinstance(response, slice.SliceId) +# diff --git a/src/l3_attackmitigator/.gitlab-ci.yml b/src/l3_attackmitigator/.gitlab-ci.yml index dbf8d90fcbcb38a0574de4130b4181e77cf5afd6..28d5ad4cf109cd438da2625a08689b327688ea37 100644 --- a/src/l3_attackmitigator/.gitlab-ci.yml +++ b/src/l3_attackmitigator/.gitlab-ci.yml @@ -55,7 +55,6 @@ unit test l3_attackmitigator: - docker ps -a - docker logs $IMAGE_NAME - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml" - - docker exec -i $IMAGE_NAME bash -c "coverage xml -o /opt/results/${IMAGE_NAME}_coverage.xml" - docker exec -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing" coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' after_script: @@ -75,7 +74,6 @@ unit test l3_attackmitigator: when: always reports: junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml - cobertura: src/$IMAGE_NAME/tests/${IMAGE_NAME}_coverage.xml # Deployment of the service in Kubernetes Cluster deploy l3_attackmitigator: diff --git a/src/l3_attackmitigator/genproto.sh b/src/l3_attackmitigator/genproto.sh old mode 100644 new mode 100755 index 40635e44a4d43ec821d734f9fe022d86e37dc831..c69f7d0250f287259a68b6663bd7b46b8137f6dd --- a/src/l3_attackmitigator/genproto.sh +++ b/src/l3_attackmitigator/genproto.sh @@ -1,6 +1,6 @@ #!/bin/bash -eu # -# Copyright 2018 Google LLC +# 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. @@ -14,16 +14,36 @@ # See the License for the specific language governing permissions and # limitations under the License. -#!/bin/bash -e - # Make folder containing the script the root folder for its execution cd $(dirname $0) rm -rf proto/*.py rm -rf proto/__pycache__ -touch proto/__init__.py +tee proto/__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 +python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto context.proto +python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto kpi_sample_types.proto python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto l3_attackmitigator.proto +rm proto/context_pb2_grpc.py +rm proto/kpi_sample_types_pb2_grpc.py + +sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/context_pb2.py +sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/kpi_sample_types_pb2.py sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/l3_attackmitigator_pb2.py sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/l3_attackmitigator_pb2_grpc.py diff --git a/src/l3_attackmitigator/proto/context_pb2.py b/src/l3_attackmitigator/proto/context_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..50d501d3ac053ad644554331af26e3c40cd426a1 --- /dev/null +++ b/src/l3_attackmitigator/proto/context_pb2.py @@ -0,0 +1,3071 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: context.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from . import kpi_sample_types_pb2 as kpi__sample__types__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='context.proto', + package='context', + syntax='proto3', + serialized_options=None, + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n\rcontext.proto\x12\x07\x63ontext\x1a\x16kpi_sample_types.proto\"\x07\n\x05\x45mpty\"\x14\n\x04Uuid\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"F\n\x05\x45vent\x12\x11\n\ttimestamp\x18\x01 \x01(\x01\x12*\n\nevent_type\x18\x02 \x01(\x0e\x32\x16.context.EventTypeEnum\"0\n\tContextId\x12#\n\x0c\x63ontext_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xb6\x01\n\x07\x43ontext\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12)\n\x0ctopology_ids\x18\x02 \x03(\x0b\x32\x13.context.TopologyId\x12\'\n\x0bservice_ids\x18\x03 \x03(\x0b\x32\x12.context.ServiceId\x12/\n\ncontroller\x18\x04 \x01(\x0b\x32\x1b.context.TeraFlowController\"8\n\rContextIdList\x12\'\n\x0b\x63ontext_ids\x18\x01 \x03(\x0b\x32\x12.context.ContextId\"1\n\x0b\x43ontextList\x12\"\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32\x10.context.Context\"U\n\x0c\x43ontextEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\ncontext_id\x18\x02 \x01(\x0b\x32\x12.context.ContextId\"Z\n\nTopologyId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12$\n\rtopology_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"~\n\x08Topology\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12%\n\ndevice_ids\x18\x02 \x03(\x0b\x32\x11.context.DeviceId\x12!\n\x08link_ids\x18\x03 \x03(\x0b\x32\x0f.context.LinkId\";\n\x0eTopologyIdList\x12)\n\x0ctopology_ids\x18\x01 \x03(\x0b\x32\x13.context.TopologyId\"5\n\x0cTopologyList\x12%\n\ntopologies\x18\x01 \x03(\x0b\x32\x11.context.Topology\"X\n\rTopologyEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12(\n\x0btopology_id\x18\x02 \x01(\x0b\x32\x13.context.TopologyId\".\n\x08\x44\x65viceId\x12\"\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x9a\x02\n\x06\x44\x65vice\x12$\n\tdevice_id\x18\x01 \x01(\x0b\x32\x11.context.DeviceId\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12,\n\rdevice_config\x18\x03 \x01(\x0b\x32\x15.context.DeviceConfig\x12G\n\x19\x64\x65vice_operational_status\x18\x04 \x01(\x0e\x32$.context.DeviceOperationalStatusEnum\x12\x31\n\x0e\x64\x65vice_drivers\x18\x05 \x03(\x0e\x32\x19.context.DeviceDriverEnum\x12+\n\x10\x64\x65vice_endpoints\x18\x06 \x03(\x0b\x32\x11.context.EndPoint\"9\n\x0c\x44\x65viceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"5\n\x0c\x44\x65viceIdList\x12%\n\ndevice_ids\x18\x01 \x03(\x0b\x32\x11.context.DeviceId\".\n\nDeviceList\x12 \n\x07\x64\x65vices\x18\x01 \x03(\x0b\x32\x0f.context.Device\"R\n\x0b\x44\x65viceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"*\n\x06LinkId\x12 \n\tlink_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"X\n\x04Link\x12 \n\x07link_id\x18\x01 \x01(\x0b\x32\x0f.context.LinkId\x12.\n\x11link_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\"/\n\nLinkIdList\x12!\n\x08link_ids\x18\x01 \x03(\x0b\x32\x0f.context.LinkId\"(\n\x08LinkList\x12\x1c\n\x05links\x18\x01 \x03(\x0b\x32\r.context.Link\"L\n\tLinkEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12 \n\x07link_id\x18\x02 \x01(\x0b\x32\x0f.context.LinkId\"X\n\tServiceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12#\n\x0cservice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\xa6\x02\n\x07Service\x12&\n\nservice_id\x18\x01 \x01(\x0b\x32\x12.context.ServiceId\x12.\n\x0cservice_type\x18\x02 \x01(\x0e\x32\x18.context.ServiceTypeEnum\x12\x31\n\x14service_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12\x30\n\x13service_constraints\x18\x04 \x03(\x0b\x32\x13.context.Constraint\x12.\n\x0eservice_status\x18\x05 \x01(\x0b\x32\x16.context.ServiceStatus\x12.\n\x0eservice_config\x18\x06 \x01(\x0b\x32\x16.context.ServiceConfig\"C\n\rServiceStatus\x12\x32\n\x0eservice_status\x18\x01 \x01(\x0e\x32\x1a.context.ServiceStatusEnum\":\n\rServiceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"8\n\rServiceIdList\x12\'\n\x0bservice_ids\x18\x01 \x03(\x0b\x32\x12.context.ServiceId\"1\n\x0bServiceList\x12\"\n\x08services\x18\x01 \x03(\x0b\x32\x10.context.Service\"U\n\x0cServiceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\"T\n\x07SliceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12!\n\nslice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\x95\x02\n\x05Slice\x12\"\n\x08slice_id\x18\x01 \x01(\x0b\x32\x10.context.SliceId\x12/\n\x12slice_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\x12.\n\x11slice_constraints\x18\x03 \x03(\x0b\x32\x13.context.Constraint\x12-\n\x11slice_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\x12,\n\x12slice_subslice_ids\x18\x05 \x03(\x0b\x32\x10.context.SliceId\x12*\n\x0cslice_status\x18\x06 \x01(\x0b\x32\x14.context.SliceStatus\"=\n\x0bSliceStatus\x12.\n\x0cslice_status\x18\x01 \x01(\x0e\x32\x18.context.SliceStatusEnum\"2\n\x0bSliceIdList\x12#\n\tslice_ids\x18\x01 \x03(\x0b\x32\x10.context.SliceId\"+\n\tSliceList\x12\x1e\n\x06slices\x18\x01 \x03(\x0b\x32\x0e.context.Slice\"O\n\nSliceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12\"\n\x08slice_id\x18\x02 \x01(\x0b\x32\x10.context.SliceId\"6\n\x0c\x43onnectionId\x12&\n\x0f\x63onnection_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xc4\x01\n\nConnection\x12,\n\rconnection_id\x18\x01 \x01(\x0b\x32\x15.context.ConnectionId\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\x12\x33\n\x16path_hops_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12+\n\x0fsub_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\"A\n\x10\x43onnectionIdList\x12-\n\x0e\x63onnection_ids\x18\x01 \x03(\x0b\x32\x15.context.ConnectionId\":\n\x0e\x43onnectionList\x12(\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x13.context.Connection\"^\n\x0f\x43onnectionEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12,\n\rconnection_id\x18\x02 \x01(\x0b\x32\x15.context.ConnectionId\"\x82\x01\n\nEndPointId\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\x12$\n\rendpoint_uuid\x18\x03 \x01(\x0b\x32\r.context.Uuid\"\x86\x01\n\x08\x45ndPoint\x12(\n\x0b\x65ndpoint_id\x18\x01 \x01(\x0b\x32\x13.context.EndPointId\x12\x15\n\rendpoint_type\x18\x02 \x01(\t\x12\x39\n\x10kpi_sample_types\x18\x03 \x03(\x0e\x32\x1f.kpi_sample_types.KpiSampleType\"e\n\nConfigRule\x12)\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x19.context.ConfigActionEnum\x12\x14\n\x0cresource_key\x18\x02 \x01(\t\x12\x16\n\x0eresource_value\x18\x03 \x01(\t\"?\n\nConstraint\x12\x17\n\x0f\x63onstraint_type\x18\x01 \x01(\t\x12\x18\n\x10\x63onstraint_value\x18\x02 \x01(\t\"^\n\x12TeraFlowController\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x12\n\nip_address\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\"U\n\x14\x41uthenticationResult\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x15\n\rauthenticated\x18\x02 \x01(\x08*j\n\rEventTypeEnum\x12\x17\n\x13\x45VENTTYPE_UNDEFINED\x10\x00\x12\x14\n\x10\x45VENTTYPE_CREATE\x10\x01\x12\x14\n\x10\x45VENTTYPE_UPDATE\x10\x02\x12\x14\n\x10\x45VENTTYPE_REMOVE\x10\x03*\xc5\x01\n\x10\x44\x65viceDriverEnum\x12\x1a\n\x16\x44\x45VICEDRIVER_UNDEFINED\x10\x00\x12\x1b\n\x17\x44\x45VICEDRIVER_OPENCONFIG\x10\x01\x12\x1e\n\x1a\x44\x45VICEDRIVER_TRANSPORT_API\x10\x02\x12\x13\n\x0f\x44\x45VICEDRIVER_P4\x10\x03\x12&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOGY\x10\x04\x12\x1b\n\x17\x44\x45VICEDRIVER_ONF_TR_352\x10\x05*\x8f\x01\n\x1b\x44\x65viceOperationalStatusEnum\x12%\n!DEVICEOPERATIONALSTATUS_UNDEFINED\x10\x00\x12$\n DEVICEOPERATIONALSTATUS_DISABLED\x10\x01\x12#\n\x1f\x44\x45VICEOPERATIONALSTATUS_ENABLED\x10\x02*\x81\x01\n\x0fServiceTypeEnum\x12\x17\n\x13SERVICETYPE_UNKNOWN\x10\x00\x12\x14\n\x10SERVICETYPE_L3NM\x10\x01\x12\x14\n\x10SERVICETYPE_L2NM\x10\x02\x12)\n%SERVICETYPE_TAPI_CONNECTIVITY_SERVICE\x10\x03*\x88\x01\n\x11ServiceStatusEnum\x12\x1b\n\x17SERVICESTATUS_UNDEFINED\x10\x00\x12\x19\n\x15SERVICESTATUS_PLANNED\x10\x01\x12\x18\n\x14SERVICESTATUS_ACTIVE\x10\x02\x12!\n\x1dSERVICESTATUS_PENDING_REMOVAL\x10\x03*\x8b\x01\n\x0fSliceStatusEnum\x12\x19\n\x15SLICESTATUS_UNDEFINED\x10\x00\x12\x17\n\x13SLICESTATUS_PLANNED\x10\x01\x12\x14\n\x10SLICESTATUS_INIT\x10\x02\x12\x16\n\x12SLICESTATUS_ACTIVE\x10\x03\x12\x16\n\x12SLICESTATUS_DEINIT\x10\x04*]\n\x10\x43onfigActionEnum\x12\x1a\n\x16\x43ONFIGACTION_UNDEFINED\x10\x00\x12\x14\n\x10\x43ONFIGACTION_SET\x10\x01\x12\x17\n\x13\x43ONFIGACTION_DELETE\x10\x02\x32\xef\x12\n\x0e\x43ontextService\x12:\n\x0eListContextIds\x12\x0e.context.Empty\x1a\x16.context.ContextIdList\"\x00\x12\x36\n\x0cListContexts\x12\x0e.context.Empty\x1a\x14.context.ContextList\"\x00\x12\x34\n\nGetContext\x12\x12.context.ContextId\x1a\x10.context.Context\"\x00\x12\x34\n\nSetContext\x12\x10.context.Context\x1a\x12.context.ContextId\"\x00\x12\x35\n\rRemoveContext\x12\x12.context.ContextId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetContextEvents\x12\x0e.context.Empty\x1a\x15.context.ContextEvent\"\x00\x30\x01\x12@\n\x0fListTopologyIds\x12\x12.context.ContextId\x1a\x17.context.TopologyIdList\"\x00\x12=\n\x0eListTopologies\x12\x12.context.ContextId\x1a\x15.context.TopologyList\"\x00\x12\x37\n\x0bGetTopology\x12\x13.context.TopologyId\x1a\x11.context.Topology\"\x00\x12\x37\n\x0bSetTopology\x12\x11.context.Topology\x1a\x13.context.TopologyId\"\x00\x12\x37\n\x0eRemoveTopology\x12\x13.context.TopologyId\x1a\x0e.context.Empty\"\x00\x12?\n\x11GetTopologyEvents\x12\x0e.context.Empty\x1a\x16.context.TopologyEvent\"\x00\x30\x01\x12\x38\n\rListDeviceIds\x12\x0e.context.Empty\x1a\x15.context.DeviceIdList\"\x00\x12\x34\n\x0bListDevices\x12\x0e.context.Empty\x1a\x13.context.DeviceList\"\x00\x12\x31\n\tGetDevice\x12\x11.context.DeviceId\x1a\x0f.context.Device\"\x00\x12\x31\n\tSetDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0cRemoveDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x12;\n\x0fGetDeviceEvents\x12\x0e.context.Empty\x1a\x14.context.DeviceEvent\"\x00\x30\x01\x12\x34\n\x0bListLinkIds\x12\x0e.context.Empty\x1a\x13.context.LinkIdList\"\x00\x12\x30\n\tListLinks\x12\x0e.context.Empty\x1a\x11.context.LinkList\"\x00\x12+\n\x07GetLink\x12\x0f.context.LinkId\x1a\r.context.Link\"\x00\x12+\n\x07SetLink\x12\r.context.Link\x1a\x0f.context.LinkId\"\x00\x12/\n\nRemoveLink\x12\x0f.context.LinkId\x1a\x0e.context.Empty\"\x00\x12\x37\n\rGetLinkEvents\x12\x0e.context.Empty\x1a\x12.context.LinkEvent\"\x00\x30\x01\x12>\n\x0eListServiceIds\x12\x12.context.ContextId\x1a\x16.context.ServiceIdList\"\x00\x12:\n\x0cListServices\x12\x12.context.ContextId\x1a\x14.context.ServiceList\"\x00\x12\x34\n\nGetService\x12\x12.context.ServiceId\x1a\x10.context.Service\"\x00\x12\x34\n\nSetService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rRemoveService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetServiceEvents\x12\x0e.context.Empty\x1a\x15.context.ServiceEvent\"\x00\x30\x01\x12:\n\x0cListSliceIds\x12\x12.context.ContextId\x1a\x14.context.SliceIdList\"\x00\x12\x36\n\nListSlices\x12\x12.context.ContextId\x1a\x12.context.SliceList\"\x00\x12.\n\x08GetSlice\x12\x10.context.SliceId\x1a\x0e.context.Slice\"\x00\x12.\n\x08SetSlice\x12\x0e.context.Slice\x1a\x10.context.SliceId\"\x00\x12\x31\n\x0bRemoveSlice\x12\x10.context.SliceId\x1a\x0e.context.Empty\"\x00\x12\x39\n\x0eGetSliceEvents\x12\x0e.context.Empty\x1a\x13.context.SliceEvent\"\x00\x30\x01\x12\x44\n\x11ListConnectionIds\x12\x12.context.ServiceId\x1a\x19.context.ConnectionIdList\"\x00\x12@\n\x0fListConnections\x12\x12.context.ServiceId\x1a\x17.context.ConnectionList\"\x00\x12=\n\rGetConnection\x12\x15.context.ConnectionId\x1a\x13.context.Connection\"\x00\x12=\n\rSetConnection\x12\x13.context.Connection\x1a\x15.context.ConnectionId\"\x00\x12;\n\x10RemoveConnection\x12\x15.context.ConnectionId\x1a\x0e.context.Empty\"\x00\x12\x43\n\x13GetConnectionEvents\x12\x0e.context.Empty\x1a\x18.context.ConnectionEvent\"\x00\x30\x01\x62\x06proto3' + , + dependencies=[kpi__sample__types__pb2.DESCRIPTOR,]) + +_EVENTTYPEENUM = _descriptor.EnumDescriptor( + name='EventTypeEnum', + full_name='context.EventTypeEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='EVENTTYPE_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='EVENTTYPE_CREATE', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='EVENTTYPE_UPDATE', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='EVENTTYPE_REMOVE', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=4310, + serialized_end=4416, +) +_sym_db.RegisterEnumDescriptor(_EVENTTYPEENUM) + +EventTypeEnum = enum_type_wrapper.EnumTypeWrapper(_EVENTTYPEENUM) +_DEVICEDRIVERENUM = _descriptor.EnumDescriptor( + name='DeviceDriverEnum', + full_name='context.DeviceDriverEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='DEVICEDRIVER_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DEVICEDRIVER_OPENCONFIG', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DEVICEDRIVER_TRANSPORT_API', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DEVICEDRIVER_P4', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DEVICEDRIVER_IETF_NETWORK_TOPOLOGY', index=4, number=4, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DEVICEDRIVER_ONF_TR_352', index=5, number=5, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=4419, + serialized_end=4616, +) +_sym_db.RegisterEnumDescriptor(_DEVICEDRIVERENUM) + +DeviceDriverEnum = enum_type_wrapper.EnumTypeWrapper(_DEVICEDRIVERENUM) +_DEVICEOPERATIONALSTATUSENUM = _descriptor.EnumDescriptor( + name='DeviceOperationalStatusEnum', + full_name='context.DeviceOperationalStatusEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='DEVICEOPERATIONALSTATUS_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DEVICEOPERATIONALSTATUS_DISABLED', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DEVICEOPERATIONALSTATUS_ENABLED', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=4619, + serialized_end=4762, +) +_sym_db.RegisterEnumDescriptor(_DEVICEOPERATIONALSTATUSENUM) + +DeviceOperationalStatusEnum = enum_type_wrapper.EnumTypeWrapper(_DEVICEOPERATIONALSTATUSENUM) +_SERVICETYPEENUM = _descriptor.EnumDescriptor( + name='ServiceTypeEnum', + full_name='context.ServiceTypeEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='SERVICETYPE_UNKNOWN', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SERVICETYPE_L3NM', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SERVICETYPE_L2NM', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SERVICETYPE_TAPI_CONNECTIVITY_SERVICE', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=4765, + serialized_end=4894, +) +_sym_db.RegisterEnumDescriptor(_SERVICETYPEENUM) + +ServiceTypeEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICETYPEENUM) +_SERVICESTATUSENUM = _descriptor.EnumDescriptor( + name='ServiceStatusEnum', + full_name='context.ServiceStatusEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='SERVICESTATUS_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SERVICESTATUS_PLANNED', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SERVICESTATUS_ACTIVE', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SERVICESTATUS_PENDING_REMOVAL', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=4897, + serialized_end=5033, +) +_sym_db.RegisterEnumDescriptor(_SERVICESTATUSENUM) + +ServiceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICESTATUSENUM) +_SLICESTATUSENUM = _descriptor.EnumDescriptor( + name='SliceStatusEnum', + full_name='context.SliceStatusEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_PLANNED', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_INIT', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_ACTIVE', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_DEINIT', index=4, number=4, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=5036, + serialized_end=5175, +) +_sym_db.RegisterEnumDescriptor(_SLICESTATUSENUM) + +SliceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SLICESTATUSENUM) +_CONFIGACTIONENUM = _descriptor.EnumDescriptor( + name='ConfigActionEnum', + full_name='context.ConfigActionEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='CONFIGACTION_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CONFIGACTION_SET', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CONFIGACTION_DELETE', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=5177, + serialized_end=5270, +) +_sym_db.RegisterEnumDescriptor(_CONFIGACTIONENUM) + +ConfigActionEnum = enum_type_wrapper.EnumTypeWrapper(_CONFIGACTIONENUM) +EVENTTYPE_UNDEFINED = 0 +EVENTTYPE_CREATE = 1 +EVENTTYPE_UPDATE = 2 +EVENTTYPE_REMOVE = 3 +DEVICEDRIVER_UNDEFINED = 0 +DEVICEDRIVER_OPENCONFIG = 1 +DEVICEDRIVER_TRANSPORT_API = 2 +DEVICEDRIVER_P4 = 3 +DEVICEDRIVER_IETF_NETWORK_TOPOLOGY = 4 +DEVICEDRIVER_ONF_TR_352 = 5 +DEVICEOPERATIONALSTATUS_UNDEFINED = 0 +DEVICEOPERATIONALSTATUS_DISABLED = 1 +DEVICEOPERATIONALSTATUS_ENABLED = 2 +SERVICETYPE_UNKNOWN = 0 +SERVICETYPE_L3NM = 1 +SERVICETYPE_L2NM = 2 +SERVICETYPE_TAPI_CONNECTIVITY_SERVICE = 3 +SERVICESTATUS_UNDEFINED = 0 +SERVICESTATUS_PLANNED = 1 +SERVICESTATUS_ACTIVE = 2 +SERVICESTATUS_PENDING_REMOVAL = 3 +SLICESTATUS_UNDEFINED = 0 +SLICESTATUS_PLANNED = 1 +SLICESTATUS_INIT = 2 +SLICESTATUS_ACTIVE = 3 +SLICESTATUS_DEINIT = 4 +CONFIGACTION_UNDEFINED = 0 +CONFIGACTION_SET = 1 +CONFIGACTION_DELETE = 2 + + + +_EMPTY = _descriptor.Descriptor( + name='Empty', + full_name='context.Empty', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=50, + serialized_end=57, +) + + +_UUID = _descriptor.Descriptor( + name='Uuid', + full_name='context.Uuid', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='uuid', full_name='context.Uuid.uuid', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=59, + serialized_end=79, +) + + +_EVENT = _descriptor.Descriptor( + name='Event', + full_name='context.Event', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='timestamp', full_name='context.Event.timestamp', index=0, + number=1, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='event_type', full_name='context.Event.event_type', index=1, + number=2, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=81, + serialized_end=151, +) + + +_CONTEXTID = _descriptor.Descriptor( + name='ContextId', + full_name='context.ContextId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_uuid', full_name='context.ContextId.context_uuid', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=153, + serialized_end=201, +) + + +_CONTEXT = _descriptor.Descriptor( + name='Context', + full_name='context.Context', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_id', full_name='context.Context.context_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='topology_ids', full_name='context.Context.topology_ids', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_ids', full_name='context.Context.service_ids', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='controller', full_name='context.Context.controller', index=3, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=204, + serialized_end=386, +) + + +_CONTEXTIDLIST = _descriptor.Descriptor( + name='ContextIdList', + full_name='context.ContextIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_ids', full_name='context.ContextIdList.context_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=388, + serialized_end=444, +) + + +_CONTEXTLIST = _descriptor.Descriptor( + name='ContextList', + full_name='context.ContextList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='contexts', full_name='context.ContextList.contexts', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=446, + serialized_end=495, +) + + +_CONTEXTEVENT = _descriptor.Descriptor( + name='ContextEvent', + full_name='context.ContextEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.ContextEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='context_id', full_name='context.ContextEvent.context_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=497, + serialized_end=582, +) + + +_TOPOLOGYID = _descriptor.Descriptor( + name='TopologyId', + full_name='context.TopologyId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_id', full_name='context.TopologyId.context_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='topology_uuid', full_name='context.TopologyId.topology_uuid', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=584, + serialized_end=674, +) + + +_TOPOLOGY = _descriptor.Descriptor( + name='Topology', + full_name='context.Topology', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='topology_id', full_name='context.Topology.topology_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='device_ids', full_name='context.Topology.device_ids', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='link_ids', full_name='context.Topology.link_ids', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=676, + serialized_end=802, +) + + +_TOPOLOGYIDLIST = _descriptor.Descriptor( + name='TopologyIdList', + full_name='context.TopologyIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='topology_ids', full_name='context.TopologyIdList.topology_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=804, + serialized_end=863, +) + + +_TOPOLOGYLIST = _descriptor.Descriptor( + name='TopologyList', + full_name='context.TopologyList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='topologies', full_name='context.TopologyList.topologies', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=865, + serialized_end=918, +) + + +_TOPOLOGYEVENT = _descriptor.Descriptor( + name='TopologyEvent', + full_name='context.TopologyEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.TopologyEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='topology_id', full_name='context.TopologyEvent.topology_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=920, + serialized_end=1008, +) + + +_DEVICEID = _descriptor.Descriptor( + name='DeviceId', + full_name='context.DeviceId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='device_uuid', full_name='context.DeviceId.device_uuid', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1010, + serialized_end=1056, +) + + +_DEVICE = _descriptor.Descriptor( + name='Device', + full_name='context.Device', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='device_id', full_name='context.Device.device_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='device_type', full_name='context.Device.device_type', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='device_config', full_name='context.Device.device_config', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='device_operational_status', full_name='context.Device.device_operational_status', index=3, + number=4, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='device_drivers', full_name='context.Device.device_drivers', index=4, + number=5, type=14, cpp_type=8, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='device_endpoints', full_name='context.Device.device_endpoints', index=5, + number=6, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1059, + serialized_end=1341, +) + + +_DEVICECONFIG = _descriptor.Descriptor( + name='DeviceConfig', + full_name='context.DeviceConfig', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='config_rules', full_name='context.DeviceConfig.config_rules', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1343, + serialized_end=1400, +) + + +_DEVICEIDLIST = _descriptor.Descriptor( + name='DeviceIdList', + full_name='context.DeviceIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='device_ids', full_name='context.DeviceIdList.device_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1402, + serialized_end=1455, +) + + +_DEVICELIST = _descriptor.Descriptor( + name='DeviceList', + full_name='context.DeviceList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='devices', full_name='context.DeviceList.devices', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1457, + serialized_end=1503, +) + + +_DEVICEEVENT = _descriptor.Descriptor( + name='DeviceEvent', + full_name='context.DeviceEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.DeviceEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='device_id', full_name='context.DeviceEvent.device_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1505, + serialized_end=1587, +) + + +_LINKID = _descriptor.Descriptor( + name='LinkId', + full_name='context.LinkId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='link_uuid', full_name='context.LinkId.link_uuid', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1589, + serialized_end=1631, +) + + +_LINK = _descriptor.Descriptor( + name='Link', + full_name='context.Link', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='link_id', full_name='context.Link.link_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='link_endpoint_ids', full_name='context.Link.link_endpoint_ids', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1633, + serialized_end=1721, +) + + +_LINKIDLIST = _descriptor.Descriptor( + name='LinkIdList', + full_name='context.LinkIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='link_ids', full_name='context.LinkIdList.link_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1723, + serialized_end=1770, +) + + +_LINKLIST = _descriptor.Descriptor( + name='LinkList', + full_name='context.LinkList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='links', full_name='context.LinkList.links', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1772, + serialized_end=1812, +) + + +_LINKEVENT = _descriptor.Descriptor( + name='LinkEvent', + full_name='context.LinkEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.LinkEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='link_id', full_name='context.LinkEvent.link_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1814, + serialized_end=1890, +) + + +_SERVICEID = _descriptor.Descriptor( + name='ServiceId', + full_name='context.ServiceId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_id', full_name='context.ServiceId.context_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_uuid', full_name='context.ServiceId.service_uuid', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1892, + serialized_end=1980, +) + + +_SERVICE = _descriptor.Descriptor( + name='Service', + full_name='context.Service', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='service_id', full_name='context.Service.service_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_type', full_name='context.Service.service_type', index=1, + number=2, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_endpoint_ids', full_name='context.Service.service_endpoint_ids', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_constraints', full_name='context.Service.service_constraints', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_status', full_name='context.Service.service_status', index=4, + number=5, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_config', full_name='context.Service.service_config', index=5, + number=6, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1983, + serialized_end=2277, +) + + +_SERVICESTATUS = _descriptor.Descriptor( + name='ServiceStatus', + full_name='context.ServiceStatus', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='service_status', full_name='context.ServiceStatus.service_status', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2279, + serialized_end=2346, +) + + +_SERVICECONFIG = _descriptor.Descriptor( + name='ServiceConfig', + full_name='context.ServiceConfig', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='config_rules', full_name='context.ServiceConfig.config_rules', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2348, + serialized_end=2406, +) + + +_SERVICEIDLIST = _descriptor.Descriptor( + name='ServiceIdList', + full_name='context.ServiceIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='service_ids', full_name='context.ServiceIdList.service_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2408, + serialized_end=2464, +) + + +_SERVICELIST = _descriptor.Descriptor( + name='ServiceList', + full_name='context.ServiceList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='services', full_name='context.ServiceList.services', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2466, + serialized_end=2515, +) + + +_SERVICEEVENT = _descriptor.Descriptor( + name='ServiceEvent', + full_name='context.ServiceEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.ServiceEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_id', full_name='context.ServiceEvent.service_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2517, + serialized_end=2602, +) + + +_SLICEID = _descriptor.Descriptor( + name='SliceId', + full_name='context.SliceId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_id', full_name='context.SliceId.context_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_uuid', full_name='context.SliceId.slice_uuid', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2604, + serialized_end=2688, +) + + +_SLICE = _descriptor.Descriptor( + name='Slice', + full_name='context.Slice', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_id', full_name='context.Slice.slice_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_endpoint_ids', full_name='context.Slice.slice_endpoint_ids', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_constraints', full_name='context.Slice.slice_constraints', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_service_ids', full_name='context.Slice.slice_service_ids', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_subslice_ids', full_name='context.Slice.slice_subslice_ids', index=4, + number=5, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_status', full_name='context.Slice.slice_status', index=5, + number=6, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2691, + serialized_end=2968, +) + + +_SLICESTATUS = _descriptor.Descriptor( + name='SliceStatus', + full_name='context.SliceStatus', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_status', full_name='context.SliceStatus.slice_status', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2970, + serialized_end=3031, +) + + +_SLICEIDLIST = _descriptor.Descriptor( + name='SliceIdList', + full_name='context.SliceIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_ids', full_name='context.SliceIdList.slice_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3033, + serialized_end=3083, +) + + +_SLICELIST = _descriptor.Descriptor( + name='SliceList', + full_name='context.SliceList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slices', full_name='context.SliceList.slices', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3085, + serialized_end=3128, +) + + +_SLICEEVENT = _descriptor.Descriptor( + name='SliceEvent', + full_name='context.SliceEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.SliceEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_id', full_name='context.SliceEvent.slice_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3130, + serialized_end=3209, +) + + +_CONNECTIONID = _descriptor.Descriptor( + name='ConnectionId', + full_name='context.ConnectionId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='connection_uuid', full_name='context.ConnectionId.connection_uuid', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3211, + serialized_end=3265, +) + + +_CONNECTION = _descriptor.Descriptor( + name='Connection', + full_name='context.Connection', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='connection_id', full_name='context.Connection.connection_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_id', full_name='context.Connection.service_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='path_hops_endpoint_ids', full_name='context.Connection.path_hops_endpoint_ids', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='sub_service_ids', full_name='context.Connection.sub_service_ids', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3268, + serialized_end=3464, +) + + +_CONNECTIONIDLIST = _descriptor.Descriptor( + name='ConnectionIdList', + full_name='context.ConnectionIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='connection_ids', full_name='context.ConnectionIdList.connection_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3466, + serialized_end=3531, +) + + +_CONNECTIONLIST = _descriptor.Descriptor( + name='ConnectionList', + full_name='context.ConnectionList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='connections', full_name='context.ConnectionList.connections', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3533, + serialized_end=3591, +) + + +_CONNECTIONEVENT = _descriptor.Descriptor( + name='ConnectionEvent', + full_name='context.ConnectionEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.ConnectionEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='connection_id', full_name='context.ConnectionEvent.connection_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3593, + serialized_end=3687, +) + + +_ENDPOINTID = _descriptor.Descriptor( + name='EndPointId', + full_name='context.EndPointId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='topology_id', full_name='context.EndPointId.topology_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='device_id', full_name='context.EndPointId.device_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='endpoint_uuid', full_name='context.EndPointId.endpoint_uuid', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3690, + serialized_end=3820, +) + + +_ENDPOINT = _descriptor.Descriptor( + name='EndPoint', + full_name='context.EndPoint', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='endpoint_id', full_name='context.EndPoint.endpoint_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='endpoint_type', full_name='context.EndPoint.endpoint_type', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='kpi_sample_types', full_name='context.EndPoint.kpi_sample_types', index=2, + number=3, type=14, cpp_type=8, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3823, + serialized_end=3957, +) + + +_CONFIGRULE = _descriptor.Descriptor( + name='ConfigRule', + full_name='context.ConfigRule', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='action', full_name='context.ConfigRule.action', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='resource_key', full_name='context.ConfigRule.resource_key', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='resource_value', full_name='context.ConfigRule.resource_value', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3959, + serialized_end=4060, +) + + +_CONSTRAINT = _descriptor.Descriptor( + name='Constraint', + full_name='context.Constraint', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='constraint_type', full_name='context.Constraint.constraint_type', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='constraint_value', full_name='context.Constraint.constraint_value', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=4062, + serialized_end=4125, +) + + +_TERAFLOWCONTROLLER = _descriptor.Descriptor( + name='TeraFlowController', + full_name='context.TeraFlowController', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_id', full_name='context.TeraFlowController.context_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='ip_address', full_name='context.TeraFlowController.ip_address', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='port', full_name='context.TeraFlowController.port', index=2, + number=3, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=4127, + serialized_end=4221, +) + + +_AUTHENTICATIONRESULT = _descriptor.Descriptor( + name='AuthenticationResult', + full_name='context.AuthenticationResult', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_id', full_name='context.AuthenticationResult.context_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='authenticated', full_name='context.AuthenticationResult.authenticated', index=1, + number=2, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=4223, + serialized_end=4308, +) + +_EVENT.fields_by_name['event_type'].enum_type = _EVENTTYPEENUM +_CONTEXTID.fields_by_name['context_uuid'].message_type = _UUID +_CONTEXT.fields_by_name['context_id'].message_type = _CONTEXTID +_CONTEXT.fields_by_name['topology_ids'].message_type = _TOPOLOGYID +_CONTEXT.fields_by_name['service_ids'].message_type = _SERVICEID +_CONTEXT.fields_by_name['controller'].message_type = _TERAFLOWCONTROLLER +_CONTEXTIDLIST.fields_by_name['context_ids'].message_type = _CONTEXTID +_CONTEXTLIST.fields_by_name['contexts'].message_type = _CONTEXT +_CONTEXTEVENT.fields_by_name['event'].message_type = _EVENT +_CONTEXTEVENT.fields_by_name['context_id'].message_type = _CONTEXTID +_TOPOLOGYID.fields_by_name['context_id'].message_type = _CONTEXTID +_TOPOLOGYID.fields_by_name['topology_uuid'].message_type = _UUID +_TOPOLOGY.fields_by_name['topology_id'].message_type = _TOPOLOGYID +_TOPOLOGY.fields_by_name['device_ids'].message_type = _DEVICEID +_TOPOLOGY.fields_by_name['link_ids'].message_type = _LINKID +_TOPOLOGYIDLIST.fields_by_name['topology_ids'].message_type = _TOPOLOGYID +_TOPOLOGYLIST.fields_by_name['topologies'].message_type = _TOPOLOGY +_TOPOLOGYEVENT.fields_by_name['event'].message_type = _EVENT +_TOPOLOGYEVENT.fields_by_name['topology_id'].message_type = _TOPOLOGYID +_DEVICEID.fields_by_name['device_uuid'].message_type = _UUID +_DEVICE.fields_by_name['device_id'].message_type = _DEVICEID +_DEVICE.fields_by_name['device_config'].message_type = _DEVICECONFIG +_DEVICE.fields_by_name['device_operational_status'].enum_type = _DEVICEOPERATIONALSTATUSENUM +_DEVICE.fields_by_name['device_drivers'].enum_type = _DEVICEDRIVERENUM +_DEVICE.fields_by_name['device_endpoints'].message_type = _ENDPOINT +_DEVICECONFIG.fields_by_name['config_rules'].message_type = _CONFIGRULE +_DEVICEIDLIST.fields_by_name['device_ids'].message_type = _DEVICEID +_DEVICELIST.fields_by_name['devices'].message_type = _DEVICE +_DEVICEEVENT.fields_by_name['event'].message_type = _EVENT +_DEVICEEVENT.fields_by_name['device_id'].message_type = _DEVICEID +_LINKID.fields_by_name['link_uuid'].message_type = _UUID +_LINK.fields_by_name['link_id'].message_type = _LINKID +_LINK.fields_by_name['link_endpoint_ids'].message_type = _ENDPOINTID +_LINKIDLIST.fields_by_name['link_ids'].message_type = _LINKID +_LINKLIST.fields_by_name['links'].message_type = _LINK +_LINKEVENT.fields_by_name['event'].message_type = _EVENT +_LINKEVENT.fields_by_name['link_id'].message_type = _LINKID +_SERVICEID.fields_by_name['context_id'].message_type = _CONTEXTID +_SERVICEID.fields_by_name['service_uuid'].message_type = _UUID +_SERVICE.fields_by_name['service_id'].message_type = _SERVICEID +_SERVICE.fields_by_name['service_type'].enum_type = _SERVICETYPEENUM +_SERVICE.fields_by_name['service_endpoint_ids'].message_type = _ENDPOINTID +_SERVICE.fields_by_name['service_constraints'].message_type = _CONSTRAINT +_SERVICE.fields_by_name['service_status'].message_type = _SERVICESTATUS +_SERVICE.fields_by_name['service_config'].message_type = _SERVICECONFIG +_SERVICESTATUS.fields_by_name['service_status'].enum_type = _SERVICESTATUSENUM +_SERVICECONFIG.fields_by_name['config_rules'].message_type = _CONFIGRULE +_SERVICEIDLIST.fields_by_name['service_ids'].message_type = _SERVICEID +_SERVICELIST.fields_by_name['services'].message_type = _SERVICE +_SERVICEEVENT.fields_by_name['event'].message_type = _EVENT +_SERVICEEVENT.fields_by_name['service_id'].message_type = _SERVICEID +_SLICEID.fields_by_name['context_id'].message_type = _CONTEXTID +_SLICEID.fields_by_name['slice_uuid'].message_type = _UUID +_SLICE.fields_by_name['slice_id'].message_type = _SLICEID +_SLICE.fields_by_name['slice_endpoint_ids'].message_type = _ENDPOINTID +_SLICE.fields_by_name['slice_constraints'].message_type = _CONSTRAINT +_SLICE.fields_by_name['slice_service_ids'].message_type = _SERVICEID +_SLICE.fields_by_name['slice_subslice_ids'].message_type = _SLICEID +_SLICE.fields_by_name['slice_status'].message_type = _SLICESTATUS +_SLICESTATUS.fields_by_name['slice_status'].enum_type = _SLICESTATUSENUM +_SLICEIDLIST.fields_by_name['slice_ids'].message_type = _SLICEID +_SLICELIST.fields_by_name['slices'].message_type = _SLICE +_SLICEEVENT.fields_by_name['event'].message_type = _EVENT +_SLICEEVENT.fields_by_name['slice_id'].message_type = _SLICEID +_CONNECTIONID.fields_by_name['connection_uuid'].message_type = _UUID +_CONNECTION.fields_by_name['connection_id'].message_type = _CONNECTIONID +_CONNECTION.fields_by_name['service_id'].message_type = _SERVICEID +_CONNECTION.fields_by_name['path_hops_endpoint_ids'].message_type = _ENDPOINTID +_CONNECTION.fields_by_name['sub_service_ids'].message_type = _SERVICEID +_CONNECTIONIDLIST.fields_by_name['connection_ids'].message_type = _CONNECTIONID +_CONNECTIONLIST.fields_by_name['connections'].message_type = _CONNECTION +_CONNECTIONEVENT.fields_by_name['event'].message_type = _EVENT +_CONNECTIONEVENT.fields_by_name['connection_id'].message_type = _CONNECTIONID +_ENDPOINTID.fields_by_name['topology_id'].message_type = _TOPOLOGYID +_ENDPOINTID.fields_by_name['device_id'].message_type = _DEVICEID +_ENDPOINTID.fields_by_name['endpoint_uuid'].message_type = _UUID +_ENDPOINT.fields_by_name['endpoint_id'].message_type = _ENDPOINTID +_ENDPOINT.fields_by_name['kpi_sample_types'].enum_type = kpi__sample__types__pb2._KPISAMPLETYPE +_CONFIGRULE.fields_by_name['action'].enum_type = _CONFIGACTIONENUM +_TERAFLOWCONTROLLER.fields_by_name['context_id'].message_type = _CONTEXTID +_AUTHENTICATIONRESULT.fields_by_name['context_id'].message_type = _CONTEXTID +DESCRIPTOR.message_types_by_name['Empty'] = _EMPTY +DESCRIPTOR.message_types_by_name['Uuid'] = _UUID +DESCRIPTOR.message_types_by_name['Event'] = _EVENT +DESCRIPTOR.message_types_by_name['ContextId'] = _CONTEXTID +DESCRIPTOR.message_types_by_name['Context'] = _CONTEXT +DESCRIPTOR.message_types_by_name['ContextIdList'] = _CONTEXTIDLIST +DESCRIPTOR.message_types_by_name['ContextList'] = _CONTEXTLIST +DESCRIPTOR.message_types_by_name['ContextEvent'] = _CONTEXTEVENT +DESCRIPTOR.message_types_by_name['TopologyId'] = _TOPOLOGYID +DESCRIPTOR.message_types_by_name['Topology'] = _TOPOLOGY +DESCRIPTOR.message_types_by_name['TopologyIdList'] = _TOPOLOGYIDLIST +DESCRIPTOR.message_types_by_name['TopologyList'] = _TOPOLOGYLIST +DESCRIPTOR.message_types_by_name['TopologyEvent'] = _TOPOLOGYEVENT +DESCRIPTOR.message_types_by_name['DeviceId'] = _DEVICEID +DESCRIPTOR.message_types_by_name['Device'] = _DEVICE +DESCRIPTOR.message_types_by_name['DeviceConfig'] = _DEVICECONFIG +DESCRIPTOR.message_types_by_name['DeviceIdList'] = _DEVICEIDLIST +DESCRIPTOR.message_types_by_name['DeviceList'] = _DEVICELIST +DESCRIPTOR.message_types_by_name['DeviceEvent'] = _DEVICEEVENT +DESCRIPTOR.message_types_by_name['LinkId'] = _LINKID +DESCRIPTOR.message_types_by_name['Link'] = _LINK +DESCRIPTOR.message_types_by_name['LinkIdList'] = _LINKIDLIST +DESCRIPTOR.message_types_by_name['LinkList'] = _LINKLIST +DESCRIPTOR.message_types_by_name['LinkEvent'] = _LINKEVENT +DESCRIPTOR.message_types_by_name['ServiceId'] = _SERVICEID +DESCRIPTOR.message_types_by_name['Service'] = _SERVICE +DESCRIPTOR.message_types_by_name['ServiceStatus'] = _SERVICESTATUS +DESCRIPTOR.message_types_by_name['ServiceConfig'] = _SERVICECONFIG +DESCRIPTOR.message_types_by_name['ServiceIdList'] = _SERVICEIDLIST +DESCRIPTOR.message_types_by_name['ServiceList'] = _SERVICELIST +DESCRIPTOR.message_types_by_name['ServiceEvent'] = _SERVICEEVENT +DESCRIPTOR.message_types_by_name['SliceId'] = _SLICEID +DESCRIPTOR.message_types_by_name['Slice'] = _SLICE +DESCRIPTOR.message_types_by_name['SliceStatus'] = _SLICESTATUS +DESCRIPTOR.message_types_by_name['SliceIdList'] = _SLICEIDLIST +DESCRIPTOR.message_types_by_name['SliceList'] = _SLICELIST +DESCRIPTOR.message_types_by_name['SliceEvent'] = _SLICEEVENT +DESCRIPTOR.message_types_by_name['ConnectionId'] = _CONNECTIONID +DESCRIPTOR.message_types_by_name['Connection'] = _CONNECTION +DESCRIPTOR.message_types_by_name['ConnectionIdList'] = _CONNECTIONIDLIST +DESCRIPTOR.message_types_by_name['ConnectionList'] = _CONNECTIONLIST +DESCRIPTOR.message_types_by_name['ConnectionEvent'] = _CONNECTIONEVENT +DESCRIPTOR.message_types_by_name['EndPointId'] = _ENDPOINTID +DESCRIPTOR.message_types_by_name['EndPoint'] = _ENDPOINT +DESCRIPTOR.message_types_by_name['ConfigRule'] = _CONFIGRULE +DESCRIPTOR.message_types_by_name['Constraint'] = _CONSTRAINT +DESCRIPTOR.message_types_by_name['TeraFlowController'] = _TERAFLOWCONTROLLER +DESCRIPTOR.message_types_by_name['AuthenticationResult'] = _AUTHENTICATIONRESULT +DESCRIPTOR.enum_types_by_name['EventTypeEnum'] = _EVENTTYPEENUM +DESCRIPTOR.enum_types_by_name['DeviceDriverEnum'] = _DEVICEDRIVERENUM +DESCRIPTOR.enum_types_by_name['DeviceOperationalStatusEnum'] = _DEVICEOPERATIONALSTATUSENUM +DESCRIPTOR.enum_types_by_name['ServiceTypeEnum'] = _SERVICETYPEENUM +DESCRIPTOR.enum_types_by_name['ServiceStatusEnum'] = _SERVICESTATUSENUM +DESCRIPTOR.enum_types_by_name['SliceStatusEnum'] = _SLICESTATUSENUM +DESCRIPTOR.enum_types_by_name['ConfigActionEnum'] = _CONFIGACTIONENUM +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +Empty = _reflection.GeneratedProtocolMessageType('Empty', (_message.Message,), { + 'DESCRIPTOR' : _EMPTY, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Empty) + }) +_sym_db.RegisterMessage(Empty) + +Uuid = _reflection.GeneratedProtocolMessageType('Uuid', (_message.Message,), { + 'DESCRIPTOR' : _UUID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Uuid) + }) +_sym_db.RegisterMessage(Uuid) + +Event = _reflection.GeneratedProtocolMessageType('Event', (_message.Message,), { + 'DESCRIPTOR' : _EVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Event) + }) +_sym_db.RegisterMessage(Event) + +ContextId = _reflection.GeneratedProtocolMessageType('ContextId', (_message.Message,), { + 'DESCRIPTOR' : _CONTEXTID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ContextId) + }) +_sym_db.RegisterMessage(ContextId) + +Context = _reflection.GeneratedProtocolMessageType('Context', (_message.Message,), { + 'DESCRIPTOR' : _CONTEXT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Context) + }) +_sym_db.RegisterMessage(Context) + +ContextIdList = _reflection.GeneratedProtocolMessageType('ContextIdList', (_message.Message,), { + 'DESCRIPTOR' : _CONTEXTIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ContextIdList) + }) +_sym_db.RegisterMessage(ContextIdList) + +ContextList = _reflection.GeneratedProtocolMessageType('ContextList', (_message.Message,), { + 'DESCRIPTOR' : _CONTEXTLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ContextList) + }) +_sym_db.RegisterMessage(ContextList) + +ContextEvent = _reflection.GeneratedProtocolMessageType('ContextEvent', (_message.Message,), { + 'DESCRIPTOR' : _CONTEXTEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ContextEvent) + }) +_sym_db.RegisterMessage(ContextEvent) + +TopologyId = _reflection.GeneratedProtocolMessageType('TopologyId', (_message.Message,), { + 'DESCRIPTOR' : _TOPOLOGYID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.TopologyId) + }) +_sym_db.RegisterMessage(TopologyId) + +Topology = _reflection.GeneratedProtocolMessageType('Topology', (_message.Message,), { + 'DESCRIPTOR' : _TOPOLOGY, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Topology) + }) +_sym_db.RegisterMessage(Topology) + +TopologyIdList = _reflection.GeneratedProtocolMessageType('TopologyIdList', (_message.Message,), { + 'DESCRIPTOR' : _TOPOLOGYIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.TopologyIdList) + }) +_sym_db.RegisterMessage(TopologyIdList) + +TopologyList = _reflection.GeneratedProtocolMessageType('TopologyList', (_message.Message,), { + 'DESCRIPTOR' : _TOPOLOGYLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.TopologyList) + }) +_sym_db.RegisterMessage(TopologyList) + +TopologyEvent = _reflection.GeneratedProtocolMessageType('TopologyEvent', (_message.Message,), { + 'DESCRIPTOR' : _TOPOLOGYEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.TopologyEvent) + }) +_sym_db.RegisterMessage(TopologyEvent) + +DeviceId = _reflection.GeneratedProtocolMessageType('DeviceId', (_message.Message,), { + 'DESCRIPTOR' : _DEVICEID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.DeviceId) + }) +_sym_db.RegisterMessage(DeviceId) + +Device = _reflection.GeneratedProtocolMessageType('Device', (_message.Message,), { + 'DESCRIPTOR' : _DEVICE, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Device) + }) +_sym_db.RegisterMessage(Device) + +DeviceConfig = _reflection.GeneratedProtocolMessageType('DeviceConfig', (_message.Message,), { + 'DESCRIPTOR' : _DEVICECONFIG, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.DeviceConfig) + }) +_sym_db.RegisterMessage(DeviceConfig) + +DeviceIdList = _reflection.GeneratedProtocolMessageType('DeviceIdList', (_message.Message,), { + 'DESCRIPTOR' : _DEVICEIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.DeviceIdList) + }) +_sym_db.RegisterMessage(DeviceIdList) + +DeviceList = _reflection.GeneratedProtocolMessageType('DeviceList', (_message.Message,), { + 'DESCRIPTOR' : _DEVICELIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.DeviceList) + }) +_sym_db.RegisterMessage(DeviceList) + +DeviceEvent = _reflection.GeneratedProtocolMessageType('DeviceEvent', (_message.Message,), { + 'DESCRIPTOR' : _DEVICEEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.DeviceEvent) + }) +_sym_db.RegisterMessage(DeviceEvent) + +LinkId = _reflection.GeneratedProtocolMessageType('LinkId', (_message.Message,), { + 'DESCRIPTOR' : _LINKID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.LinkId) + }) +_sym_db.RegisterMessage(LinkId) + +Link = _reflection.GeneratedProtocolMessageType('Link', (_message.Message,), { + 'DESCRIPTOR' : _LINK, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Link) + }) +_sym_db.RegisterMessage(Link) + +LinkIdList = _reflection.GeneratedProtocolMessageType('LinkIdList', (_message.Message,), { + 'DESCRIPTOR' : _LINKIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.LinkIdList) + }) +_sym_db.RegisterMessage(LinkIdList) + +LinkList = _reflection.GeneratedProtocolMessageType('LinkList', (_message.Message,), { + 'DESCRIPTOR' : _LINKLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.LinkList) + }) +_sym_db.RegisterMessage(LinkList) + +LinkEvent = _reflection.GeneratedProtocolMessageType('LinkEvent', (_message.Message,), { + 'DESCRIPTOR' : _LINKEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.LinkEvent) + }) +_sym_db.RegisterMessage(LinkEvent) + +ServiceId = _reflection.GeneratedProtocolMessageType('ServiceId', (_message.Message,), { + 'DESCRIPTOR' : _SERVICEID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ServiceId) + }) +_sym_db.RegisterMessage(ServiceId) + +Service = _reflection.GeneratedProtocolMessageType('Service', (_message.Message,), { + 'DESCRIPTOR' : _SERVICE, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Service) + }) +_sym_db.RegisterMessage(Service) + +ServiceStatus = _reflection.GeneratedProtocolMessageType('ServiceStatus', (_message.Message,), { + 'DESCRIPTOR' : _SERVICESTATUS, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ServiceStatus) + }) +_sym_db.RegisterMessage(ServiceStatus) + +ServiceConfig = _reflection.GeneratedProtocolMessageType('ServiceConfig', (_message.Message,), { + 'DESCRIPTOR' : _SERVICECONFIG, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ServiceConfig) + }) +_sym_db.RegisterMessage(ServiceConfig) + +ServiceIdList = _reflection.GeneratedProtocolMessageType('ServiceIdList', (_message.Message,), { + 'DESCRIPTOR' : _SERVICEIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ServiceIdList) + }) +_sym_db.RegisterMessage(ServiceIdList) + +ServiceList = _reflection.GeneratedProtocolMessageType('ServiceList', (_message.Message,), { + 'DESCRIPTOR' : _SERVICELIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ServiceList) + }) +_sym_db.RegisterMessage(ServiceList) + +ServiceEvent = _reflection.GeneratedProtocolMessageType('ServiceEvent', (_message.Message,), { + 'DESCRIPTOR' : _SERVICEEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ServiceEvent) + }) +_sym_db.RegisterMessage(ServiceEvent) + +SliceId = _reflection.GeneratedProtocolMessageType('SliceId', (_message.Message,), { + 'DESCRIPTOR' : _SLICEID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceId) + }) +_sym_db.RegisterMessage(SliceId) + +Slice = _reflection.GeneratedProtocolMessageType('Slice', (_message.Message,), { + 'DESCRIPTOR' : _SLICE, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Slice) + }) +_sym_db.RegisterMessage(Slice) + +SliceStatus = _reflection.GeneratedProtocolMessageType('SliceStatus', (_message.Message,), { + 'DESCRIPTOR' : _SLICESTATUS, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceStatus) + }) +_sym_db.RegisterMessage(SliceStatus) + +SliceIdList = _reflection.GeneratedProtocolMessageType('SliceIdList', (_message.Message,), { + 'DESCRIPTOR' : _SLICEIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceIdList) + }) +_sym_db.RegisterMessage(SliceIdList) + +SliceList = _reflection.GeneratedProtocolMessageType('SliceList', (_message.Message,), { + 'DESCRIPTOR' : _SLICELIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceList) + }) +_sym_db.RegisterMessage(SliceList) + +SliceEvent = _reflection.GeneratedProtocolMessageType('SliceEvent', (_message.Message,), { + 'DESCRIPTOR' : _SLICEEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceEvent) + }) +_sym_db.RegisterMessage(SliceEvent) + +ConnectionId = _reflection.GeneratedProtocolMessageType('ConnectionId', (_message.Message,), { + 'DESCRIPTOR' : _CONNECTIONID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ConnectionId) + }) +_sym_db.RegisterMessage(ConnectionId) + +Connection = _reflection.GeneratedProtocolMessageType('Connection', (_message.Message,), { + 'DESCRIPTOR' : _CONNECTION, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Connection) + }) +_sym_db.RegisterMessage(Connection) + +ConnectionIdList = _reflection.GeneratedProtocolMessageType('ConnectionIdList', (_message.Message,), { + 'DESCRIPTOR' : _CONNECTIONIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ConnectionIdList) + }) +_sym_db.RegisterMessage(ConnectionIdList) + +ConnectionList = _reflection.GeneratedProtocolMessageType('ConnectionList', (_message.Message,), { + 'DESCRIPTOR' : _CONNECTIONLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ConnectionList) + }) +_sym_db.RegisterMessage(ConnectionList) + +ConnectionEvent = _reflection.GeneratedProtocolMessageType('ConnectionEvent', (_message.Message,), { + 'DESCRIPTOR' : _CONNECTIONEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ConnectionEvent) + }) +_sym_db.RegisterMessage(ConnectionEvent) + +EndPointId = _reflection.GeneratedProtocolMessageType('EndPointId', (_message.Message,), { + 'DESCRIPTOR' : _ENDPOINTID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.EndPointId) + }) +_sym_db.RegisterMessage(EndPointId) + +EndPoint = _reflection.GeneratedProtocolMessageType('EndPoint', (_message.Message,), { + 'DESCRIPTOR' : _ENDPOINT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.EndPoint) + }) +_sym_db.RegisterMessage(EndPoint) + +ConfigRule = _reflection.GeneratedProtocolMessageType('ConfigRule', (_message.Message,), { + 'DESCRIPTOR' : _CONFIGRULE, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ConfigRule) + }) +_sym_db.RegisterMessage(ConfigRule) + +Constraint = _reflection.GeneratedProtocolMessageType('Constraint', (_message.Message,), { + 'DESCRIPTOR' : _CONSTRAINT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Constraint) + }) +_sym_db.RegisterMessage(Constraint) + +TeraFlowController = _reflection.GeneratedProtocolMessageType('TeraFlowController', (_message.Message,), { + 'DESCRIPTOR' : _TERAFLOWCONTROLLER, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.TeraFlowController) + }) +_sym_db.RegisterMessage(TeraFlowController) + +AuthenticationResult = _reflection.GeneratedProtocolMessageType('AuthenticationResult', (_message.Message,), { + 'DESCRIPTOR' : _AUTHENTICATIONRESULT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.AuthenticationResult) + }) +_sym_db.RegisterMessage(AuthenticationResult) + + + +_CONTEXTSERVICE = _descriptor.ServiceDescriptor( + name='ContextService', + full_name='context.ContextService', + file=DESCRIPTOR, + index=0, + serialized_options=None, + create_key=_descriptor._internal_create_key, + serialized_start=5273, + serialized_end=7688, + methods=[ + _descriptor.MethodDescriptor( + name='ListContextIds', + full_name='context.ContextService.ListContextIds', + index=0, + containing_service=None, + input_type=_EMPTY, + output_type=_CONTEXTIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListContexts', + full_name='context.ContextService.ListContexts', + index=1, + containing_service=None, + input_type=_EMPTY, + output_type=_CONTEXTLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetContext', + full_name='context.ContextService.GetContext', + index=2, + containing_service=None, + input_type=_CONTEXTID, + output_type=_CONTEXT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetContext', + full_name='context.ContextService.SetContext', + index=3, + containing_service=None, + input_type=_CONTEXT, + output_type=_CONTEXTID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveContext', + full_name='context.ContextService.RemoveContext', + index=4, + containing_service=None, + input_type=_CONTEXTID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetContextEvents', + full_name='context.ContextService.GetContextEvents', + index=5, + containing_service=None, + input_type=_EMPTY, + output_type=_CONTEXTEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListTopologyIds', + full_name='context.ContextService.ListTopologyIds', + index=6, + containing_service=None, + input_type=_CONTEXTID, + output_type=_TOPOLOGYIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListTopologies', + full_name='context.ContextService.ListTopologies', + index=7, + containing_service=None, + input_type=_CONTEXTID, + output_type=_TOPOLOGYLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetTopology', + full_name='context.ContextService.GetTopology', + index=8, + containing_service=None, + input_type=_TOPOLOGYID, + output_type=_TOPOLOGY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetTopology', + full_name='context.ContextService.SetTopology', + index=9, + containing_service=None, + input_type=_TOPOLOGY, + output_type=_TOPOLOGYID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveTopology', + full_name='context.ContextService.RemoveTopology', + index=10, + containing_service=None, + input_type=_TOPOLOGYID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetTopologyEvents', + full_name='context.ContextService.GetTopologyEvents', + index=11, + containing_service=None, + input_type=_EMPTY, + output_type=_TOPOLOGYEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListDeviceIds', + full_name='context.ContextService.ListDeviceIds', + index=12, + containing_service=None, + input_type=_EMPTY, + output_type=_DEVICEIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListDevices', + full_name='context.ContextService.ListDevices', + index=13, + containing_service=None, + input_type=_EMPTY, + output_type=_DEVICELIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetDevice', + full_name='context.ContextService.GetDevice', + index=14, + containing_service=None, + input_type=_DEVICEID, + output_type=_DEVICE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetDevice', + full_name='context.ContextService.SetDevice', + index=15, + containing_service=None, + input_type=_DEVICE, + output_type=_DEVICEID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveDevice', + full_name='context.ContextService.RemoveDevice', + index=16, + containing_service=None, + input_type=_DEVICEID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetDeviceEvents', + full_name='context.ContextService.GetDeviceEvents', + index=17, + containing_service=None, + input_type=_EMPTY, + output_type=_DEVICEEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListLinkIds', + full_name='context.ContextService.ListLinkIds', + index=18, + containing_service=None, + input_type=_EMPTY, + output_type=_LINKIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListLinks', + full_name='context.ContextService.ListLinks', + index=19, + containing_service=None, + input_type=_EMPTY, + output_type=_LINKLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetLink', + full_name='context.ContextService.GetLink', + index=20, + containing_service=None, + input_type=_LINKID, + output_type=_LINK, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetLink', + full_name='context.ContextService.SetLink', + index=21, + containing_service=None, + input_type=_LINK, + output_type=_LINKID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveLink', + full_name='context.ContextService.RemoveLink', + index=22, + containing_service=None, + input_type=_LINKID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetLinkEvents', + full_name='context.ContextService.GetLinkEvents', + index=23, + containing_service=None, + input_type=_EMPTY, + output_type=_LINKEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListServiceIds', + full_name='context.ContextService.ListServiceIds', + index=24, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SERVICEIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListServices', + full_name='context.ContextService.ListServices', + index=25, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SERVICELIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetService', + full_name='context.ContextService.GetService', + index=26, + containing_service=None, + input_type=_SERVICEID, + output_type=_SERVICE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetService', + full_name='context.ContextService.SetService', + index=27, + containing_service=None, + input_type=_SERVICE, + output_type=_SERVICEID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveService', + full_name='context.ContextService.RemoveService', + index=28, + containing_service=None, + input_type=_SERVICEID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetServiceEvents', + full_name='context.ContextService.GetServiceEvents', + index=29, + containing_service=None, + input_type=_EMPTY, + output_type=_SERVICEEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListSliceIds', + full_name='context.ContextService.ListSliceIds', + index=30, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SLICEIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListSlices', + full_name='context.ContextService.ListSlices', + index=31, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SLICELIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetSlice', + full_name='context.ContextService.GetSlice', + index=32, + containing_service=None, + input_type=_SLICEID, + output_type=_SLICE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetSlice', + full_name='context.ContextService.SetSlice', + index=33, + containing_service=None, + input_type=_SLICE, + output_type=_SLICEID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveSlice', + full_name='context.ContextService.RemoveSlice', + index=34, + containing_service=None, + input_type=_SLICEID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetSliceEvents', + full_name='context.ContextService.GetSliceEvents', + index=35, + containing_service=None, + input_type=_EMPTY, + output_type=_SLICEEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListConnectionIds', + full_name='context.ContextService.ListConnectionIds', + index=36, + containing_service=None, + input_type=_SERVICEID, + output_type=_CONNECTIONIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListConnections', + full_name='context.ContextService.ListConnections', + index=37, + containing_service=None, + input_type=_SERVICEID, + output_type=_CONNECTIONLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetConnection', + full_name='context.ContextService.GetConnection', + index=38, + containing_service=None, + input_type=_CONNECTIONID, + output_type=_CONNECTION, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetConnection', + full_name='context.ContextService.SetConnection', + index=39, + containing_service=None, + input_type=_CONNECTION, + output_type=_CONNECTIONID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveConnection', + full_name='context.ContextService.RemoveConnection', + index=40, + containing_service=None, + input_type=_CONNECTIONID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetConnectionEvents', + full_name='context.ContextService.GetConnectionEvents', + index=41, + containing_service=None, + input_type=_EMPTY, + output_type=_CONNECTIONEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), +]) +_sym_db.RegisterServiceDescriptor(_CONTEXTSERVICE) + +DESCRIPTOR.services_by_name['ContextService'] = _CONTEXTSERVICE + +# @@protoc_insertion_point(module_scope) diff --git a/src/l3_attackmitigator/proto/kpi_sample_types_pb2.py b/src/l3_attackmitigator/proto/kpi_sample_types_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..ea7fd2f82757d4c3db02d7e2c7817e2787b0b490 --- /dev/null +++ b/src/l3_attackmitigator/proto/kpi_sample_types_pb2.py @@ -0,0 +1,78 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: kpi_sample_types.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='kpi_sample_types.proto', + package='kpi_sample_types', + syntax='proto3', + serialized_options=None, + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n\x16kpi_sample_types.proto\x12\x10kpi_sample_types*\xbe\x01\n\rKpiSampleType\x12\x19\n\x15KPISAMPLETYPE_UNKNOWN\x10\x00\x12%\n!KPISAMPLETYPE_PACKETS_TRANSMITTED\x10\x65\x12\"\n\x1eKPISAMPLETYPE_PACKETS_RECEIVED\x10\x66\x12$\n\x1fKPISAMPLETYPE_BYTES_TRANSMITTED\x10\xc9\x01\x12!\n\x1cKPISAMPLETYPE_BYTES_RECEIVED\x10\xca\x01\x62\x06proto3' +) + +_KPISAMPLETYPE = _descriptor.EnumDescriptor( + name='KpiSampleType', + full_name='kpi_sample_types.KpiSampleType', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='KPISAMPLETYPE_UNKNOWN', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='KPISAMPLETYPE_PACKETS_TRANSMITTED', index=1, number=101, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='KPISAMPLETYPE_PACKETS_RECEIVED', index=2, number=102, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='KPISAMPLETYPE_BYTES_TRANSMITTED', index=3, number=201, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='KPISAMPLETYPE_BYTES_RECEIVED', index=4, number=202, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=45, + serialized_end=235, +) +_sym_db.RegisterEnumDescriptor(_KPISAMPLETYPE) + +KpiSampleType = enum_type_wrapper.EnumTypeWrapper(_KPISAMPLETYPE) +KPISAMPLETYPE_UNKNOWN = 0 +KPISAMPLETYPE_PACKETS_TRANSMITTED = 101 +KPISAMPLETYPE_PACKETS_RECEIVED = 102 +KPISAMPLETYPE_BYTES_TRANSMITTED = 201 +KPISAMPLETYPE_BYTES_RECEIVED = 202 + + +DESCRIPTOR.enum_types_by_name['KpiSampleType'] = _KPISAMPLETYPE +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + + +# @@protoc_insertion_point(module_scope) diff --git a/src/l3_attackmitigator/proto/l3_attackmitigator_pb2.py b/src/l3_attackmitigator/proto/l3_attackmitigator_pb2.py index 0ad49c2ed33f8f352f200cf23c2b871683b9d086..e148d0a2cfda7b7ea00b40218dcfe3dcb70f1f8f 100644 --- a/src/l3_attackmitigator/proto/l3_attackmitigator_pb2.py +++ b/src/l3_attackmitigator/proto/l3_attackmitigator_pb2.py @@ -11,6 +11,7 @@ from google.protobuf import symbol_database as _symbol_database _sym_db = _symbol_database.Default() +from . import context_pb2 as context__pb2 DESCRIPTOR = _descriptor.FileDescriptor( @@ -19,129 +20,93 @@ DESCRIPTOR = _descriptor.FileDescriptor( syntax='proto3', serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x18l3_attackmitigator.proto\"2\n\x0e\x45mptyMitigator\x12\x14\n\x07message\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\n\n\x08_message\"\xf9\x01\n\x06Output\x12\x12\n\nconfidence\x18\x01 \x01(\x02\x12\x11\n\ttimestamp\x18\x02 \x01(\t\x12\x0c\n\x04ip_o\x18\x03 \x01(\t\x12\x10\n\x08tag_name\x18\x04 \x01(\t\x12\x0b\n\x03tag\x18\x05 \x01(\x05\x12\x0f\n\x07\x66low_id\x18\x06 \x01(\t\x12\x10\n\x08protocol\x18\x07 \x01(\t\x12\x0e\n\x06port_d\x18\x08 \x01(\t\x12\x12\n\x05ml_id\x18\t \x01(\tH\x00\x88\x01\x01\x12\x17\n\ntime_start\x18\n \x01(\x02H\x01\x88\x01\x01\x12\x15\n\x08time_end\x18\x0b \x01(\x02H\x02\x88\x01\x01\x42\x08\n\x06_ml_idB\r\n\x0b_time_startB\x0b\n\t_time_end2r\n\x11L3Attackmitigator\x12(\n\nSendOutput\x12\x07.Output\x1a\x0f.EmptyMitigator\"\x00\x12\x33\n\rGetMitigation\x12\x0f.EmptyMitigator\x1a\x0f.EmptyMitigator\"\x00\x62\x06proto3' -) + serialized_pb=b'\n\x18l3_attackmitigator.proto\x1a\rcontext.proto\"\xd5\x01\n\x17L3AttackmitigatorOutput\x12\x12\n\nconfidence\x18\x01 \x01(\x02\x12\x11\n\ttimestamp\x18\x02 \x01(\t\x12\x0c\n\x04ip_o\x18\x03 \x01(\t\x12\x10\n\x08tag_name\x18\x04 \x01(\t\x12\x0b\n\x03tag\x18\x05 \x01(\x05\x12\x0f\n\x07\x66low_id\x18\x06 \x01(\t\x12\x10\n\x08protocol\x18\x07 \x01(\t\x12\x0e\n\x06port_d\x18\x08 \x01(\t\x12\r\n\x05ml_id\x18\t \x01(\t\x12\x12\n\ntime_start\x18\n \x01(\x02\x12\x10\n\x08time_end\x18\x0b \x01(\x02\x32\x80\x01\n\x11L3Attackmitigator\x12\x38\n\nSendOutput\x12\x18.L3AttackmitigatorOutput\x1a\x0e.context.Empty\"\x00\x12\x31\n\rGetMitigation\x12\x0e.context.Empty\x1a\x0e.context.Empty\"\x00\x62\x06proto3' + , + dependencies=[context__pb2.DESCRIPTOR,]) -_EMPTYMITIGATOR = _descriptor.Descriptor( - name='EmptyMitigator', - full_name='EmptyMitigator', +_L3ATTACKMITIGATOROUTPUT = _descriptor.Descriptor( + name='L3AttackmitigatorOutput', + full_name='L3AttackmitigatorOutput', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='message', full_name='EmptyMitigator.message', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='_message', full_name='EmptyMitigator._message', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=28, - serialized_end=78, -) - - -_OUTPUT = _descriptor.Descriptor( - name='Output', - full_name='Output', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='confidence', full_name='Output.confidence', index=0, + name='confidence', full_name='L3AttackmitigatorOutput.confidence', index=0, number=1, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='timestamp', full_name='Output.timestamp', index=1, + name='timestamp', full_name='L3AttackmitigatorOutput.timestamp', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='ip_o', full_name='Output.ip_o', index=2, + name='ip_o', full_name='L3AttackmitigatorOutput.ip_o', index=2, number=3, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='tag_name', full_name='Output.tag_name', index=3, + name='tag_name', full_name='L3AttackmitigatorOutput.tag_name', index=3, number=4, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='tag', full_name='Output.tag', index=4, + name='tag', full_name='L3AttackmitigatorOutput.tag', index=4, number=5, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='flow_id', full_name='Output.flow_id', index=5, + name='flow_id', full_name='L3AttackmitigatorOutput.flow_id', index=5, number=6, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='protocol', full_name='Output.protocol', index=6, + name='protocol', full_name='L3AttackmitigatorOutput.protocol', index=6, number=7, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='port_d', full_name='Output.port_d', index=7, + name='port_d', full_name='L3AttackmitigatorOutput.port_d', index=7, number=8, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='ml_id', full_name='Output.ml_id', index=8, + name='ml_id', full_name='L3AttackmitigatorOutput.ml_id', index=8, number=9, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='time_start', full_name='Output.time_start', index=9, + name='time_start', full_name='L3AttackmitigatorOutput.time_start', index=9, number=10, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='time_end', full_name='Output.time_end', index=10, + name='time_end', full_name='L3AttackmitigatorOutput.time_end', index=10, number=11, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, @@ -158,55 +123,20 @@ _OUTPUT = _descriptor.Descriptor( syntax='proto3', extension_ranges=[], oneofs=[ - _descriptor.OneofDescriptor( - name='_ml_id', full_name='Output._ml_id', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - _descriptor.OneofDescriptor( - name='_time_start', full_name='Output._time_start', - index=1, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - _descriptor.OneofDescriptor( - name='_time_end', full_name='Output._time_end', - index=2, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), ], - serialized_start=81, - serialized_end=330, + serialized_start=44, + serialized_end=257, ) -_EMPTYMITIGATOR.oneofs_by_name['_message'].fields.append( - _EMPTYMITIGATOR.fields_by_name['message']) -_EMPTYMITIGATOR.fields_by_name['message'].containing_oneof = _EMPTYMITIGATOR.oneofs_by_name['_message'] -_OUTPUT.oneofs_by_name['_ml_id'].fields.append( - _OUTPUT.fields_by_name['ml_id']) -_OUTPUT.fields_by_name['ml_id'].containing_oneof = _OUTPUT.oneofs_by_name['_ml_id'] -_OUTPUT.oneofs_by_name['_time_start'].fields.append( - _OUTPUT.fields_by_name['time_start']) -_OUTPUT.fields_by_name['time_start'].containing_oneof = _OUTPUT.oneofs_by_name['_time_start'] -_OUTPUT.oneofs_by_name['_time_end'].fields.append( - _OUTPUT.fields_by_name['time_end']) -_OUTPUT.fields_by_name['time_end'].containing_oneof = _OUTPUT.oneofs_by_name['_time_end'] -DESCRIPTOR.message_types_by_name['EmptyMitigator'] = _EMPTYMITIGATOR -DESCRIPTOR.message_types_by_name['Output'] = _OUTPUT +DESCRIPTOR.message_types_by_name['L3AttackmitigatorOutput'] = _L3ATTACKMITIGATOROUTPUT _sym_db.RegisterFileDescriptor(DESCRIPTOR) -EmptyMitigator = _reflection.GeneratedProtocolMessageType('EmptyMitigator', (_message.Message,), { - 'DESCRIPTOR' : _EMPTYMITIGATOR, - '__module__' : 'l3_attackmitigator_pb2' - # @@protoc_insertion_point(class_scope:EmptyMitigator) - }) -_sym_db.RegisterMessage(EmptyMitigator) - -Output = _reflection.GeneratedProtocolMessageType('Output', (_message.Message,), { - 'DESCRIPTOR' : _OUTPUT, +L3AttackmitigatorOutput = _reflection.GeneratedProtocolMessageType('L3AttackmitigatorOutput', (_message.Message,), { + 'DESCRIPTOR' : _L3ATTACKMITIGATOROUTPUT, '__module__' : 'l3_attackmitigator_pb2' - # @@protoc_insertion_point(class_scope:Output) + # @@protoc_insertion_point(class_scope:L3AttackmitigatorOutput) }) -_sym_db.RegisterMessage(Output) +_sym_db.RegisterMessage(L3AttackmitigatorOutput) @@ -217,16 +147,16 @@ _L3ATTACKMITIGATOR = _descriptor.ServiceDescriptor( index=0, serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_start=332, - serialized_end=446, + serialized_start=260, + serialized_end=388, methods=[ _descriptor.MethodDescriptor( name='SendOutput', full_name='L3Attackmitigator.SendOutput', index=0, containing_service=None, - input_type=_OUTPUT, - output_type=_EMPTYMITIGATOR, + input_type=_L3ATTACKMITIGATOROUTPUT, + output_type=context__pb2._EMPTY, serialized_options=None, create_key=_descriptor._internal_create_key, ), @@ -235,8 +165,8 @@ _L3ATTACKMITIGATOR = _descriptor.ServiceDescriptor( full_name='L3Attackmitigator.GetMitigation', index=1, containing_service=None, - input_type=_EMPTYMITIGATOR, - output_type=_EMPTYMITIGATOR, + input_type=context__pb2._EMPTY, + output_type=context__pb2._EMPTY, serialized_options=None, create_key=_descriptor._internal_create_key, ), diff --git a/src/l3_attackmitigator/proto/l3_attackmitigator_pb2_grpc.py b/src/l3_attackmitigator/proto/l3_attackmitigator_pb2_grpc.py index 3942d6843f99a341c8a6db7028e0d62a74d8ddb2..25d4afdbad81390589992b48374eb2226a31647e 100644 --- a/src/l3_attackmitigator/proto/l3_attackmitigator_pb2_grpc.py +++ b/src/l3_attackmitigator/proto/l3_attackmitigator_pb2_grpc.py @@ -2,7 +2,7 @@ """Client and server classes corresponding to protobuf-defined services.""" import grpc - +from . import context_pb2 as context__pb2 from . import l3_attackmitigator_pb2 as l3__attackmitigator__pb2 @@ -17,13 +17,13 @@ class L3AttackmitigatorStub(object): """ self.SendOutput = channel.unary_unary( '/L3Attackmitigator/SendOutput', - request_serializer=l3__attackmitigator__pb2.Output.SerializeToString, - response_deserializer=l3__attackmitigator__pb2.EmptyMitigator.FromString, + request_serializer=l3__attackmitigator__pb2.L3AttackmitigatorOutput.SerializeToString, + response_deserializer=context__pb2.Empty.FromString, ) self.GetMitigation = channel.unary_unary( '/L3Attackmitigator/GetMitigation', - request_serializer=l3__attackmitigator__pb2.EmptyMitigator.SerializeToString, - response_deserializer=l3__attackmitigator__pb2.EmptyMitigator.FromString, + request_serializer=context__pb2.Empty.SerializeToString, + response_deserializer=context__pb2.Empty.FromString, ) @@ -49,13 +49,13 @@ def add_L3AttackmitigatorServicer_to_server(servicer, server): rpc_method_handlers = { 'SendOutput': grpc.unary_unary_rpc_method_handler( servicer.SendOutput, - request_deserializer=l3__attackmitigator__pb2.Output.FromString, - response_serializer=l3__attackmitigator__pb2.EmptyMitigator.SerializeToString, + request_deserializer=l3__attackmitigator__pb2.L3AttackmitigatorOutput.FromString, + response_serializer=context__pb2.Empty.SerializeToString, ), 'GetMitigation': grpc.unary_unary_rpc_method_handler( servicer.GetMitigation, - request_deserializer=l3__attackmitigator__pb2.EmptyMitigator.FromString, - response_serializer=l3__attackmitigator__pb2.EmptyMitigator.SerializeToString, + request_deserializer=context__pb2.Empty.FromString, + response_serializer=context__pb2.Empty.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( @@ -79,8 +79,8 @@ class L3Attackmitigator(object): timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/L3Attackmitigator/SendOutput', - l3__attackmitigator__pb2.Output.SerializeToString, - l3__attackmitigator__pb2.EmptyMitigator.FromString, + l3__attackmitigator__pb2.L3AttackmitigatorOutput.SerializeToString, + context__pb2.Empty.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @@ -96,7 +96,7 @@ class L3Attackmitigator(object): timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/L3Attackmitigator/GetMitigation', - l3__attackmitigator__pb2.EmptyMitigator.SerializeToString, - l3__attackmitigator__pb2.EmptyMitigator.FromString, + context__pb2.Empty.SerializeToString, + context__pb2.Empty.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/src/l3_centralizedattackdetector/.gitlab-ci.yml b/src/l3_centralizedattackdetector/.gitlab-ci.yml index 43ca269d3c8c1456d86717f423c81fafbc5b03af..ca95af8816ce01b433d462a5d09d8ef14776734f 100644 --- a/src/l3_centralizedattackdetector/.gitlab-ci.yml +++ b/src/l3_centralizedattackdetector/.gitlab-ci.yml @@ -55,7 +55,6 @@ unit test l3_centralizedattackdetector: - docker ps -a - docker logs $IMAGE_NAME - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml" - - docker exec -i $IMAGE_NAME bash -c "coverage xml -o /opt/results/${IMAGE_NAME}_coverage.xml" - docker exec -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing" coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' after_script: @@ -75,7 +74,6 @@ unit test l3_centralizedattackdetector: when: always reports: junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml - cobertura: src/$IMAGE_NAME/tests/${IMAGE_NAME}_coverage.xml # Deployment of the service in Kubernetes Cluster deploy l3_centralizedattackdetector: diff --git a/src/l3_centralizedattackdetector/genproto.sh b/src/l3_centralizedattackdetector/genproto.sh old mode 100644 new mode 100755 index a68c8638db15b776a7d1f70484daf2651c72253a..54b16a486f893938a4970c5c28f80505dec5fc40 --- a/src/l3_centralizedattackdetector/genproto.sh +++ b/src/l3_centralizedattackdetector/genproto.sh @@ -1,6 +1,6 @@ #!/bin/bash -eu # -# Copyright 2018 Google LLC +# 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. @@ -14,19 +14,39 @@ # See the License for the specific language governing permissions and # limitations under the License. -#!/bin/bash -e - # Make folder containing the script the root folder for its execution cd $(dirname $0) rm -rf proto/*.py rm -rf proto/__pycache__ -touch proto/__init__.py +tee proto/__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. -python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto l3_centralizedattackdetector.proto +EOF + +python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto context.proto +python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto kpi_sample_types.proto python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto l3_attackmitigator.proto +python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto l3_centralizedattackdetector.proto + +rm proto/context_pb2_grpc.py +rm proto/kpi_sample_types_pb2_grpc.py +rm proto/l3_attackmitigator_pb2_grpc.py +sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/context_pb2.py +sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/kpi_sample_types_pb2.py sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/l3_centralizedattackdetector_pb2.py sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/l3_centralizedattackdetector_pb2_grpc.py sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/l3_attackmitigator_pb2.py -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/l3_attackmitigator_pb2_grpc.py diff --git a/src/l3_centralizedattackdetector/proto/context_pb2.py b/src/l3_centralizedattackdetector/proto/context_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..50d501d3ac053ad644554331af26e3c40cd426a1 --- /dev/null +++ b/src/l3_centralizedattackdetector/proto/context_pb2.py @@ -0,0 +1,3071 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: context.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from . import kpi_sample_types_pb2 as kpi__sample__types__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='context.proto', + package='context', + syntax='proto3', + serialized_options=None, + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n\rcontext.proto\x12\x07\x63ontext\x1a\x16kpi_sample_types.proto\"\x07\n\x05\x45mpty\"\x14\n\x04Uuid\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"F\n\x05\x45vent\x12\x11\n\ttimestamp\x18\x01 \x01(\x01\x12*\n\nevent_type\x18\x02 \x01(\x0e\x32\x16.context.EventTypeEnum\"0\n\tContextId\x12#\n\x0c\x63ontext_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xb6\x01\n\x07\x43ontext\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12)\n\x0ctopology_ids\x18\x02 \x03(\x0b\x32\x13.context.TopologyId\x12\'\n\x0bservice_ids\x18\x03 \x03(\x0b\x32\x12.context.ServiceId\x12/\n\ncontroller\x18\x04 \x01(\x0b\x32\x1b.context.TeraFlowController\"8\n\rContextIdList\x12\'\n\x0b\x63ontext_ids\x18\x01 \x03(\x0b\x32\x12.context.ContextId\"1\n\x0b\x43ontextList\x12\"\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32\x10.context.Context\"U\n\x0c\x43ontextEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\ncontext_id\x18\x02 \x01(\x0b\x32\x12.context.ContextId\"Z\n\nTopologyId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12$\n\rtopology_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"~\n\x08Topology\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12%\n\ndevice_ids\x18\x02 \x03(\x0b\x32\x11.context.DeviceId\x12!\n\x08link_ids\x18\x03 \x03(\x0b\x32\x0f.context.LinkId\";\n\x0eTopologyIdList\x12)\n\x0ctopology_ids\x18\x01 \x03(\x0b\x32\x13.context.TopologyId\"5\n\x0cTopologyList\x12%\n\ntopologies\x18\x01 \x03(\x0b\x32\x11.context.Topology\"X\n\rTopologyEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12(\n\x0btopology_id\x18\x02 \x01(\x0b\x32\x13.context.TopologyId\".\n\x08\x44\x65viceId\x12\"\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x9a\x02\n\x06\x44\x65vice\x12$\n\tdevice_id\x18\x01 \x01(\x0b\x32\x11.context.DeviceId\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12,\n\rdevice_config\x18\x03 \x01(\x0b\x32\x15.context.DeviceConfig\x12G\n\x19\x64\x65vice_operational_status\x18\x04 \x01(\x0e\x32$.context.DeviceOperationalStatusEnum\x12\x31\n\x0e\x64\x65vice_drivers\x18\x05 \x03(\x0e\x32\x19.context.DeviceDriverEnum\x12+\n\x10\x64\x65vice_endpoints\x18\x06 \x03(\x0b\x32\x11.context.EndPoint\"9\n\x0c\x44\x65viceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"5\n\x0c\x44\x65viceIdList\x12%\n\ndevice_ids\x18\x01 \x03(\x0b\x32\x11.context.DeviceId\".\n\nDeviceList\x12 \n\x07\x64\x65vices\x18\x01 \x03(\x0b\x32\x0f.context.Device\"R\n\x0b\x44\x65viceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"*\n\x06LinkId\x12 \n\tlink_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"X\n\x04Link\x12 \n\x07link_id\x18\x01 \x01(\x0b\x32\x0f.context.LinkId\x12.\n\x11link_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\"/\n\nLinkIdList\x12!\n\x08link_ids\x18\x01 \x03(\x0b\x32\x0f.context.LinkId\"(\n\x08LinkList\x12\x1c\n\x05links\x18\x01 \x03(\x0b\x32\r.context.Link\"L\n\tLinkEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12 \n\x07link_id\x18\x02 \x01(\x0b\x32\x0f.context.LinkId\"X\n\tServiceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12#\n\x0cservice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\xa6\x02\n\x07Service\x12&\n\nservice_id\x18\x01 \x01(\x0b\x32\x12.context.ServiceId\x12.\n\x0cservice_type\x18\x02 \x01(\x0e\x32\x18.context.ServiceTypeEnum\x12\x31\n\x14service_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12\x30\n\x13service_constraints\x18\x04 \x03(\x0b\x32\x13.context.Constraint\x12.\n\x0eservice_status\x18\x05 \x01(\x0b\x32\x16.context.ServiceStatus\x12.\n\x0eservice_config\x18\x06 \x01(\x0b\x32\x16.context.ServiceConfig\"C\n\rServiceStatus\x12\x32\n\x0eservice_status\x18\x01 \x01(\x0e\x32\x1a.context.ServiceStatusEnum\":\n\rServiceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"8\n\rServiceIdList\x12\'\n\x0bservice_ids\x18\x01 \x03(\x0b\x32\x12.context.ServiceId\"1\n\x0bServiceList\x12\"\n\x08services\x18\x01 \x03(\x0b\x32\x10.context.Service\"U\n\x0cServiceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\"T\n\x07SliceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12!\n\nslice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\x95\x02\n\x05Slice\x12\"\n\x08slice_id\x18\x01 \x01(\x0b\x32\x10.context.SliceId\x12/\n\x12slice_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\x12.\n\x11slice_constraints\x18\x03 \x03(\x0b\x32\x13.context.Constraint\x12-\n\x11slice_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\x12,\n\x12slice_subslice_ids\x18\x05 \x03(\x0b\x32\x10.context.SliceId\x12*\n\x0cslice_status\x18\x06 \x01(\x0b\x32\x14.context.SliceStatus\"=\n\x0bSliceStatus\x12.\n\x0cslice_status\x18\x01 \x01(\x0e\x32\x18.context.SliceStatusEnum\"2\n\x0bSliceIdList\x12#\n\tslice_ids\x18\x01 \x03(\x0b\x32\x10.context.SliceId\"+\n\tSliceList\x12\x1e\n\x06slices\x18\x01 \x03(\x0b\x32\x0e.context.Slice\"O\n\nSliceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12\"\n\x08slice_id\x18\x02 \x01(\x0b\x32\x10.context.SliceId\"6\n\x0c\x43onnectionId\x12&\n\x0f\x63onnection_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xc4\x01\n\nConnection\x12,\n\rconnection_id\x18\x01 \x01(\x0b\x32\x15.context.ConnectionId\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\x12\x33\n\x16path_hops_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12+\n\x0fsub_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\"A\n\x10\x43onnectionIdList\x12-\n\x0e\x63onnection_ids\x18\x01 \x03(\x0b\x32\x15.context.ConnectionId\":\n\x0e\x43onnectionList\x12(\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x13.context.Connection\"^\n\x0f\x43onnectionEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12,\n\rconnection_id\x18\x02 \x01(\x0b\x32\x15.context.ConnectionId\"\x82\x01\n\nEndPointId\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\x12$\n\rendpoint_uuid\x18\x03 \x01(\x0b\x32\r.context.Uuid\"\x86\x01\n\x08\x45ndPoint\x12(\n\x0b\x65ndpoint_id\x18\x01 \x01(\x0b\x32\x13.context.EndPointId\x12\x15\n\rendpoint_type\x18\x02 \x01(\t\x12\x39\n\x10kpi_sample_types\x18\x03 \x03(\x0e\x32\x1f.kpi_sample_types.KpiSampleType\"e\n\nConfigRule\x12)\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x19.context.ConfigActionEnum\x12\x14\n\x0cresource_key\x18\x02 \x01(\t\x12\x16\n\x0eresource_value\x18\x03 \x01(\t\"?\n\nConstraint\x12\x17\n\x0f\x63onstraint_type\x18\x01 \x01(\t\x12\x18\n\x10\x63onstraint_value\x18\x02 \x01(\t\"^\n\x12TeraFlowController\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x12\n\nip_address\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\"U\n\x14\x41uthenticationResult\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x15\n\rauthenticated\x18\x02 \x01(\x08*j\n\rEventTypeEnum\x12\x17\n\x13\x45VENTTYPE_UNDEFINED\x10\x00\x12\x14\n\x10\x45VENTTYPE_CREATE\x10\x01\x12\x14\n\x10\x45VENTTYPE_UPDATE\x10\x02\x12\x14\n\x10\x45VENTTYPE_REMOVE\x10\x03*\xc5\x01\n\x10\x44\x65viceDriverEnum\x12\x1a\n\x16\x44\x45VICEDRIVER_UNDEFINED\x10\x00\x12\x1b\n\x17\x44\x45VICEDRIVER_OPENCONFIG\x10\x01\x12\x1e\n\x1a\x44\x45VICEDRIVER_TRANSPORT_API\x10\x02\x12\x13\n\x0f\x44\x45VICEDRIVER_P4\x10\x03\x12&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOGY\x10\x04\x12\x1b\n\x17\x44\x45VICEDRIVER_ONF_TR_352\x10\x05*\x8f\x01\n\x1b\x44\x65viceOperationalStatusEnum\x12%\n!DEVICEOPERATIONALSTATUS_UNDEFINED\x10\x00\x12$\n DEVICEOPERATIONALSTATUS_DISABLED\x10\x01\x12#\n\x1f\x44\x45VICEOPERATIONALSTATUS_ENABLED\x10\x02*\x81\x01\n\x0fServiceTypeEnum\x12\x17\n\x13SERVICETYPE_UNKNOWN\x10\x00\x12\x14\n\x10SERVICETYPE_L3NM\x10\x01\x12\x14\n\x10SERVICETYPE_L2NM\x10\x02\x12)\n%SERVICETYPE_TAPI_CONNECTIVITY_SERVICE\x10\x03*\x88\x01\n\x11ServiceStatusEnum\x12\x1b\n\x17SERVICESTATUS_UNDEFINED\x10\x00\x12\x19\n\x15SERVICESTATUS_PLANNED\x10\x01\x12\x18\n\x14SERVICESTATUS_ACTIVE\x10\x02\x12!\n\x1dSERVICESTATUS_PENDING_REMOVAL\x10\x03*\x8b\x01\n\x0fSliceStatusEnum\x12\x19\n\x15SLICESTATUS_UNDEFINED\x10\x00\x12\x17\n\x13SLICESTATUS_PLANNED\x10\x01\x12\x14\n\x10SLICESTATUS_INIT\x10\x02\x12\x16\n\x12SLICESTATUS_ACTIVE\x10\x03\x12\x16\n\x12SLICESTATUS_DEINIT\x10\x04*]\n\x10\x43onfigActionEnum\x12\x1a\n\x16\x43ONFIGACTION_UNDEFINED\x10\x00\x12\x14\n\x10\x43ONFIGACTION_SET\x10\x01\x12\x17\n\x13\x43ONFIGACTION_DELETE\x10\x02\x32\xef\x12\n\x0e\x43ontextService\x12:\n\x0eListContextIds\x12\x0e.context.Empty\x1a\x16.context.ContextIdList\"\x00\x12\x36\n\x0cListContexts\x12\x0e.context.Empty\x1a\x14.context.ContextList\"\x00\x12\x34\n\nGetContext\x12\x12.context.ContextId\x1a\x10.context.Context\"\x00\x12\x34\n\nSetContext\x12\x10.context.Context\x1a\x12.context.ContextId\"\x00\x12\x35\n\rRemoveContext\x12\x12.context.ContextId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetContextEvents\x12\x0e.context.Empty\x1a\x15.context.ContextEvent\"\x00\x30\x01\x12@\n\x0fListTopologyIds\x12\x12.context.ContextId\x1a\x17.context.TopologyIdList\"\x00\x12=\n\x0eListTopologies\x12\x12.context.ContextId\x1a\x15.context.TopologyList\"\x00\x12\x37\n\x0bGetTopology\x12\x13.context.TopologyId\x1a\x11.context.Topology\"\x00\x12\x37\n\x0bSetTopology\x12\x11.context.Topology\x1a\x13.context.TopologyId\"\x00\x12\x37\n\x0eRemoveTopology\x12\x13.context.TopologyId\x1a\x0e.context.Empty\"\x00\x12?\n\x11GetTopologyEvents\x12\x0e.context.Empty\x1a\x16.context.TopologyEvent\"\x00\x30\x01\x12\x38\n\rListDeviceIds\x12\x0e.context.Empty\x1a\x15.context.DeviceIdList\"\x00\x12\x34\n\x0bListDevices\x12\x0e.context.Empty\x1a\x13.context.DeviceList\"\x00\x12\x31\n\tGetDevice\x12\x11.context.DeviceId\x1a\x0f.context.Device\"\x00\x12\x31\n\tSetDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0cRemoveDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x12;\n\x0fGetDeviceEvents\x12\x0e.context.Empty\x1a\x14.context.DeviceEvent\"\x00\x30\x01\x12\x34\n\x0bListLinkIds\x12\x0e.context.Empty\x1a\x13.context.LinkIdList\"\x00\x12\x30\n\tListLinks\x12\x0e.context.Empty\x1a\x11.context.LinkList\"\x00\x12+\n\x07GetLink\x12\x0f.context.LinkId\x1a\r.context.Link\"\x00\x12+\n\x07SetLink\x12\r.context.Link\x1a\x0f.context.LinkId\"\x00\x12/\n\nRemoveLink\x12\x0f.context.LinkId\x1a\x0e.context.Empty\"\x00\x12\x37\n\rGetLinkEvents\x12\x0e.context.Empty\x1a\x12.context.LinkEvent\"\x00\x30\x01\x12>\n\x0eListServiceIds\x12\x12.context.ContextId\x1a\x16.context.ServiceIdList\"\x00\x12:\n\x0cListServices\x12\x12.context.ContextId\x1a\x14.context.ServiceList\"\x00\x12\x34\n\nGetService\x12\x12.context.ServiceId\x1a\x10.context.Service\"\x00\x12\x34\n\nSetService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rRemoveService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetServiceEvents\x12\x0e.context.Empty\x1a\x15.context.ServiceEvent\"\x00\x30\x01\x12:\n\x0cListSliceIds\x12\x12.context.ContextId\x1a\x14.context.SliceIdList\"\x00\x12\x36\n\nListSlices\x12\x12.context.ContextId\x1a\x12.context.SliceList\"\x00\x12.\n\x08GetSlice\x12\x10.context.SliceId\x1a\x0e.context.Slice\"\x00\x12.\n\x08SetSlice\x12\x0e.context.Slice\x1a\x10.context.SliceId\"\x00\x12\x31\n\x0bRemoveSlice\x12\x10.context.SliceId\x1a\x0e.context.Empty\"\x00\x12\x39\n\x0eGetSliceEvents\x12\x0e.context.Empty\x1a\x13.context.SliceEvent\"\x00\x30\x01\x12\x44\n\x11ListConnectionIds\x12\x12.context.ServiceId\x1a\x19.context.ConnectionIdList\"\x00\x12@\n\x0fListConnections\x12\x12.context.ServiceId\x1a\x17.context.ConnectionList\"\x00\x12=\n\rGetConnection\x12\x15.context.ConnectionId\x1a\x13.context.Connection\"\x00\x12=\n\rSetConnection\x12\x13.context.Connection\x1a\x15.context.ConnectionId\"\x00\x12;\n\x10RemoveConnection\x12\x15.context.ConnectionId\x1a\x0e.context.Empty\"\x00\x12\x43\n\x13GetConnectionEvents\x12\x0e.context.Empty\x1a\x18.context.ConnectionEvent\"\x00\x30\x01\x62\x06proto3' + , + dependencies=[kpi__sample__types__pb2.DESCRIPTOR,]) + +_EVENTTYPEENUM = _descriptor.EnumDescriptor( + name='EventTypeEnum', + full_name='context.EventTypeEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='EVENTTYPE_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='EVENTTYPE_CREATE', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='EVENTTYPE_UPDATE', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='EVENTTYPE_REMOVE', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=4310, + serialized_end=4416, +) +_sym_db.RegisterEnumDescriptor(_EVENTTYPEENUM) + +EventTypeEnum = enum_type_wrapper.EnumTypeWrapper(_EVENTTYPEENUM) +_DEVICEDRIVERENUM = _descriptor.EnumDescriptor( + name='DeviceDriverEnum', + full_name='context.DeviceDriverEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='DEVICEDRIVER_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DEVICEDRIVER_OPENCONFIG', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DEVICEDRIVER_TRANSPORT_API', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DEVICEDRIVER_P4', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DEVICEDRIVER_IETF_NETWORK_TOPOLOGY', index=4, number=4, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DEVICEDRIVER_ONF_TR_352', index=5, number=5, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=4419, + serialized_end=4616, +) +_sym_db.RegisterEnumDescriptor(_DEVICEDRIVERENUM) + +DeviceDriverEnum = enum_type_wrapper.EnumTypeWrapper(_DEVICEDRIVERENUM) +_DEVICEOPERATIONALSTATUSENUM = _descriptor.EnumDescriptor( + name='DeviceOperationalStatusEnum', + full_name='context.DeviceOperationalStatusEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='DEVICEOPERATIONALSTATUS_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DEVICEOPERATIONALSTATUS_DISABLED', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DEVICEOPERATIONALSTATUS_ENABLED', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=4619, + serialized_end=4762, +) +_sym_db.RegisterEnumDescriptor(_DEVICEOPERATIONALSTATUSENUM) + +DeviceOperationalStatusEnum = enum_type_wrapper.EnumTypeWrapper(_DEVICEOPERATIONALSTATUSENUM) +_SERVICETYPEENUM = _descriptor.EnumDescriptor( + name='ServiceTypeEnum', + full_name='context.ServiceTypeEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='SERVICETYPE_UNKNOWN', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SERVICETYPE_L3NM', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SERVICETYPE_L2NM', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SERVICETYPE_TAPI_CONNECTIVITY_SERVICE', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=4765, + serialized_end=4894, +) +_sym_db.RegisterEnumDescriptor(_SERVICETYPEENUM) + +ServiceTypeEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICETYPEENUM) +_SERVICESTATUSENUM = _descriptor.EnumDescriptor( + name='ServiceStatusEnum', + full_name='context.ServiceStatusEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='SERVICESTATUS_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SERVICESTATUS_PLANNED', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SERVICESTATUS_ACTIVE', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SERVICESTATUS_PENDING_REMOVAL', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=4897, + serialized_end=5033, +) +_sym_db.RegisterEnumDescriptor(_SERVICESTATUSENUM) + +ServiceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICESTATUSENUM) +_SLICESTATUSENUM = _descriptor.EnumDescriptor( + name='SliceStatusEnum', + full_name='context.SliceStatusEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_PLANNED', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_INIT', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_ACTIVE', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_DEINIT', index=4, number=4, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=5036, + serialized_end=5175, +) +_sym_db.RegisterEnumDescriptor(_SLICESTATUSENUM) + +SliceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SLICESTATUSENUM) +_CONFIGACTIONENUM = _descriptor.EnumDescriptor( + name='ConfigActionEnum', + full_name='context.ConfigActionEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='CONFIGACTION_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CONFIGACTION_SET', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CONFIGACTION_DELETE', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=5177, + serialized_end=5270, +) +_sym_db.RegisterEnumDescriptor(_CONFIGACTIONENUM) + +ConfigActionEnum = enum_type_wrapper.EnumTypeWrapper(_CONFIGACTIONENUM) +EVENTTYPE_UNDEFINED = 0 +EVENTTYPE_CREATE = 1 +EVENTTYPE_UPDATE = 2 +EVENTTYPE_REMOVE = 3 +DEVICEDRIVER_UNDEFINED = 0 +DEVICEDRIVER_OPENCONFIG = 1 +DEVICEDRIVER_TRANSPORT_API = 2 +DEVICEDRIVER_P4 = 3 +DEVICEDRIVER_IETF_NETWORK_TOPOLOGY = 4 +DEVICEDRIVER_ONF_TR_352 = 5 +DEVICEOPERATIONALSTATUS_UNDEFINED = 0 +DEVICEOPERATIONALSTATUS_DISABLED = 1 +DEVICEOPERATIONALSTATUS_ENABLED = 2 +SERVICETYPE_UNKNOWN = 0 +SERVICETYPE_L3NM = 1 +SERVICETYPE_L2NM = 2 +SERVICETYPE_TAPI_CONNECTIVITY_SERVICE = 3 +SERVICESTATUS_UNDEFINED = 0 +SERVICESTATUS_PLANNED = 1 +SERVICESTATUS_ACTIVE = 2 +SERVICESTATUS_PENDING_REMOVAL = 3 +SLICESTATUS_UNDEFINED = 0 +SLICESTATUS_PLANNED = 1 +SLICESTATUS_INIT = 2 +SLICESTATUS_ACTIVE = 3 +SLICESTATUS_DEINIT = 4 +CONFIGACTION_UNDEFINED = 0 +CONFIGACTION_SET = 1 +CONFIGACTION_DELETE = 2 + + + +_EMPTY = _descriptor.Descriptor( + name='Empty', + full_name='context.Empty', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=50, + serialized_end=57, +) + + +_UUID = _descriptor.Descriptor( + name='Uuid', + full_name='context.Uuid', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='uuid', full_name='context.Uuid.uuid', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=59, + serialized_end=79, +) + + +_EVENT = _descriptor.Descriptor( + name='Event', + full_name='context.Event', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='timestamp', full_name='context.Event.timestamp', index=0, + number=1, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='event_type', full_name='context.Event.event_type', index=1, + number=2, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=81, + serialized_end=151, +) + + +_CONTEXTID = _descriptor.Descriptor( + name='ContextId', + full_name='context.ContextId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_uuid', full_name='context.ContextId.context_uuid', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=153, + serialized_end=201, +) + + +_CONTEXT = _descriptor.Descriptor( + name='Context', + full_name='context.Context', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_id', full_name='context.Context.context_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='topology_ids', full_name='context.Context.topology_ids', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_ids', full_name='context.Context.service_ids', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='controller', full_name='context.Context.controller', index=3, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=204, + serialized_end=386, +) + + +_CONTEXTIDLIST = _descriptor.Descriptor( + name='ContextIdList', + full_name='context.ContextIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_ids', full_name='context.ContextIdList.context_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=388, + serialized_end=444, +) + + +_CONTEXTLIST = _descriptor.Descriptor( + name='ContextList', + full_name='context.ContextList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='contexts', full_name='context.ContextList.contexts', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=446, + serialized_end=495, +) + + +_CONTEXTEVENT = _descriptor.Descriptor( + name='ContextEvent', + full_name='context.ContextEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.ContextEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='context_id', full_name='context.ContextEvent.context_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=497, + serialized_end=582, +) + + +_TOPOLOGYID = _descriptor.Descriptor( + name='TopologyId', + full_name='context.TopologyId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_id', full_name='context.TopologyId.context_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='topology_uuid', full_name='context.TopologyId.topology_uuid', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=584, + serialized_end=674, +) + + +_TOPOLOGY = _descriptor.Descriptor( + name='Topology', + full_name='context.Topology', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='topology_id', full_name='context.Topology.topology_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='device_ids', full_name='context.Topology.device_ids', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='link_ids', full_name='context.Topology.link_ids', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=676, + serialized_end=802, +) + + +_TOPOLOGYIDLIST = _descriptor.Descriptor( + name='TopologyIdList', + full_name='context.TopologyIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='topology_ids', full_name='context.TopologyIdList.topology_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=804, + serialized_end=863, +) + + +_TOPOLOGYLIST = _descriptor.Descriptor( + name='TopologyList', + full_name='context.TopologyList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='topologies', full_name='context.TopologyList.topologies', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=865, + serialized_end=918, +) + + +_TOPOLOGYEVENT = _descriptor.Descriptor( + name='TopologyEvent', + full_name='context.TopologyEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.TopologyEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='topology_id', full_name='context.TopologyEvent.topology_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=920, + serialized_end=1008, +) + + +_DEVICEID = _descriptor.Descriptor( + name='DeviceId', + full_name='context.DeviceId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='device_uuid', full_name='context.DeviceId.device_uuid', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1010, + serialized_end=1056, +) + + +_DEVICE = _descriptor.Descriptor( + name='Device', + full_name='context.Device', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='device_id', full_name='context.Device.device_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='device_type', full_name='context.Device.device_type', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='device_config', full_name='context.Device.device_config', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='device_operational_status', full_name='context.Device.device_operational_status', index=3, + number=4, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='device_drivers', full_name='context.Device.device_drivers', index=4, + number=5, type=14, cpp_type=8, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='device_endpoints', full_name='context.Device.device_endpoints', index=5, + number=6, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1059, + serialized_end=1341, +) + + +_DEVICECONFIG = _descriptor.Descriptor( + name='DeviceConfig', + full_name='context.DeviceConfig', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='config_rules', full_name='context.DeviceConfig.config_rules', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1343, + serialized_end=1400, +) + + +_DEVICEIDLIST = _descriptor.Descriptor( + name='DeviceIdList', + full_name='context.DeviceIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='device_ids', full_name='context.DeviceIdList.device_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1402, + serialized_end=1455, +) + + +_DEVICELIST = _descriptor.Descriptor( + name='DeviceList', + full_name='context.DeviceList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='devices', full_name='context.DeviceList.devices', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1457, + serialized_end=1503, +) + + +_DEVICEEVENT = _descriptor.Descriptor( + name='DeviceEvent', + full_name='context.DeviceEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.DeviceEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='device_id', full_name='context.DeviceEvent.device_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1505, + serialized_end=1587, +) + + +_LINKID = _descriptor.Descriptor( + name='LinkId', + full_name='context.LinkId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='link_uuid', full_name='context.LinkId.link_uuid', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1589, + serialized_end=1631, +) + + +_LINK = _descriptor.Descriptor( + name='Link', + full_name='context.Link', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='link_id', full_name='context.Link.link_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='link_endpoint_ids', full_name='context.Link.link_endpoint_ids', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1633, + serialized_end=1721, +) + + +_LINKIDLIST = _descriptor.Descriptor( + name='LinkIdList', + full_name='context.LinkIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='link_ids', full_name='context.LinkIdList.link_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1723, + serialized_end=1770, +) + + +_LINKLIST = _descriptor.Descriptor( + name='LinkList', + full_name='context.LinkList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='links', full_name='context.LinkList.links', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1772, + serialized_end=1812, +) + + +_LINKEVENT = _descriptor.Descriptor( + name='LinkEvent', + full_name='context.LinkEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.LinkEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='link_id', full_name='context.LinkEvent.link_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1814, + serialized_end=1890, +) + + +_SERVICEID = _descriptor.Descriptor( + name='ServiceId', + full_name='context.ServiceId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_id', full_name='context.ServiceId.context_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_uuid', full_name='context.ServiceId.service_uuid', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1892, + serialized_end=1980, +) + + +_SERVICE = _descriptor.Descriptor( + name='Service', + full_name='context.Service', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='service_id', full_name='context.Service.service_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_type', full_name='context.Service.service_type', index=1, + number=2, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_endpoint_ids', full_name='context.Service.service_endpoint_ids', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_constraints', full_name='context.Service.service_constraints', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_status', full_name='context.Service.service_status', index=4, + number=5, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_config', full_name='context.Service.service_config', index=5, + number=6, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1983, + serialized_end=2277, +) + + +_SERVICESTATUS = _descriptor.Descriptor( + name='ServiceStatus', + full_name='context.ServiceStatus', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='service_status', full_name='context.ServiceStatus.service_status', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2279, + serialized_end=2346, +) + + +_SERVICECONFIG = _descriptor.Descriptor( + name='ServiceConfig', + full_name='context.ServiceConfig', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='config_rules', full_name='context.ServiceConfig.config_rules', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2348, + serialized_end=2406, +) + + +_SERVICEIDLIST = _descriptor.Descriptor( + name='ServiceIdList', + full_name='context.ServiceIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='service_ids', full_name='context.ServiceIdList.service_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2408, + serialized_end=2464, +) + + +_SERVICELIST = _descriptor.Descriptor( + name='ServiceList', + full_name='context.ServiceList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='services', full_name='context.ServiceList.services', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2466, + serialized_end=2515, +) + + +_SERVICEEVENT = _descriptor.Descriptor( + name='ServiceEvent', + full_name='context.ServiceEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.ServiceEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_id', full_name='context.ServiceEvent.service_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2517, + serialized_end=2602, +) + + +_SLICEID = _descriptor.Descriptor( + name='SliceId', + full_name='context.SliceId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_id', full_name='context.SliceId.context_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_uuid', full_name='context.SliceId.slice_uuid', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2604, + serialized_end=2688, +) + + +_SLICE = _descriptor.Descriptor( + name='Slice', + full_name='context.Slice', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_id', full_name='context.Slice.slice_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_endpoint_ids', full_name='context.Slice.slice_endpoint_ids', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_constraints', full_name='context.Slice.slice_constraints', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_service_ids', full_name='context.Slice.slice_service_ids', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_subslice_ids', full_name='context.Slice.slice_subslice_ids', index=4, + number=5, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_status', full_name='context.Slice.slice_status', index=5, + number=6, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2691, + serialized_end=2968, +) + + +_SLICESTATUS = _descriptor.Descriptor( + name='SliceStatus', + full_name='context.SliceStatus', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_status', full_name='context.SliceStatus.slice_status', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2970, + serialized_end=3031, +) + + +_SLICEIDLIST = _descriptor.Descriptor( + name='SliceIdList', + full_name='context.SliceIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_ids', full_name='context.SliceIdList.slice_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3033, + serialized_end=3083, +) + + +_SLICELIST = _descriptor.Descriptor( + name='SliceList', + full_name='context.SliceList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slices', full_name='context.SliceList.slices', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3085, + serialized_end=3128, +) + + +_SLICEEVENT = _descriptor.Descriptor( + name='SliceEvent', + full_name='context.SliceEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.SliceEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_id', full_name='context.SliceEvent.slice_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3130, + serialized_end=3209, +) + + +_CONNECTIONID = _descriptor.Descriptor( + name='ConnectionId', + full_name='context.ConnectionId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='connection_uuid', full_name='context.ConnectionId.connection_uuid', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3211, + serialized_end=3265, +) + + +_CONNECTION = _descriptor.Descriptor( + name='Connection', + full_name='context.Connection', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='connection_id', full_name='context.Connection.connection_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_id', full_name='context.Connection.service_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='path_hops_endpoint_ids', full_name='context.Connection.path_hops_endpoint_ids', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='sub_service_ids', full_name='context.Connection.sub_service_ids', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3268, + serialized_end=3464, +) + + +_CONNECTIONIDLIST = _descriptor.Descriptor( + name='ConnectionIdList', + full_name='context.ConnectionIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='connection_ids', full_name='context.ConnectionIdList.connection_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3466, + serialized_end=3531, +) + + +_CONNECTIONLIST = _descriptor.Descriptor( + name='ConnectionList', + full_name='context.ConnectionList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='connections', full_name='context.ConnectionList.connections', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3533, + serialized_end=3591, +) + + +_CONNECTIONEVENT = _descriptor.Descriptor( + name='ConnectionEvent', + full_name='context.ConnectionEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.ConnectionEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='connection_id', full_name='context.ConnectionEvent.connection_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3593, + serialized_end=3687, +) + + +_ENDPOINTID = _descriptor.Descriptor( + name='EndPointId', + full_name='context.EndPointId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='topology_id', full_name='context.EndPointId.topology_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='device_id', full_name='context.EndPointId.device_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='endpoint_uuid', full_name='context.EndPointId.endpoint_uuid', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3690, + serialized_end=3820, +) + + +_ENDPOINT = _descriptor.Descriptor( + name='EndPoint', + full_name='context.EndPoint', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='endpoint_id', full_name='context.EndPoint.endpoint_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='endpoint_type', full_name='context.EndPoint.endpoint_type', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='kpi_sample_types', full_name='context.EndPoint.kpi_sample_types', index=2, + number=3, type=14, cpp_type=8, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3823, + serialized_end=3957, +) + + +_CONFIGRULE = _descriptor.Descriptor( + name='ConfigRule', + full_name='context.ConfigRule', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='action', full_name='context.ConfigRule.action', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='resource_key', full_name='context.ConfigRule.resource_key', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='resource_value', full_name='context.ConfigRule.resource_value', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3959, + serialized_end=4060, +) + + +_CONSTRAINT = _descriptor.Descriptor( + name='Constraint', + full_name='context.Constraint', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='constraint_type', full_name='context.Constraint.constraint_type', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='constraint_value', full_name='context.Constraint.constraint_value', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=4062, + serialized_end=4125, +) + + +_TERAFLOWCONTROLLER = _descriptor.Descriptor( + name='TeraFlowController', + full_name='context.TeraFlowController', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_id', full_name='context.TeraFlowController.context_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='ip_address', full_name='context.TeraFlowController.ip_address', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='port', full_name='context.TeraFlowController.port', index=2, + number=3, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=4127, + serialized_end=4221, +) + + +_AUTHENTICATIONRESULT = _descriptor.Descriptor( + name='AuthenticationResult', + full_name='context.AuthenticationResult', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_id', full_name='context.AuthenticationResult.context_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='authenticated', full_name='context.AuthenticationResult.authenticated', index=1, + number=2, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=4223, + serialized_end=4308, +) + +_EVENT.fields_by_name['event_type'].enum_type = _EVENTTYPEENUM +_CONTEXTID.fields_by_name['context_uuid'].message_type = _UUID +_CONTEXT.fields_by_name['context_id'].message_type = _CONTEXTID +_CONTEXT.fields_by_name['topology_ids'].message_type = _TOPOLOGYID +_CONTEXT.fields_by_name['service_ids'].message_type = _SERVICEID +_CONTEXT.fields_by_name['controller'].message_type = _TERAFLOWCONTROLLER +_CONTEXTIDLIST.fields_by_name['context_ids'].message_type = _CONTEXTID +_CONTEXTLIST.fields_by_name['contexts'].message_type = _CONTEXT +_CONTEXTEVENT.fields_by_name['event'].message_type = _EVENT +_CONTEXTEVENT.fields_by_name['context_id'].message_type = _CONTEXTID +_TOPOLOGYID.fields_by_name['context_id'].message_type = _CONTEXTID +_TOPOLOGYID.fields_by_name['topology_uuid'].message_type = _UUID +_TOPOLOGY.fields_by_name['topology_id'].message_type = _TOPOLOGYID +_TOPOLOGY.fields_by_name['device_ids'].message_type = _DEVICEID +_TOPOLOGY.fields_by_name['link_ids'].message_type = _LINKID +_TOPOLOGYIDLIST.fields_by_name['topology_ids'].message_type = _TOPOLOGYID +_TOPOLOGYLIST.fields_by_name['topologies'].message_type = _TOPOLOGY +_TOPOLOGYEVENT.fields_by_name['event'].message_type = _EVENT +_TOPOLOGYEVENT.fields_by_name['topology_id'].message_type = _TOPOLOGYID +_DEVICEID.fields_by_name['device_uuid'].message_type = _UUID +_DEVICE.fields_by_name['device_id'].message_type = _DEVICEID +_DEVICE.fields_by_name['device_config'].message_type = _DEVICECONFIG +_DEVICE.fields_by_name['device_operational_status'].enum_type = _DEVICEOPERATIONALSTATUSENUM +_DEVICE.fields_by_name['device_drivers'].enum_type = _DEVICEDRIVERENUM +_DEVICE.fields_by_name['device_endpoints'].message_type = _ENDPOINT +_DEVICECONFIG.fields_by_name['config_rules'].message_type = _CONFIGRULE +_DEVICEIDLIST.fields_by_name['device_ids'].message_type = _DEVICEID +_DEVICELIST.fields_by_name['devices'].message_type = _DEVICE +_DEVICEEVENT.fields_by_name['event'].message_type = _EVENT +_DEVICEEVENT.fields_by_name['device_id'].message_type = _DEVICEID +_LINKID.fields_by_name['link_uuid'].message_type = _UUID +_LINK.fields_by_name['link_id'].message_type = _LINKID +_LINK.fields_by_name['link_endpoint_ids'].message_type = _ENDPOINTID +_LINKIDLIST.fields_by_name['link_ids'].message_type = _LINKID +_LINKLIST.fields_by_name['links'].message_type = _LINK +_LINKEVENT.fields_by_name['event'].message_type = _EVENT +_LINKEVENT.fields_by_name['link_id'].message_type = _LINKID +_SERVICEID.fields_by_name['context_id'].message_type = _CONTEXTID +_SERVICEID.fields_by_name['service_uuid'].message_type = _UUID +_SERVICE.fields_by_name['service_id'].message_type = _SERVICEID +_SERVICE.fields_by_name['service_type'].enum_type = _SERVICETYPEENUM +_SERVICE.fields_by_name['service_endpoint_ids'].message_type = _ENDPOINTID +_SERVICE.fields_by_name['service_constraints'].message_type = _CONSTRAINT +_SERVICE.fields_by_name['service_status'].message_type = _SERVICESTATUS +_SERVICE.fields_by_name['service_config'].message_type = _SERVICECONFIG +_SERVICESTATUS.fields_by_name['service_status'].enum_type = _SERVICESTATUSENUM +_SERVICECONFIG.fields_by_name['config_rules'].message_type = _CONFIGRULE +_SERVICEIDLIST.fields_by_name['service_ids'].message_type = _SERVICEID +_SERVICELIST.fields_by_name['services'].message_type = _SERVICE +_SERVICEEVENT.fields_by_name['event'].message_type = _EVENT +_SERVICEEVENT.fields_by_name['service_id'].message_type = _SERVICEID +_SLICEID.fields_by_name['context_id'].message_type = _CONTEXTID +_SLICEID.fields_by_name['slice_uuid'].message_type = _UUID +_SLICE.fields_by_name['slice_id'].message_type = _SLICEID +_SLICE.fields_by_name['slice_endpoint_ids'].message_type = _ENDPOINTID +_SLICE.fields_by_name['slice_constraints'].message_type = _CONSTRAINT +_SLICE.fields_by_name['slice_service_ids'].message_type = _SERVICEID +_SLICE.fields_by_name['slice_subslice_ids'].message_type = _SLICEID +_SLICE.fields_by_name['slice_status'].message_type = _SLICESTATUS +_SLICESTATUS.fields_by_name['slice_status'].enum_type = _SLICESTATUSENUM +_SLICEIDLIST.fields_by_name['slice_ids'].message_type = _SLICEID +_SLICELIST.fields_by_name['slices'].message_type = _SLICE +_SLICEEVENT.fields_by_name['event'].message_type = _EVENT +_SLICEEVENT.fields_by_name['slice_id'].message_type = _SLICEID +_CONNECTIONID.fields_by_name['connection_uuid'].message_type = _UUID +_CONNECTION.fields_by_name['connection_id'].message_type = _CONNECTIONID +_CONNECTION.fields_by_name['service_id'].message_type = _SERVICEID +_CONNECTION.fields_by_name['path_hops_endpoint_ids'].message_type = _ENDPOINTID +_CONNECTION.fields_by_name['sub_service_ids'].message_type = _SERVICEID +_CONNECTIONIDLIST.fields_by_name['connection_ids'].message_type = _CONNECTIONID +_CONNECTIONLIST.fields_by_name['connections'].message_type = _CONNECTION +_CONNECTIONEVENT.fields_by_name['event'].message_type = _EVENT +_CONNECTIONEVENT.fields_by_name['connection_id'].message_type = _CONNECTIONID +_ENDPOINTID.fields_by_name['topology_id'].message_type = _TOPOLOGYID +_ENDPOINTID.fields_by_name['device_id'].message_type = _DEVICEID +_ENDPOINTID.fields_by_name['endpoint_uuid'].message_type = _UUID +_ENDPOINT.fields_by_name['endpoint_id'].message_type = _ENDPOINTID +_ENDPOINT.fields_by_name['kpi_sample_types'].enum_type = kpi__sample__types__pb2._KPISAMPLETYPE +_CONFIGRULE.fields_by_name['action'].enum_type = _CONFIGACTIONENUM +_TERAFLOWCONTROLLER.fields_by_name['context_id'].message_type = _CONTEXTID +_AUTHENTICATIONRESULT.fields_by_name['context_id'].message_type = _CONTEXTID +DESCRIPTOR.message_types_by_name['Empty'] = _EMPTY +DESCRIPTOR.message_types_by_name['Uuid'] = _UUID +DESCRIPTOR.message_types_by_name['Event'] = _EVENT +DESCRIPTOR.message_types_by_name['ContextId'] = _CONTEXTID +DESCRIPTOR.message_types_by_name['Context'] = _CONTEXT +DESCRIPTOR.message_types_by_name['ContextIdList'] = _CONTEXTIDLIST +DESCRIPTOR.message_types_by_name['ContextList'] = _CONTEXTLIST +DESCRIPTOR.message_types_by_name['ContextEvent'] = _CONTEXTEVENT +DESCRIPTOR.message_types_by_name['TopologyId'] = _TOPOLOGYID +DESCRIPTOR.message_types_by_name['Topology'] = _TOPOLOGY +DESCRIPTOR.message_types_by_name['TopologyIdList'] = _TOPOLOGYIDLIST +DESCRIPTOR.message_types_by_name['TopologyList'] = _TOPOLOGYLIST +DESCRIPTOR.message_types_by_name['TopologyEvent'] = _TOPOLOGYEVENT +DESCRIPTOR.message_types_by_name['DeviceId'] = _DEVICEID +DESCRIPTOR.message_types_by_name['Device'] = _DEVICE +DESCRIPTOR.message_types_by_name['DeviceConfig'] = _DEVICECONFIG +DESCRIPTOR.message_types_by_name['DeviceIdList'] = _DEVICEIDLIST +DESCRIPTOR.message_types_by_name['DeviceList'] = _DEVICELIST +DESCRIPTOR.message_types_by_name['DeviceEvent'] = _DEVICEEVENT +DESCRIPTOR.message_types_by_name['LinkId'] = _LINKID +DESCRIPTOR.message_types_by_name['Link'] = _LINK +DESCRIPTOR.message_types_by_name['LinkIdList'] = _LINKIDLIST +DESCRIPTOR.message_types_by_name['LinkList'] = _LINKLIST +DESCRIPTOR.message_types_by_name['LinkEvent'] = _LINKEVENT +DESCRIPTOR.message_types_by_name['ServiceId'] = _SERVICEID +DESCRIPTOR.message_types_by_name['Service'] = _SERVICE +DESCRIPTOR.message_types_by_name['ServiceStatus'] = _SERVICESTATUS +DESCRIPTOR.message_types_by_name['ServiceConfig'] = _SERVICECONFIG +DESCRIPTOR.message_types_by_name['ServiceIdList'] = _SERVICEIDLIST +DESCRIPTOR.message_types_by_name['ServiceList'] = _SERVICELIST +DESCRIPTOR.message_types_by_name['ServiceEvent'] = _SERVICEEVENT +DESCRIPTOR.message_types_by_name['SliceId'] = _SLICEID +DESCRIPTOR.message_types_by_name['Slice'] = _SLICE +DESCRIPTOR.message_types_by_name['SliceStatus'] = _SLICESTATUS +DESCRIPTOR.message_types_by_name['SliceIdList'] = _SLICEIDLIST +DESCRIPTOR.message_types_by_name['SliceList'] = _SLICELIST +DESCRIPTOR.message_types_by_name['SliceEvent'] = _SLICEEVENT +DESCRIPTOR.message_types_by_name['ConnectionId'] = _CONNECTIONID +DESCRIPTOR.message_types_by_name['Connection'] = _CONNECTION +DESCRIPTOR.message_types_by_name['ConnectionIdList'] = _CONNECTIONIDLIST +DESCRIPTOR.message_types_by_name['ConnectionList'] = _CONNECTIONLIST +DESCRIPTOR.message_types_by_name['ConnectionEvent'] = _CONNECTIONEVENT +DESCRIPTOR.message_types_by_name['EndPointId'] = _ENDPOINTID +DESCRIPTOR.message_types_by_name['EndPoint'] = _ENDPOINT +DESCRIPTOR.message_types_by_name['ConfigRule'] = _CONFIGRULE +DESCRIPTOR.message_types_by_name['Constraint'] = _CONSTRAINT +DESCRIPTOR.message_types_by_name['TeraFlowController'] = _TERAFLOWCONTROLLER +DESCRIPTOR.message_types_by_name['AuthenticationResult'] = _AUTHENTICATIONRESULT +DESCRIPTOR.enum_types_by_name['EventTypeEnum'] = _EVENTTYPEENUM +DESCRIPTOR.enum_types_by_name['DeviceDriverEnum'] = _DEVICEDRIVERENUM +DESCRIPTOR.enum_types_by_name['DeviceOperationalStatusEnum'] = _DEVICEOPERATIONALSTATUSENUM +DESCRIPTOR.enum_types_by_name['ServiceTypeEnum'] = _SERVICETYPEENUM +DESCRIPTOR.enum_types_by_name['ServiceStatusEnum'] = _SERVICESTATUSENUM +DESCRIPTOR.enum_types_by_name['SliceStatusEnum'] = _SLICESTATUSENUM +DESCRIPTOR.enum_types_by_name['ConfigActionEnum'] = _CONFIGACTIONENUM +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +Empty = _reflection.GeneratedProtocolMessageType('Empty', (_message.Message,), { + 'DESCRIPTOR' : _EMPTY, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Empty) + }) +_sym_db.RegisterMessage(Empty) + +Uuid = _reflection.GeneratedProtocolMessageType('Uuid', (_message.Message,), { + 'DESCRIPTOR' : _UUID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Uuid) + }) +_sym_db.RegisterMessage(Uuid) + +Event = _reflection.GeneratedProtocolMessageType('Event', (_message.Message,), { + 'DESCRIPTOR' : _EVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Event) + }) +_sym_db.RegisterMessage(Event) + +ContextId = _reflection.GeneratedProtocolMessageType('ContextId', (_message.Message,), { + 'DESCRIPTOR' : _CONTEXTID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ContextId) + }) +_sym_db.RegisterMessage(ContextId) + +Context = _reflection.GeneratedProtocolMessageType('Context', (_message.Message,), { + 'DESCRIPTOR' : _CONTEXT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Context) + }) +_sym_db.RegisterMessage(Context) + +ContextIdList = _reflection.GeneratedProtocolMessageType('ContextIdList', (_message.Message,), { + 'DESCRIPTOR' : _CONTEXTIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ContextIdList) + }) +_sym_db.RegisterMessage(ContextIdList) + +ContextList = _reflection.GeneratedProtocolMessageType('ContextList', (_message.Message,), { + 'DESCRIPTOR' : _CONTEXTLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ContextList) + }) +_sym_db.RegisterMessage(ContextList) + +ContextEvent = _reflection.GeneratedProtocolMessageType('ContextEvent', (_message.Message,), { + 'DESCRIPTOR' : _CONTEXTEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ContextEvent) + }) +_sym_db.RegisterMessage(ContextEvent) + +TopologyId = _reflection.GeneratedProtocolMessageType('TopologyId', (_message.Message,), { + 'DESCRIPTOR' : _TOPOLOGYID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.TopologyId) + }) +_sym_db.RegisterMessage(TopologyId) + +Topology = _reflection.GeneratedProtocolMessageType('Topology', (_message.Message,), { + 'DESCRIPTOR' : _TOPOLOGY, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Topology) + }) +_sym_db.RegisterMessage(Topology) + +TopologyIdList = _reflection.GeneratedProtocolMessageType('TopologyIdList', (_message.Message,), { + 'DESCRIPTOR' : _TOPOLOGYIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.TopologyIdList) + }) +_sym_db.RegisterMessage(TopologyIdList) + +TopologyList = _reflection.GeneratedProtocolMessageType('TopologyList', (_message.Message,), { + 'DESCRIPTOR' : _TOPOLOGYLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.TopologyList) + }) +_sym_db.RegisterMessage(TopologyList) + +TopologyEvent = _reflection.GeneratedProtocolMessageType('TopologyEvent', (_message.Message,), { + 'DESCRIPTOR' : _TOPOLOGYEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.TopologyEvent) + }) +_sym_db.RegisterMessage(TopologyEvent) + +DeviceId = _reflection.GeneratedProtocolMessageType('DeviceId', (_message.Message,), { + 'DESCRIPTOR' : _DEVICEID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.DeviceId) + }) +_sym_db.RegisterMessage(DeviceId) + +Device = _reflection.GeneratedProtocolMessageType('Device', (_message.Message,), { + 'DESCRIPTOR' : _DEVICE, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Device) + }) +_sym_db.RegisterMessage(Device) + +DeviceConfig = _reflection.GeneratedProtocolMessageType('DeviceConfig', (_message.Message,), { + 'DESCRIPTOR' : _DEVICECONFIG, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.DeviceConfig) + }) +_sym_db.RegisterMessage(DeviceConfig) + +DeviceIdList = _reflection.GeneratedProtocolMessageType('DeviceIdList', (_message.Message,), { + 'DESCRIPTOR' : _DEVICEIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.DeviceIdList) + }) +_sym_db.RegisterMessage(DeviceIdList) + +DeviceList = _reflection.GeneratedProtocolMessageType('DeviceList', (_message.Message,), { + 'DESCRIPTOR' : _DEVICELIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.DeviceList) + }) +_sym_db.RegisterMessage(DeviceList) + +DeviceEvent = _reflection.GeneratedProtocolMessageType('DeviceEvent', (_message.Message,), { + 'DESCRIPTOR' : _DEVICEEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.DeviceEvent) + }) +_sym_db.RegisterMessage(DeviceEvent) + +LinkId = _reflection.GeneratedProtocolMessageType('LinkId', (_message.Message,), { + 'DESCRIPTOR' : _LINKID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.LinkId) + }) +_sym_db.RegisterMessage(LinkId) + +Link = _reflection.GeneratedProtocolMessageType('Link', (_message.Message,), { + 'DESCRIPTOR' : _LINK, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Link) + }) +_sym_db.RegisterMessage(Link) + +LinkIdList = _reflection.GeneratedProtocolMessageType('LinkIdList', (_message.Message,), { + 'DESCRIPTOR' : _LINKIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.LinkIdList) + }) +_sym_db.RegisterMessage(LinkIdList) + +LinkList = _reflection.GeneratedProtocolMessageType('LinkList', (_message.Message,), { + 'DESCRIPTOR' : _LINKLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.LinkList) + }) +_sym_db.RegisterMessage(LinkList) + +LinkEvent = _reflection.GeneratedProtocolMessageType('LinkEvent', (_message.Message,), { + 'DESCRIPTOR' : _LINKEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.LinkEvent) + }) +_sym_db.RegisterMessage(LinkEvent) + +ServiceId = _reflection.GeneratedProtocolMessageType('ServiceId', (_message.Message,), { + 'DESCRIPTOR' : _SERVICEID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ServiceId) + }) +_sym_db.RegisterMessage(ServiceId) + +Service = _reflection.GeneratedProtocolMessageType('Service', (_message.Message,), { + 'DESCRIPTOR' : _SERVICE, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Service) + }) +_sym_db.RegisterMessage(Service) + +ServiceStatus = _reflection.GeneratedProtocolMessageType('ServiceStatus', (_message.Message,), { + 'DESCRIPTOR' : _SERVICESTATUS, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ServiceStatus) + }) +_sym_db.RegisterMessage(ServiceStatus) + +ServiceConfig = _reflection.GeneratedProtocolMessageType('ServiceConfig', (_message.Message,), { + 'DESCRIPTOR' : _SERVICECONFIG, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ServiceConfig) + }) +_sym_db.RegisterMessage(ServiceConfig) + +ServiceIdList = _reflection.GeneratedProtocolMessageType('ServiceIdList', (_message.Message,), { + 'DESCRIPTOR' : _SERVICEIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ServiceIdList) + }) +_sym_db.RegisterMessage(ServiceIdList) + +ServiceList = _reflection.GeneratedProtocolMessageType('ServiceList', (_message.Message,), { + 'DESCRIPTOR' : _SERVICELIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ServiceList) + }) +_sym_db.RegisterMessage(ServiceList) + +ServiceEvent = _reflection.GeneratedProtocolMessageType('ServiceEvent', (_message.Message,), { + 'DESCRIPTOR' : _SERVICEEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ServiceEvent) + }) +_sym_db.RegisterMessage(ServiceEvent) + +SliceId = _reflection.GeneratedProtocolMessageType('SliceId', (_message.Message,), { + 'DESCRIPTOR' : _SLICEID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceId) + }) +_sym_db.RegisterMessage(SliceId) + +Slice = _reflection.GeneratedProtocolMessageType('Slice', (_message.Message,), { + 'DESCRIPTOR' : _SLICE, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Slice) + }) +_sym_db.RegisterMessage(Slice) + +SliceStatus = _reflection.GeneratedProtocolMessageType('SliceStatus', (_message.Message,), { + 'DESCRIPTOR' : _SLICESTATUS, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceStatus) + }) +_sym_db.RegisterMessage(SliceStatus) + +SliceIdList = _reflection.GeneratedProtocolMessageType('SliceIdList', (_message.Message,), { + 'DESCRIPTOR' : _SLICEIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceIdList) + }) +_sym_db.RegisterMessage(SliceIdList) + +SliceList = _reflection.GeneratedProtocolMessageType('SliceList', (_message.Message,), { + 'DESCRIPTOR' : _SLICELIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceList) + }) +_sym_db.RegisterMessage(SliceList) + +SliceEvent = _reflection.GeneratedProtocolMessageType('SliceEvent', (_message.Message,), { + 'DESCRIPTOR' : _SLICEEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceEvent) + }) +_sym_db.RegisterMessage(SliceEvent) + +ConnectionId = _reflection.GeneratedProtocolMessageType('ConnectionId', (_message.Message,), { + 'DESCRIPTOR' : _CONNECTIONID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ConnectionId) + }) +_sym_db.RegisterMessage(ConnectionId) + +Connection = _reflection.GeneratedProtocolMessageType('Connection', (_message.Message,), { + 'DESCRIPTOR' : _CONNECTION, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Connection) + }) +_sym_db.RegisterMessage(Connection) + +ConnectionIdList = _reflection.GeneratedProtocolMessageType('ConnectionIdList', (_message.Message,), { + 'DESCRIPTOR' : _CONNECTIONIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ConnectionIdList) + }) +_sym_db.RegisterMessage(ConnectionIdList) + +ConnectionList = _reflection.GeneratedProtocolMessageType('ConnectionList', (_message.Message,), { + 'DESCRIPTOR' : _CONNECTIONLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ConnectionList) + }) +_sym_db.RegisterMessage(ConnectionList) + +ConnectionEvent = _reflection.GeneratedProtocolMessageType('ConnectionEvent', (_message.Message,), { + 'DESCRIPTOR' : _CONNECTIONEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ConnectionEvent) + }) +_sym_db.RegisterMessage(ConnectionEvent) + +EndPointId = _reflection.GeneratedProtocolMessageType('EndPointId', (_message.Message,), { + 'DESCRIPTOR' : _ENDPOINTID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.EndPointId) + }) +_sym_db.RegisterMessage(EndPointId) + +EndPoint = _reflection.GeneratedProtocolMessageType('EndPoint', (_message.Message,), { + 'DESCRIPTOR' : _ENDPOINT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.EndPoint) + }) +_sym_db.RegisterMessage(EndPoint) + +ConfigRule = _reflection.GeneratedProtocolMessageType('ConfigRule', (_message.Message,), { + 'DESCRIPTOR' : _CONFIGRULE, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ConfigRule) + }) +_sym_db.RegisterMessage(ConfigRule) + +Constraint = _reflection.GeneratedProtocolMessageType('Constraint', (_message.Message,), { + 'DESCRIPTOR' : _CONSTRAINT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Constraint) + }) +_sym_db.RegisterMessage(Constraint) + +TeraFlowController = _reflection.GeneratedProtocolMessageType('TeraFlowController', (_message.Message,), { + 'DESCRIPTOR' : _TERAFLOWCONTROLLER, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.TeraFlowController) + }) +_sym_db.RegisterMessage(TeraFlowController) + +AuthenticationResult = _reflection.GeneratedProtocolMessageType('AuthenticationResult', (_message.Message,), { + 'DESCRIPTOR' : _AUTHENTICATIONRESULT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.AuthenticationResult) + }) +_sym_db.RegisterMessage(AuthenticationResult) + + + +_CONTEXTSERVICE = _descriptor.ServiceDescriptor( + name='ContextService', + full_name='context.ContextService', + file=DESCRIPTOR, + index=0, + serialized_options=None, + create_key=_descriptor._internal_create_key, + serialized_start=5273, + serialized_end=7688, + methods=[ + _descriptor.MethodDescriptor( + name='ListContextIds', + full_name='context.ContextService.ListContextIds', + index=0, + containing_service=None, + input_type=_EMPTY, + output_type=_CONTEXTIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListContexts', + full_name='context.ContextService.ListContexts', + index=1, + containing_service=None, + input_type=_EMPTY, + output_type=_CONTEXTLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetContext', + full_name='context.ContextService.GetContext', + index=2, + containing_service=None, + input_type=_CONTEXTID, + output_type=_CONTEXT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetContext', + full_name='context.ContextService.SetContext', + index=3, + containing_service=None, + input_type=_CONTEXT, + output_type=_CONTEXTID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveContext', + full_name='context.ContextService.RemoveContext', + index=4, + containing_service=None, + input_type=_CONTEXTID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetContextEvents', + full_name='context.ContextService.GetContextEvents', + index=5, + containing_service=None, + input_type=_EMPTY, + output_type=_CONTEXTEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListTopologyIds', + full_name='context.ContextService.ListTopologyIds', + index=6, + containing_service=None, + input_type=_CONTEXTID, + output_type=_TOPOLOGYIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListTopologies', + full_name='context.ContextService.ListTopologies', + index=7, + containing_service=None, + input_type=_CONTEXTID, + output_type=_TOPOLOGYLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetTopology', + full_name='context.ContextService.GetTopology', + index=8, + containing_service=None, + input_type=_TOPOLOGYID, + output_type=_TOPOLOGY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetTopology', + full_name='context.ContextService.SetTopology', + index=9, + containing_service=None, + input_type=_TOPOLOGY, + output_type=_TOPOLOGYID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveTopology', + full_name='context.ContextService.RemoveTopology', + index=10, + containing_service=None, + input_type=_TOPOLOGYID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetTopologyEvents', + full_name='context.ContextService.GetTopologyEvents', + index=11, + containing_service=None, + input_type=_EMPTY, + output_type=_TOPOLOGYEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListDeviceIds', + full_name='context.ContextService.ListDeviceIds', + index=12, + containing_service=None, + input_type=_EMPTY, + output_type=_DEVICEIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListDevices', + full_name='context.ContextService.ListDevices', + index=13, + containing_service=None, + input_type=_EMPTY, + output_type=_DEVICELIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetDevice', + full_name='context.ContextService.GetDevice', + index=14, + containing_service=None, + input_type=_DEVICEID, + output_type=_DEVICE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetDevice', + full_name='context.ContextService.SetDevice', + index=15, + containing_service=None, + input_type=_DEVICE, + output_type=_DEVICEID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveDevice', + full_name='context.ContextService.RemoveDevice', + index=16, + containing_service=None, + input_type=_DEVICEID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetDeviceEvents', + full_name='context.ContextService.GetDeviceEvents', + index=17, + containing_service=None, + input_type=_EMPTY, + output_type=_DEVICEEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListLinkIds', + full_name='context.ContextService.ListLinkIds', + index=18, + containing_service=None, + input_type=_EMPTY, + output_type=_LINKIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListLinks', + full_name='context.ContextService.ListLinks', + index=19, + containing_service=None, + input_type=_EMPTY, + output_type=_LINKLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetLink', + full_name='context.ContextService.GetLink', + index=20, + containing_service=None, + input_type=_LINKID, + output_type=_LINK, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetLink', + full_name='context.ContextService.SetLink', + index=21, + containing_service=None, + input_type=_LINK, + output_type=_LINKID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveLink', + full_name='context.ContextService.RemoveLink', + index=22, + containing_service=None, + input_type=_LINKID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetLinkEvents', + full_name='context.ContextService.GetLinkEvents', + index=23, + containing_service=None, + input_type=_EMPTY, + output_type=_LINKEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListServiceIds', + full_name='context.ContextService.ListServiceIds', + index=24, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SERVICEIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListServices', + full_name='context.ContextService.ListServices', + index=25, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SERVICELIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetService', + full_name='context.ContextService.GetService', + index=26, + containing_service=None, + input_type=_SERVICEID, + output_type=_SERVICE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetService', + full_name='context.ContextService.SetService', + index=27, + containing_service=None, + input_type=_SERVICE, + output_type=_SERVICEID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveService', + full_name='context.ContextService.RemoveService', + index=28, + containing_service=None, + input_type=_SERVICEID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetServiceEvents', + full_name='context.ContextService.GetServiceEvents', + index=29, + containing_service=None, + input_type=_EMPTY, + output_type=_SERVICEEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListSliceIds', + full_name='context.ContextService.ListSliceIds', + index=30, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SLICEIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListSlices', + full_name='context.ContextService.ListSlices', + index=31, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SLICELIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetSlice', + full_name='context.ContextService.GetSlice', + index=32, + containing_service=None, + input_type=_SLICEID, + output_type=_SLICE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetSlice', + full_name='context.ContextService.SetSlice', + index=33, + containing_service=None, + input_type=_SLICE, + output_type=_SLICEID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveSlice', + full_name='context.ContextService.RemoveSlice', + index=34, + containing_service=None, + input_type=_SLICEID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetSliceEvents', + full_name='context.ContextService.GetSliceEvents', + index=35, + containing_service=None, + input_type=_EMPTY, + output_type=_SLICEEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListConnectionIds', + full_name='context.ContextService.ListConnectionIds', + index=36, + containing_service=None, + input_type=_SERVICEID, + output_type=_CONNECTIONIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListConnections', + full_name='context.ContextService.ListConnections', + index=37, + containing_service=None, + input_type=_SERVICEID, + output_type=_CONNECTIONLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetConnection', + full_name='context.ContextService.GetConnection', + index=38, + containing_service=None, + input_type=_CONNECTIONID, + output_type=_CONNECTION, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetConnection', + full_name='context.ContextService.SetConnection', + index=39, + containing_service=None, + input_type=_CONNECTION, + output_type=_CONNECTIONID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveConnection', + full_name='context.ContextService.RemoveConnection', + index=40, + containing_service=None, + input_type=_CONNECTIONID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetConnectionEvents', + full_name='context.ContextService.GetConnectionEvents', + index=41, + containing_service=None, + input_type=_EMPTY, + output_type=_CONNECTIONEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), +]) +_sym_db.RegisterServiceDescriptor(_CONTEXTSERVICE) + +DESCRIPTOR.services_by_name['ContextService'] = _CONTEXTSERVICE + +# @@protoc_insertion_point(module_scope) diff --git a/src/l3_centralizedattackdetector/proto/kpi_sample_types_pb2.py b/src/l3_centralizedattackdetector/proto/kpi_sample_types_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..ea7fd2f82757d4c3db02d7e2c7817e2787b0b490 --- /dev/null +++ b/src/l3_centralizedattackdetector/proto/kpi_sample_types_pb2.py @@ -0,0 +1,78 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: kpi_sample_types.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='kpi_sample_types.proto', + package='kpi_sample_types', + syntax='proto3', + serialized_options=None, + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n\x16kpi_sample_types.proto\x12\x10kpi_sample_types*\xbe\x01\n\rKpiSampleType\x12\x19\n\x15KPISAMPLETYPE_UNKNOWN\x10\x00\x12%\n!KPISAMPLETYPE_PACKETS_TRANSMITTED\x10\x65\x12\"\n\x1eKPISAMPLETYPE_PACKETS_RECEIVED\x10\x66\x12$\n\x1fKPISAMPLETYPE_BYTES_TRANSMITTED\x10\xc9\x01\x12!\n\x1cKPISAMPLETYPE_BYTES_RECEIVED\x10\xca\x01\x62\x06proto3' +) + +_KPISAMPLETYPE = _descriptor.EnumDescriptor( + name='KpiSampleType', + full_name='kpi_sample_types.KpiSampleType', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='KPISAMPLETYPE_UNKNOWN', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='KPISAMPLETYPE_PACKETS_TRANSMITTED', index=1, number=101, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='KPISAMPLETYPE_PACKETS_RECEIVED', index=2, number=102, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='KPISAMPLETYPE_BYTES_TRANSMITTED', index=3, number=201, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='KPISAMPLETYPE_BYTES_RECEIVED', index=4, number=202, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=45, + serialized_end=235, +) +_sym_db.RegisterEnumDescriptor(_KPISAMPLETYPE) + +KpiSampleType = enum_type_wrapper.EnumTypeWrapper(_KPISAMPLETYPE) +KPISAMPLETYPE_UNKNOWN = 0 +KPISAMPLETYPE_PACKETS_TRANSMITTED = 101 +KPISAMPLETYPE_PACKETS_RECEIVED = 102 +KPISAMPLETYPE_BYTES_TRANSMITTED = 201 +KPISAMPLETYPE_BYTES_RECEIVED = 202 + + +DESCRIPTOR.enum_types_by_name['KpiSampleType'] = _KPISAMPLETYPE +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + + +# @@protoc_insertion_point(module_scope) diff --git a/src/l3_centralizedattackdetector/proto/l3_attackmitigator_pb2.py b/src/l3_centralizedattackdetector/proto/l3_attackmitigator_pb2.py index 0ad49c2ed33f8f352f200cf23c2b871683b9d086..e148d0a2cfda7b7ea00b40218dcfe3dcb70f1f8f 100644 --- a/src/l3_centralizedattackdetector/proto/l3_attackmitigator_pb2.py +++ b/src/l3_centralizedattackdetector/proto/l3_attackmitigator_pb2.py @@ -11,6 +11,7 @@ from google.protobuf import symbol_database as _symbol_database _sym_db = _symbol_database.Default() +from . import context_pb2 as context__pb2 DESCRIPTOR = _descriptor.FileDescriptor( @@ -19,129 +20,93 @@ DESCRIPTOR = _descriptor.FileDescriptor( syntax='proto3', serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x18l3_attackmitigator.proto\"2\n\x0e\x45mptyMitigator\x12\x14\n\x07message\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\n\n\x08_message\"\xf9\x01\n\x06Output\x12\x12\n\nconfidence\x18\x01 \x01(\x02\x12\x11\n\ttimestamp\x18\x02 \x01(\t\x12\x0c\n\x04ip_o\x18\x03 \x01(\t\x12\x10\n\x08tag_name\x18\x04 \x01(\t\x12\x0b\n\x03tag\x18\x05 \x01(\x05\x12\x0f\n\x07\x66low_id\x18\x06 \x01(\t\x12\x10\n\x08protocol\x18\x07 \x01(\t\x12\x0e\n\x06port_d\x18\x08 \x01(\t\x12\x12\n\x05ml_id\x18\t \x01(\tH\x00\x88\x01\x01\x12\x17\n\ntime_start\x18\n \x01(\x02H\x01\x88\x01\x01\x12\x15\n\x08time_end\x18\x0b \x01(\x02H\x02\x88\x01\x01\x42\x08\n\x06_ml_idB\r\n\x0b_time_startB\x0b\n\t_time_end2r\n\x11L3Attackmitigator\x12(\n\nSendOutput\x12\x07.Output\x1a\x0f.EmptyMitigator\"\x00\x12\x33\n\rGetMitigation\x12\x0f.EmptyMitigator\x1a\x0f.EmptyMitigator\"\x00\x62\x06proto3' -) + serialized_pb=b'\n\x18l3_attackmitigator.proto\x1a\rcontext.proto\"\xd5\x01\n\x17L3AttackmitigatorOutput\x12\x12\n\nconfidence\x18\x01 \x01(\x02\x12\x11\n\ttimestamp\x18\x02 \x01(\t\x12\x0c\n\x04ip_o\x18\x03 \x01(\t\x12\x10\n\x08tag_name\x18\x04 \x01(\t\x12\x0b\n\x03tag\x18\x05 \x01(\x05\x12\x0f\n\x07\x66low_id\x18\x06 \x01(\t\x12\x10\n\x08protocol\x18\x07 \x01(\t\x12\x0e\n\x06port_d\x18\x08 \x01(\t\x12\r\n\x05ml_id\x18\t \x01(\t\x12\x12\n\ntime_start\x18\n \x01(\x02\x12\x10\n\x08time_end\x18\x0b \x01(\x02\x32\x80\x01\n\x11L3Attackmitigator\x12\x38\n\nSendOutput\x12\x18.L3AttackmitigatorOutput\x1a\x0e.context.Empty\"\x00\x12\x31\n\rGetMitigation\x12\x0e.context.Empty\x1a\x0e.context.Empty\"\x00\x62\x06proto3' + , + dependencies=[context__pb2.DESCRIPTOR,]) -_EMPTYMITIGATOR = _descriptor.Descriptor( - name='EmptyMitigator', - full_name='EmptyMitigator', +_L3ATTACKMITIGATOROUTPUT = _descriptor.Descriptor( + name='L3AttackmitigatorOutput', + full_name='L3AttackmitigatorOutput', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='message', full_name='EmptyMitigator.message', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='_message', full_name='EmptyMitigator._message', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=28, - serialized_end=78, -) - - -_OUTPUT = _descriptor.Descriptor( - name='Output', - full_name='Output', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='confidence', full_name='Output.confidence', index=0, + name='confidence', full_name='L3AttackmitigatorOutput.confidence', index=0, number=1, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='timestamp', full_name='Output.timestamp', index=1, + name='timestamp', full_name='L3AttackmitigatorOutput.timestamp', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='ip_o', full_name='Output.ip_o', index=2, + name='ip_o', full_name='L3AttackmitigatorOutput.ip_o', index=2, number=3, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='tag_name', full_name='Output.tag_name', index=3, + name='tag_name', full_name='L3AttackmitigatorOutput.tag_name', index=3, number=4, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='tag', full_name='Output.tag', index=4, + name='tag', full_name='L3AttackmitigatorOutput.tag', index=4, number=5, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='flow_id', full_name='Output.flow_id', index=5, + name='flow_id', full_name='L3AttackmitigatorOutput.flow_id', index=5, number=6, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='protocol', full_name='Output.protocol', index=6, + name='protocol', full_name='L3AttackmitigatorOutput.protocol', index=6, number=7, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='port_d', full_name='Output.port_d', index=7, + name='port_d', full_name='L3AttackmitigatorOutput.port_d', index=7, number=8, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='ml_id', full_name='Output.ml_id', index=8, + name='ml_id', full_name='L3AttackmitigatorOutput.ml_id', index=8, number=9, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='time_start', full_name='Output.time_start', index=9, + name='time_start', full_name='L3AttackmitigatorOutput.time_start', index=9, number=10, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='time_end', full_name='Output.time_end', index=10, + name='time_end', full_name='L3AttackmitigatorOutput.time_end', index=10, number=11, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, @@ -158,55 +123,20 @@ _OUTPUT = _descriptor.Descriptor( syntax='proto3', extension_ranges=[], oneofs=[ - _descriptor.OneofDescriptor( - name='_ml_id', full_name='Output._ml_id', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - _descriptor.OneofDescriptor( - name='_time_start', full_name='Output._time_start', - index=1, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - _descriptor.OneofDescriptor( - name='_time_end', full_name='Output._time_end', - index=2, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), ], - serialized_start=81, - serialized_end=330, + serialized_start=44, + serialized_end=257, ) -_EMPTYMITIGATOR.oneofs_by_name['_message'].fields.append( - _EMPTYMITIGATOR.fields_by_name['message']) -_EMPTYMITIGATOR.fields_by_name['message'].containing_oneof = _EMPTYMITIGATOR.oneofs_by_name['_message'] -_OUTPUT.oneofs_by_name['_ml_id'].fields.append( - _OUTPUT.fields_by_name['ml_id']) -_OUTPUT.fields_by_name['ml_id'].containing_oneof = _OUTPUT.oneofs_by_name['_ml_id'] -_OUTPUT.oneofs_by_name['_time_start'].fields.append( - _OUTPUT.fields_by_name['time_start']) -_OUTPUT.fields_by_name['time_start'].containing_oneof = _OUTPUT.oneofs_by_name['_time_start'] -_OUTPUT.oneofs_by_name['_time_end'].fields.append( - _OUTPUT.fields_by_name['time_end']) -_OUTPUT.fields_by_name['time_end'].containing_oneof = _OUTPUT.oneofs_by_name['_time_end'] -DESCRIPTOR.message_types_by_name['EmptyMitigator'] = _EMPTYMITIGATOR -DESCRIPTOR.message_types_by_name['Output'] = _OUTPUT +DESCRIPTOR.message_types_by_name['L3AttackmitigatorOutput'] = _L3ATTACKMITIGATOROUTPUT _sym_db.RegisterFileDescriptor(DESCRIPTOR) -EmptyMitigator = _reflection.GeneratedProtocolMessageType('EmptyMitigator', (_message.Message,), { - 'DESCRIPTOR' : _EMPTYMITIGATOR, - '__module__' : 'l3_attackmitigator_pb2' - # @@protoc_insertion_point(class_scope:EmptyMitigator) - }) -_sym_db.RegisterMessage(EmptyMitigator) - -Output = _reflection.GeneratedProtocolMessageType('Output', (_message.Message,), { - 'DESCRIPTOR' : _OUTPUT, +L3AttackmitigatorOutput = _reflection.GeneratedProtocolMessageType('L3AttackmitigatorOutput', (_message.Message,), { + 'DESCRIPTOR' : _L3ATTACKMITIGATOROUTPUT, '__module__' : 'l3_attackmitigator_pb2' - # @@protoc_insertion_point(class_scope:Output) + # @@protoc_insertion_point(class_scope:L3AttackmitigatorOutput) }) -_sym_db.RegisterMessage(Output) +_sym_db.RegisterMessage(L3AttackmitigatorOutput) @@ -217,16 +147,16 @@ _L3ATTACKMITIGATOR = _descriptor.ServiceDescriptor( index=0, serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_start=332, - serialized_end=446, + serialized_start=260, + serialized_end=388, methods=[ _descriptor.MethodDescriptor( name='SendOutput', full_name='L3Attackmitigator.SendOutput', index=0, containing_service=None, - input_type=_OUTPUT, - output_type=_EMPTYMITIGATOR, + input_type=_L3ATTACKMITIGATOROUTPUT, + output_type=context__pb2._EMPTY, serialized_options=None, create_key=_descriptor._internal_create_key, ), @@ -235,8 +165,8 @@ _L3ATTACKMITIGATOR = _descriptor.ServiceDescriptor( full_name='L3Attackmitigator.GetMitigation', index=1, containing_service=None, - input_type=_EMPTYMITIGATOR, - output_type=_EMPTYMITIGATOR, + input_type=context__pb2._EMPTY, + output_type=context__pb2._EMPTY, serialized_options=None, create_key=_descriptor._internal_create_key, ), diff --git a/src/l3_centralizedattackdetector/proto/l3_attackmitigator_pb2_grpc.py b/src/l3_centralizedattackdetector/proto/l3_attackmitigator_pb2_grpc.py deleted file mode 100644 index 3942d6843f99a341c8a6db7028e0d62a74d8ddb2..0000000000000000000000000000000000000000 --- a/src/l3_centralizedattackdetector/proto/l3_attackmitigator_pb2_grpc.py +++ /dev/null @@ -1,102 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc - - -from . import l3_attackmitigator_pb2 as l3__attackmitigator__pb2 - - -class L3AttackmitigatorStub(object): - """Missing associated documentation comment in .proto file.""" - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.SendOutput = channel.unary_unary( - '/L3Attackmitigator/SendOutput', - request_serializer=l3__attackmitigator__pb2.Output.SerializeToString, - response_deserializer=l3__attackmitigator__pb2.EmptyMitigator.FromString, - ) - self.GetMitigation = channel.unary_unary( - '/L3Attackmitigator/GetMitigation', - request_serializer=l3__attackmitigator__pb2.EmptyMitigator.SerializeToString, - response_deserializer=l3__attackmitigator__pb2.EmptyMitigator.FromString, - ) - - -class L3AttackmitigatorServicer(object): - """Missing associated documentation comment in .proto file.""" - - def SendOutput(self, request, context): - """Sends a greeting - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetMitigation(self, request, context): - """Sends another greeting - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_L3AttackmitigatorServicer_to_server(servicer, server): - rpc_method_handlers = { - 'SendOutput': grpc.unary_unary_rpc_method_handler( - servicer.SendOutput, - request_deserializer=l3__attackmitigator__pb2.Output.FromString, - response_serializer=l3__attackmitigator__pb2.EmptyMitigator.SerializeToString, - ), - 'GetMitigation': grpc.unary_unary_rpc_method_handler( - servicer.GetMitigation, - request_deserializer=l3__attackmitigator__pb2.EmptyMitigator.FromString, - response_serializer=l3__attackmitigator__pb2.EmptyMitigator.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'L3Attackmitigator', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class L3Attackmitigator(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def SendOutput(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/L3Attackmitigator/SendOutput', - l3__attackmitigator__pb2.Output.SerializeToString, - l3__attackmitigator__pb2.EmptyMitigator.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetMitigation(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/L3Attackmitigator/GetMitigation', - l3__attackmitigator__pb2.EmptyMitigator.SerializeToString, - l3__attackmitigator__pb2.EmptyMitigator.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/src/l3_centralizedattackdetector/proto/l3_centralizedattackdetector_pb2.py b/src/l3_centralizedattackdetector/proto/l3_centralizedattackdetector_pb2.py index cafbc6bf86a42e438dfccb1636f49b066be1530a..517fdb84b06c2c15b62a5616f33887ba337abf18 100644 --- a/src/l3_centralizedattackdetector/proto/l3_centralizedattackdetector_pb2.py +++ b/src/l3_centralizedattackdetector/proto/l3_centralizedattackdetector_pb2.py @@ -19,127 +19,127 @@ DESCRIPTOR = _descriptor.FileDescriptor( syntax='proto3', serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\"l3_centralizedattackdetector.proto\"\xd9\x03\n\nModelInput\x12 \n\x18n_packets_server_seconds\x18\x01 \x01(\x02\x12 \n\x18n_packets_client_seconds\x18\x02 \x01(\x02\x12\x1d\n\x15n_bits_server_seconds\x18\x03 \x01(\x02\x12\x1d\n\x15n_bits_client_seconds\x18\x04 \x01(\x02\x12&\n\x1en_bits_server_n_packets_server\x18\x05 \x01(\x02\x12&\n\x1en_bits_client_n_packets_client\x18\x06 \x01(\x02\x12)\n!n_packets_server_n_packets_client\x18\x07 \x01(\x02\x12#\n\x1bn_bits_server_n_bits_client\x18\x08 \x01(\x02\x12\x0c\n\x04ip_o\x18\t \x01(\t\x12\x0e\n\x06port_o\x18\n \x01(\t\x12\x0c\n\x04ip_d\x18\x0b \x01(\t\x12\x0e\n\x06port_d\x18\x0c \x01(\t\x12\x0f\n\x07\x66low_id\x18\r \x01(\t\x12\x10\n\x08protocol\x18\x0e \x01(\t\x12\x17\n\ntime_start\x18\x0f \x01(\x02H\x00\x88\x01\x01\x12\x15\n\x08time_end\x18\x10 \x01(\x02H\x01\x88\x01\x01\x42\r\n\x0b_time_startB\x0b\n\t_time_end\")\n\x05\x45mpty\x12\x14\n\x07message\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\n\n\x08_message\"\xfe\x01\n\x0bModelOutput\x12\x12\n\nconfidence\x18\x01 \x01(\x02\x12\x11\n\ttimestamp\x18\x02 \x01(\t\x12\x0c\n\x04ip_o\x18\x03 \x01(\t\x12\x10\n\x08tag_name\x18\x04 \x01(\t\x12\x0b\n\x03tag\x18\x05 \x01(\x05\x12\x0f\n\x07\x66low_id\x18\x06 \x01(\t\x12\x10\n\x08protocol\x18\x07 \x01(\t\x12\x0e\n\x06port_d\x18\x08 \x01(\t\x12\x12\n\x05ml_id\x18\t \x01(\tH\x00\x88\x01\x01\x12\x17\n\ntime_start\x18\n \x01(\x02H\x01\x88\x01\x01\x12\x15\n\x08time_end\x18\x0b \x01(\x02H\x02\x88\x01\x01\x42\x08\n\x06_ml_idB\r\n\x0b_time_startB\x0b\n\t_time_end2f\n\x1bL3Centralizedattackdetector\x12\"\n\tSendInput\x12\x0b.ModelInput\x1a\x06.Empty\"\x00\x12#\n\tGetOutput\x12\x06.Empty\x1a\x0c.ModelOutput\"\x00\x62\x06proto3' + serialized_pb=b'\n\"l3_centralizedattackdetector.proto\"\xcb\x03\n\"L3CentralizedattackdetectorMetrics\x12 \n\x18n_packets_server_seconds\x18\x01 \x01(\x02\x12 \n\x18n_packets_client_seconds\x18\x02 \x01(\x02\x12\x1d\n\x15n_bits_server_seconds\x18\x03 \x01(\x02\x12\x1d\n\x15n_bits_client_seconds\x18\x04 \x01(\x02\x12&\n\x1en_bits_server_n_packets_server\x18\x05 \x01(\x02\x12&\n\x1en_bits_client_n_packets_client\x18\x06 \x01(\x02\x12)\n!n_packets_server_n_packets_client\x18\x07 \x01(\x02\x12#\n\x1bn_bits_server_n_bits_client\x18\x08 \x01(\x02\x12\x0c\n\x04ip_o\x18\t \x01(\t\x12\x0e\n\x06port_o\x18\n \x01(\t\x12\x0c\n\x04ip_d\x18\x0b \x01(\t\x12\x0e\n\x06port_d\x18\x0c \x01(\t\x12\x0f\n\x07\x66low_id\x18\r \x01(\t\x12\x10\n\x08protocol\x18\x0e \x01(\t\x12\x12\n\ntime_start\x18\x0f \x01(\x02\x12\x10\n\x08time_end\x18\x10 \x01(\x02\"\x18\n\x05\x45mpty\x12\x0f\n\x07message\x18\x01 \x01(\t\"\xe4\x01\n&L3CentralizedattackdetectorModelOutput\x12\x12\n\nconfidence\x18\x01 \x01(\x02\x12\x11\n\ttimestamp\x18\x02 \x01(\t\x12\x0c\n\x04ip_o\x18\x03 \x01(\t\x12\x10\n\x08tag_name\x18\x04 \x01(\t\x12\x0b\n\x03tag\x18\x05 \x01(\x05\x12\x0f\n\x07\x66low_id\x18\x06 \x01(\t\x12\x10\n\x08protocol\x18\x07 \x01(\t\x12\x0e\n\x06port_d\x18\x08 \x01(\t\x12\r\n\x05ml_id\x18\t \x01(\t\x12\x12\n\ntime_start\x18\n \x01(\x02\x12\x10\n\x08time_end\x18\x0b \x01(\x02\x32\x99\x01\n\x1bL3Centralizedattackdetector\x12:\n\tSendInput\x12#.L3CentralizedattackdetectorMetrics\x1a\x06.Empty\"\x00\x12>\n\tGetOutput\x12\x06.Empty\x1a\'.L3CentralizedattackdetectorModelOutput\"\x00\x62\x06proto3' ) -_MODELINPUT = _descriptor.Descriptor( - name='ModelInput', - full_name='ModelInput', +_L3CENTRALIZEDATTACKDETECTORMETRICS = _descriptor.Descriptor( + name='L3CentralizedattackdetectorMetrics', + full_name='L3CentralizedattackdetectorMetrics', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='n_packets_server_seconds', full_name='ModelInput.n_packets_server_seconds', index=0, + name='n_packets_server_seconds', full_name='L3CentralizedattackdetectorMetrics.n_packets_server_seconds', index=0, number=1, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='n_packets_client_seconds', full_name='ModelInput.n_packets_client_seconds', index=1, + name='n_packets_client_seconds', full_name='L3CentralizedattackdetectorMetrics.n_packets_client_seconds', index=1, number=2, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='n_bits_server_seconds', full_name='ModelInput.n_bits_server_seconds', index=2, + name='n_bits_server_seconds', full_name='L3CentralizedattackdetectorMetrics.n_bits_server_seconds', index=2, number=3, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='n_bits_client_seconds', full_name='ModelInput.n_bits_client_seconds', index=3, + name='n_bits_client_seconds', full_name='L3CentralizedattackdetectorMetrics.n_bits_client_seconds', index=3, number=4, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='n_bits_server_n_packets_server', full_name='ModelInput.n_bits_server_n_packets_server', index=4, + name='n_bits_server_n_packets_server', full_name='L3CentralizedattackdetectorMetrics.n_bits_server_n_packets_server', index=4, number=5, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='n_bits_client_n_packets_client', full_name='ModelInput.n_bits_client_n_packets_client', index=5, + name='n_bits_client_n_packets_client', full_name='L3CentralizedattackdetectorMetrics.n_bits_client_n_packets_client', index=5, number=6, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='n_packets_server_n_packets_client', full_name='ModelInput.n_packets_server_n_packets_client', index=6, + name='n_packets_server_n_packets_client', full_name='L3CentralizedattackdetectorMetrics.n_packets_server_n_packets_client', index=6, number=7, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='n_bits_server_n_bits_client', full_name='ModelInput.n_bits_server_n_bits_client', index=7, + name='n_bits_server_n_bits_client', full_name='L3CentralizedattackdetectorMetrics.n_bits_server_n_bits_client', index=7, number=8, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='ip_o', full_name='ModelInput.ip_o', index=8, + name='ip_o', full_name='L3CentralizedattackdetectorMetrics.ip_o', index=8, number=9, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='port_o', full_name='ModelInput.port_o', index=9, + name='port_o', full_name='L3CentralizedattackdetectorMetrics.port_o', index=9, number=10, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='ip_d', full_name='ModelInput.ip_d', index=10, + name='ip_d', full_name='L3CentralizedattackdetectorMetrics.ip_d', index=10, number=11, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='port_d', full_name='ModelInput.port_d', index=11, + name='port_d', full_name='L3CentralizedattackdetectorMetrics.port_d', index=11, number=12, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='flow_id', full_name='ModelInput.flow_id', index=12, + name='flow_id', full_name='L3CentralizedattackdetectorMetrics.flow_id', index=12, number=13, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='protocol', full_name='ModelInput.protocol', index=13, + name='protocol', full_name='L3CentralizedattackdetectorMetrics.protocol', index=13, number=14, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='time_start', full_name='ModelInput.time_start', index=14, + name='time_start', full_name='L3CentralizedattackdetectorMetrics.time_start', index=14, number=15, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='time_end', full_name='ModelInput.time_end', index=15, + name='time_end', full_name='L3CentralizedattackdetectorMetrics.time_end', index=15, number=16, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, @@ -156,19 +156,9 @@ _MODELINPUT = _descriptor.Descriptor( syntax='proto3', extension_ranges=[], oneofs=[ - _descriptor.OneofDescriptor( - name='_time_start', full_name='ModelInput._time_start', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - _descriptor.OneofDescriptor( - name='_time_end', full_name='ModelInput._time_end', - index=1, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), ], serialized_start=39, - serialized_end=512, + serialized_end=498, ) @@ -198,97 +188,92 @@ _EMPTY = _descriptor.Descriptor( syntax='proto3', extension_ranges=[], oneofs=[ - _descriptor.OneofDescriptor( - name='_message', full_name='Empty._message', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), ], - serialized_start=514, - serialized_end=555, + serialized_start=500, + serialized_end=524, ) -_MODELOUTPUT = _descriptor.Descriptor( - name='ModelOutput', - full_name='ModelOutput', +_L3CENTRALIZEDATTACKDETECTORMODELOUTPUT = _descriptor.Descriptor( + name='L3CentralizedattackdetectorModelOutput', + full_name='L3CentralizedattackdetectorModelOutput', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='confidence', full_name='ModelOutput.confidence', index=0, + name='confidence', full_name='L3CentralizedattackdetectorModelOutput.confidence', index=0, number=1, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='timestamp', full_name='ModelOutput.timestamp', index=1, + name='timestamp', full_name='L3CentralizedattackdetectorModelOutput.timestamp', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='ip_o', full_name='ModelOutput.ip_o', index=2, + name='ip_o', full_name='L3CentralizedattackdetectorModelOutput.ip_o', index=2, number=3, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='tag_name', full_name='ModelOutput.tag_name', index=3, + name='tag_name', full_name='L3CentralizedattackdetectorModelOutput.tag_name', index=3, number=4, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='tag', full_name='ModelOutput.tag', index=4, + name='tag', full_name='L3CentralizedattackdetectorModelOutput.tag', index=4, number=5, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='flow_id', full_name='ModelOutput.flow_id', index=5, + name='flow_id', full_name='L3CentralizedattackdetectorModelOutput.flow_id', index=5, number=6, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='protocol', full_name='ModelOutput.protocol', index=6, + name='protocol', full_name='L3CentralizedattackdetectorModelOutput.protocol', index=6, number=7, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='port_d', full_name='ModelOutput.port_d', index=7, + name='port_d', full_name='L3CentralizedattackdetectorModelOutput.port_d', index=7, number=8, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='ml_id', full_name='ModelOutput.ml_id', index=8, + name='ml_id', full_name='L3CentralizedattackdetectorModelOutput.ml_id', index=8, number=9, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='time_start', full_name='ModelOutput.time_start', index=9, + name='time_start', full_name='L3CentralizedattackdetectorModelOutput.time_start', index=9, number=10, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='time_end', full_name='ModelOutput.time_end', index=10, + name='time_end', full_name='L3CentralizedattackdetectorModelOutput.time_end', index=10, number=11, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, @@ -305,55 +290,22 @@ _MODELOUTPUT = _descriptor.Descriptor( syntax='proto3', extension_ranges=[], oneofs=[ - _descriptor.OneofDescriptor( - name='_ml_id', full_name='ModelOutput._ml_id', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - _descriptor.OneofDescriptor( - name='_time_start', full_name='ModelOutput._time_start', - index=1, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - _descriptor.OneofDescriptor( - name='_time_end', full_name='ModelOutput._time_end', - index=2, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), ], - serialized_start=558, - serialized_end=812, + serialized_start=527, + serialized_end=755, ) -_MODELINPUT.oneofs_by_name['_time_start'].fields.append( - _MODELINPUT.fields_by_name['time_start']) -_MODELINPUT.fields_by_name['time_start'].containing_oneof = _MODELINPUT.oneofs_by_name['_time_start'] -_MODELINPUT.oneofs_by_name['_time_end'].fields.append( - _MODELINPUT.fields_by_name['time_end']) -_MODELINPUT.fields_by_name['time_end'].containing_oneof = _MODELINPUT.oneofs_by_name['_time_end'] -_EMPTY.oneofs_by_name['_message'].fields.append( - _EMPTY.fields_by_name['message']) -_EMPTY.fields_by_name['message'].containing_oneof = _EMPTY.oneofs_by_name['_message'] -_MODELOUTPUT.oneofs_by_name['_ml_id'].fields.append( - _MODELOUTPUT.fields_by_name['ml_id']) -_MODELOUTPUT.fields_by_name['ml_id'].containing_oneof = _MODELOUTPUT.oneofs_by_name['_ml_id'] -_MODELOUTPUT.oneofs_by_name['_time_start'].fields.append( - _MODELOUTPUT.fields_by_name['time_start']) -_MODELOUTPUT.fields_by_name['time_start'].containing_oneof = _MODELOUTPUT.oneofs_by_name['_time_start'] -_MODELOUTPUT.oneofs_by_name['_time_end'].fields.append( - _MODELOUTPUT.fields_by_name['time_end']) -_MODELOUTPUT.fields_by_name['time_end'].containing_oneof = _MODELOUTPUT.oneofs_by_name['_time_end'] -DESCRIPTOR.message_types_by_name['ModelInput'] = _MODELINPUT +DESCRIPTOR.message_types_by_name['L3CentralizedattackdetectorMetrics'] = _L3CENTRALIZEDATTACKDETECTORMETRICS DESCRIPTOR.message_types_by_name['Empty'] = _EMPTY -DESCRIPTOR.message_types_by_name['ModelOutput'] = _MODELOUTPUT +DESCRIPTOR.message_types_by_name['L3CentralizedattackdetectorModelOutput'] = _L3CENTRALIZEDATTACKDETECTORMODELOUTPUT _sym_db.RegisterFileDescriptor(DESCRIPTOR) -ModelInput = _reflection.GeneratedProtocolMessageType('ModelInput', (_message.Message,), { - 'DESCRIPTOR' : _MODELINPUT, +L3CentralizedattackdetectorMetrics = _reflection.GeneratedProtocolMessageType('L3CentralizedattackdetectorMetrics', (_message.Message,), { + 'DESCRIPTOR' : _L3CENTRALIZEDATTACKDETECTORMETRICS, '__module__' : 'l3_centralizedattackdetector_pb2' - # @@protoc_insertion_point(class_scope:ModelInput) + # @@protoc_insertion_point(class_scope:L3CentralizedattackdetectorMetrics) }) -_sym_db.RegisterMessage(ModelInput) +_sym_db.RegisterMessage(L3CentralizedattackdetectorMetrics) Empty = _reflection.GeneratedProtocolMessageType('Empty', (_message.Message,), { 'DESCRIPTOR' : _EMPTY, @@ -362,12 +314,12 @@ Empty = _reflection.GeneratedProtocolMessageType('Empty', (_message.Message,), { }) _sym_db.RegisterMessage(Empty) -ModelOutput = _reflection.GeneratedProtocolMessageType('ModelOutput', (_message.Message,), { - 'DESCRIPTOR' : _MODELOUTPUT, +L3CentralizedattackdetectorModelOutput = _reflection.GeneratedProtocolMessageType('L3CentralizedattackdetectorModelOutput', (_message.Message,), { + 'DESCRIPTOR' : _L3CENTRALIZEDATTACKDETECTORMODELOUTPUT, '__module__' : 'l3_centralizedattackdetector_pb2' - # @@protoc_insertion_point(class_scope:ModelOutput) + # @@protoc_insertion_point(class_scope:L3CentralizedattackdetectorModelOutput) }) -_sym_db.RegisterMessage(ModelOutput) +_sym_db.RegisterMessage(L3CentralizedattackdetectorModelOutput) @@ -378,15 +330,15 @@ _L3CENTRALIZEDATTACKDETECTOR = _descriptor.ServiceDescriptor( index=0, serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_start=814, - serialized_end=916, + serialized_start=758, + serialized_end=911, methods=[ _descriptor.MethodDescriptor( name='SendInput', full_name='L3Centralizedattackdetector.SendInput', index=0, containing_service=None, - input_type=_MODELINPUT, + input_type=_L3CENTRALIZEDATTACKDETECTORMETRICS, output_type=_EMPTY, serialized_options=None, create_key=_descriptor._internal_create_key, @@ -397,7 +349,7 @@ _L3CENTRALIZEDATTACKDETECTOR = _descriptor.ServiceDescriptor( index=1, containing_service=None, input_type=_EMPTY, - output_type=_MODELOUTPUT, + output_type=_L3CENTRALIZEDATTACKDETECTORMODELOUTPUT, serialized_options=None, create_key=_descriptor._internal_create_key, ), diff --git a/src/l3_centralizedattackdetector/proto/l3_centralizedattackdetector_pb2_grpc.py b/src/l3_centralizedattackdetector/proto/l3_centralizedattackdetector_pb2_grpc.py index eaff683645c7d3f62afc8fc3e94c8e5841a42f00..29136b4da95c9fc2ad7d4827521b26e872186dcf 100644 --- a/src/l3_centralizedattackdetector/proto/l3_centralizedattackdetector_pb2_grpc.py +++ b/src/l3_centralizedattackdetector/proto/l3_centralizedattackdetector_pb2_grpc.py @@ -16,13 +16,13 @@ class L3CentralizedattackdetectorStub(object): """ self.SendInput = channel.unary_unary( '/L3Centralizedattackdetector/SendInput', - request_serializer=l3__centralizedattackdetector__pb2.ModelInput.SerializeToString, + request_serializer=l3__centralizedattackdetector__pb2.L3CentralizedattackdetectorMetrics.SerializeToString, response_deserializer=l3__centralizedattackdetector__pb2.Empty.FromString, ) self.GetOutput = channel.unary_unary( '/L3Centralizedattackdetector/GetOutput', request_serializer=l3__centralizedattackdetector__pb2.Empty.SerializeToString, - response_deserializer=l3__centralizedattackdetector__pb2.ModelOutput.FromString, + response_deserializer=l3__centralizedattackdetector__pb2.L3CentralizedattackdetectorModelOutput.FromString, ) @@ -48,13 +48,13 @@ def add_L3CentralizedattackdetectorServicer_to_server(servicer, server): rpc_method_handlers = { 'SendInput': grpc.unary_unary_rpc_method_handler( servicer.SendInput, - request_deserializer=l3__centralizedattackdetector__pb2.ModelInput.FromString, + request_deserializer=l3__centralizedattackdetector__pb2.L3CentralizedattackdetectorMetrics.FromString, response_serializer=l3__centralizedattackdetector__pb2.Empty.SerializeToString, ), 'GetOutput': grpc.unary_unary_rpc_method_handler( servicer.GetOutput, request_deserializer=l3__centralizedattackdetector__pb2.Empty.FromString, - response_serializer=l3__centralizedattackdetector__pb2.ModelOutput.SerializeToString, + response_serializer=l3__centralizedattackdetector__pb2.L3CentralizedattackdetectorModelOutput.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( @@ -78,7 +78,7 @@ class L3Centralizedattackdetector(object): timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/L3Centralizedattackdetector/SendInput', - l3__centralizedattackdetector__pb2.ModelInput.SerializeToString, + l3__centralizedattackdetector__pb2.L3CentralizedattackdetectorMetrics.SerializeToString, l3__centralizedattackdetector__pb2.Empty.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @@ -96,6 +96,6 @@ class L3Centralizedattackdetector(object): metadata=None): return grpc.experimental.unary_unary(request, target, '/L3Centralizedattackdetector/GetOutput', l3__centralizedattackdetector__pb2.Empty.SerializeToString, - l3__centralizedattackdetector__pb2.ModelOutput.FromString, + l3__centralizedattackdetector__pb2.L3CentralizedattackdetectorModelOutput.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/src/l3_distributedattackdetector/.gitlab-ci.yml b/src/l3_distributedattackdetector/.gitlab-ci.yml index 1e34c6c7e44d5bfdac06aabb2e738e368b633675..7ced7a62c19c717e2c4091f08c73579a79ad383b 100644 --- a/src/l3_distributedattackdetector/.gitlab-ci.yml +++ b/src/l3_distributedattackdetector/.gitlab-ci.yml @@ -55,7 +55,6 @@ unit test l3_distributedattackdetector: - docker ps -a - docker logs $IMAGE_NAME - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml" - - docker exec -i $IMAGE_NAME bash -c "coverage xml -o /opt/results/${IMAGE_NAME}_coverage.xml" - docker exec -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing" coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' after_script: @@ -75,7 +74,6 @@ unit test l3_distributedattackdetector: when: always reports: junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml - cobertura: src/$IMAGE_NAME/tests/${IMAGE_NAME}_coverage.xml # Deployment of the service in Kubernetes Cluster deploy l3_distributedattackdetector: diff --git a/src/l3_distributedattackdetector/genproto.sh b/src/l3_distributedattackdetector/genproto.sh old mode 100644 new mode 100755 index 9ca93e30e45fbdc89eb4837fcf2e9fb8cbd2f3ee..c1f54c0dc1cdb6ef2681504ec0783f5479084fa8 --- a/src/l3_distributedattackdetector/genproto.sh +++ b/src/l3_distributedattackdetector/genproto.sh @@ -1,6 +1,6 @@ #!/bin/bash -eu # -# Copyright 2018 Google LLC +# 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. @@ -14,14 +14,27 @@ # See the License for the specific language governing permissions and # limitations under the License. -#!/bin/bash -e - # Make folder containing the script the root folder for its execution cd $(dirname $0) rm -rf proto/*.py rm -rf proto/__pycache__ -touch proto/__init__.py +tee proto/__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 python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto l3_centralizedattackdetector.proto diff --git a/src/l3_distributedattackdetector/proto/l3_centralizedattackdetector_pb2.py b/src/l3_distributedattackdetector/proto/l3_centralizedattackdetector_pb2.py index cafbc6bf86a42e438dfccb1636f49b066be1530a..517fdb84b06c2c15b62a5616f33887ba337abf18 100644 --- a/src/l3_distributedattackdetector/proto/l3_centralizedattackdetector_pb2.py +++ b/src/l3_distributedattackdetector/proto/l3_centralizedattackdetector_pb2.py @@ -19,127 +19,127 @@ DESCRIPTOR = _descriptor.FileDescriptor( syntax='proto3', serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\"l3_centralizedattackdetector.proto\"\xd9\x03\n\nModelInput\x12 \n\x18n_packets_server_seconds\x18\x01 \x01(\x02\x12 \n\x18n_packets_client_seconds\x18\x02 \x01(\x02\x12\x1d\n\x15n_bits_server_seconds\x18\x03 \x01(\x02\x12\x1d\n\x15n_bits_client_seconds\x18\x04 \x01(\x02\x12&\n\x1en_bits_server_n_packets_server\x18\x05 \x01(\x02\x12&\n\x1en_bits_client_n_packets_client\x18\x06 \x01(\x02\x12)\n!n_packets_server_n_packets_client\x18\x07 \x01(\x02\x12#\n\x1bn_bits_server_n_bits_client\x18\x08 \x01(\x02\x12\x0c\n\x04ip_o\x18\t \x01(\t\x12\x0e\n\x06port_o\x18\n \x01(\t\x12\x0c\n\x04ip_d\x18\x0b \x01(\t\x12\x0e\n\x06port_d\x18\x0c \x01(\t\x12\x0f\n\x07\x66low_id\x18\r \x01(\t\x12\x10\n\x08protocol\x18\x0e \x01(\t\x12\x17\n\ntime_start\x18\x0f \x01(\x02H\x00\x88\x01\x01\x12\x15\n\x08time_end\x18\x10 \x01(\x02H\x01\x88\x01\x01\x42\r\n\x0b_time_startB\x0b\n\t_time_end\")\n\x05\x45mpty\x12\x14\n\x07message\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\n\n\x08_message\"\xfe\x01\n\x0bModelOutput\x12\x12\n\nconfidence\x18\x01 \x01(\x02\x12\x11\n\ttimestamp\x18\x02 \x01(\t\x12\x0c\n\x04ip_o\x18\x03 \x01(\t\x12\x10\n\x08tag_name\x18\x04 \x01(\t\x12\x0b\n\x03tag\x18\x05 \x01(\x05\x12\x0f\n\x07\x66low_id\x18\x06 \x01(\t\x12\x10\n\x08protocol\x18\x07 \x01(\t\x12\x0e\n\x06port_d\x18\x08 \x01(\t\x12\x12\n\x05ml_id\x18\t \x01(\tH\x00\x88\x01\x01\x12\x17\n\ntime_start\x18\n \x01(\x02H\x01\x88\x01\x01\x12\x15\n\x08time_end\x18\x0b \x01(\x02H\x02\x88\x01\x01\x42\x08\n\x06_ml_idB\r\n\x0b_time_startB\x0b\n\t_time_end2f\n\x1bL3Centralizedattackdetector\x12\"\n\tSendInput\x12\x0b.ModelInput\x1a\x06.Empty\"\x00\x12#\n\tGetOutput\x12\x06.Empty\x1a\x0c.ModelOutput\"\x00\x62\x06proto3' + serialized_pb=b'\n\"l3_centralizedattackdetector.proto\"\xcb\x03\n\"L3CentralizedattackdetectorMetrics\x12 \n\x18n_packets_server_seconds\x18\x01 \x01(\x02\x12 \n\x18n_packets_client_seconds\x18\x02 \x01(\x02\x12\x1d\n\x15n_bits_server_seconds\x18\x03 \x01(\x02\x12\x1d\n\x15n_bits_client_seconds\x18\x04 \x01(\x02\x12&\n\x1en_bits_server_n_packets_server\x18\x05 \x01(\x02\x12&\n\x1en_bits_client_n_packets_client\x18\x06 \x01(\x02\x12)\n!n_packets_server_n_packets_client\x18\x07 \x01(\x02\x12#\n\x1bn_bits_server_n_bits_client\x18\x08 \x01(\x02\x12\x0c\n\x04ip_o\x18\t \x01(\t\x12\x0e\n\x06port_o\x18\n \x01(\t\x12\x0c\n\x04ip_d\x18\x0b \x01(\t\x12\x0e\n\x06port_d\x18\x0c \x01(\t\x12\x0f\n\x07\x66low_id\x18\r \x01(\t\x12\x10\n\x08protocol\x18\x0e \x01(\t\x12\x12\n\ntime_start\x18\x0f \x01(\x02\x12\x10\n\x08time_end\x18\x10 \x01(\x02\"\x18\n\x05\x45mpty\x12\x0f\n\x07message\x18\x01 \x01(\t\"\xe4\x01\n&L3CentralizedattackdetectorModelOutput\x12\x12\n\nconfidence\x18\x01 \x01(\x02\x12\x11\n\ttimestamp\x18\x02 \x01(\t\x12\x0c\n\x04ip_o\x18\x03 \x01(\t\x12\x10\n\x08tag_name\x18\x04 \x01(\t\x12\x0b\n\x03tag\x18\x05 \x01(\x05\x12\x0f\n\x07\x66low_id\x18\x06 \x01(\t\x12\x10\n\x08protocol\x18\x07 \x01(\t\x12\x0e\n\x06port_d\x18\x08 \x01(\t\x12\r\n\x05ml_id\x18\t \x01(\t\x12\x12\n\ntime_start\x18\n \x01(\x02\x12\x10\n\x08time_end\x18\x0b \x01(\x02\x32\x99\x01\n\x1bL3Centralizedattackdetector\x12:\n\tSendInput\x12#.L3CentralizedattackdetectorMetrics\x1a\x06.Empty\"\x00\x12>\n\tGetOutput\x12\x06.Empty\x1a\'.L3CentralizedattackdetectorModelOutput\"\x00\x62\x06proto3' ) -_MODELINPUT = _descriptor.Descriptor( - name='ModelInput', - full_name='ModelInput', +_L3CENTRALIZEDATTACKDETECTORMETRICS = _descriptor.Descriptor( + name='L3CentralizedattackdetectorMetrics', + full_name='L3CentralizedattackdetectorMetrics', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='n_packets_server_seconds', full_name='ModelInput.n_packets_server_seconds', index=0, + name='n_packets_server_seconds', full_name='L3CentralizedattackdetectorMetrics.n_packets_server_seconds', index=0, number=1, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='n_packets_client_seconds', full_name='ModelInput.n_packets_client_seconds', index=1, + name='n_packets_client_seconds', full_name='L3CentralizedattackdetectorMetrics.n_packets_client_seconds', index=1, number=2, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='n_bits_server_seconds', full_name='ModelInput.n_bits_server_seconds', index=2, + name='n_bits_server_seconds', full_name='L3CentralizedattackdetectorMetrics.n_bits_server_seconds', index=2, number=3, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='n_bits_client_seconds', full_name='ModelInput.n_bits_client_seconds', index=3, + name='n_bits_client_seconds', full_name='L3CentralizedattackdetectorMetrics.n_bits_client_seconds', index=3, number=4, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='n_bits_server_n_packets_server', full_name='ModelInput.n_bits_server_n_packets_server', index=4, + name='n_bits_server_n_packets_server', full_name='L3CentralizedattackdetectorMetrics.n_bits_server_n_packets_server', index=4, number=5, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='n_bits_client_n_packets_client', full_name='ModelInput.n_bits_client_n_packets_client', index=5, + name='n_bits_client_n_packets_client', full_name='L3CentralizedattackdetectorMetrics.n_bits_client_n_packets_client', index=5, number=6, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='n_packets_server_n_packets_client', full_name='ModelInput.n_packets_server_n_packets_client', index=6, + name='n_packets_server_n_packets_client', full_name='L3CentralizedattackdetectorMetrics.n_packets_server_n_packets_client', index=6, number=7, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='n_bits_server_n_bits_client', full_name='ModelInput.n_bits_server_n_bits_client', index=7, + name='n_bits_server_n_bits_client', full_name='L3CentralizedattackdetectorMetrics.n_bits_server_n_bits_client', index=7, number=8, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='ip_o', full_name='ModelInput.ip_o', index=8, + name='ip_o', full_name='L3CentralizedattackdetectorMetrics.ip_o', index=8, number=9, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='port_o', full_name='ModelInput.port_o', index=9, + name='port_o', full_name='L3CentralizedattackdetectorMetrics.port_o', index=9, number=10, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='ip_d', full_name='ModelInput.ip_d', index=10, + name='ip_d', full_name='L3CentralizedattackdetectorMetrics.ip_d', index=10, number=11, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='port_d', full_name='ModelInput.port_d', index=11, + name='port_d', full_name='L3CentralizedattackdetectorMetrics.port_d', index=11, number=12, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='flow_id', full_name='ModelInput.flow_id', index=12, + name='flow_id', full_name='L3CentralizedattackdetectorMetrics.flow_id', index=12, number=13, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='protocol', full_name='ModelInput.protocol', index=13, + name='protocol', full_name='L3CentralizedattackdetectorMetrics.protocol', index=13, number=14, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='time_start', full_name='ModelInput.time_start', index=14, + name='time_start', full_name='L3CentralizedattackdetectorMetrics.time_start', index=14, number=15, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='time_end', full_name='ModelInput.time_end', index=15, + name='time_end', full_name='L3CentralizedattackdetectorMetrics.time_end', index=15, number=16, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, @@ -156,19 +156,9 @@ _MODELINPUT = _descriptor.Descriptor( syntax='proto3', extension_ranges=[], oneofs=[ - _descriptor.OneofDescriptor( - name='_time_start', full_name='ModelInput._time_start', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - _descriptor.OneofDescriptor( - name='_time_end', full_name='ModelInput._time_end', - index=1, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), ], serialized_start=39, - serialized_end=512, + serialized_end=498, ) @@ -198,97 +188,92 @@ _EMPTY = _descriptor.Descriptor( syntax='proto3', extension_ranges=[], oneofs=[ - _descriptor.OneofDescriptor( - name='_message', full_name='Empty._message', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), ], - serialized_start=514, - serialized_end=555, + serialized_start=500, + serialized_end=524, ) -_MODELOUTPUT = _descriptor.Descriptor( - name='ModelOutput', - full_name='ModelOutput', +_L3CENTRALIZEDATTACKDETECTORMODELOUTPUT = _descriptor.Descriptor( + name='L3CentralizedattackdetectorModelOutput', + full_name='L3CentralizedattackdetectorModelOutput', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='confidence', full_name='ModelOutput.confidence', index=0, + name='confidence', full_name='L3CentralizedattackdetectorModelOutput.confidence', index=0, number=1, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='timestamp', full_name='ModelOutput.timestamp', index=1, + name='timestamp', full_name='L3CentralizedattackdetectorModelOutput.timestamp', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='ip_o', full_name='ModelOutput.ip_o', index=2, + name='ip_o', full_name='L3CentralizedattackdetectorModelOutput.ip_o', index=2, number=3, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='tag_name', full_name='ModelOutput.tag_name', index=3, + name='tag_name', full_name='L3CentralizedattackdetectorModelOutput.tag_name', index=3, number=4, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='tag', full_name='ModelOutput.tag', index=4, + name='tag', full_name='L3CentralizedattackdetectorModelOutput.tag', index=4, number=5, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='flow_id', full_name='ModelOutput.flow_id', index=5, + name='flow_id', full_name='L3CentralizedattackdetectorModelOutput.flow_id', index=5, number=6, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='protocol', full_name='ModelOutput.protocol', index=6, + name='protocol', full_name='L3CentralizedattackdetectorModelOutput.protocol', index=6, number=7, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='port_d', full_name='ModelOutput.port_d', index=7, + name='port_d', full_name='L3CentralizedattackdetectorModelOutput.port_d', index=7, number=8, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='ml_id', full_name='ModelOutput.ml_id', index=8, + name='ml_id', full_name='L3CentralizedattackdetectorModelOutput.ml_id', index=8, number=9, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='time_start', full_name='ModelOutput.time_start', index=9, + name='time_start', full_name='L3CentralizedattackdetectorModelOutput.time_start', index=9, number=10, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='time_end', full_name='ModelOutput.time_end', index=10, + name='time_end', full_name='L3CentralizedattackdetectorModelOutput.time_end', index=10, number=11, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, @@ -305,55 +290,22 @@ _MODELOUTPUT = _descriptor.Descriptor( syntax='proto3', extension_ranges=[], oneofs=[ - _descriptor.OneofDescriptor( - name='_ml_id', full_name='ModelOutput._ml_id', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - _descriptor.OneofDescriptor( - name='_time_start', full_name='ModelOutput._time_start', - index=1, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - _descriptor.OneofDescriptor( - name='_time_end', full_name='ModelOutput._time_end', - index=2, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), ], - serialized_start=558, - serialized_end=812, + serialized_start=527, + serialized_end=755, ) -_MODELINPUT.oneofs_by_name['_time_start'].fields.append( - _MODELINPUT.fields_by_name['time_start']) -_MODELINPUT.fields_by_name['time_start'].containing_oneof = _MODELINPUT.oneofs_by_name['_time_start'] -_MODELINPUT.oneofs_by_name['_time_end'].fields.append( - _MODELINPUT.fields_by_name['time_end']) -_MODELINPUT.fields_by_name['time_end'].containing_oneof = _MODELINPUT.oneofs_by_name['_time_end'] -_EMPTY.oneofs_by_name['_message'].fields.append( - _EMPTY.fields_by_name['message']) -_EMPTY.fields_by_name['message'].containing_oneof = _EMPTY.oneofs_by_name['_message'] -_MODELOUTPUT.oneofs_by_name['_ml_id'].fields.append( - _MODELOUTPUT.fields_by_name['ml_id']) -_MODELOUTPUT.fields_by_name['ml_id'].containing_oneof = _MODELOUTPUT.oneofs_by_name['_ml_id'] -_MODELOUTPUT.oneofs_by_name['_time_start'].fields.append( - _MODELOUTPUT.fields_by_name['time_start']) -_MODELOUTPUT.fields_by_name['time_start'].containing_oneof = _MODELOUTPUT.oneofs_by_name['_time_start'] -_MODELOUTPUT.oneofs_by_name['_time_end'].fields.append( - _MODELOUTPUT.fields_by_name['time_end']) -_MODELOUTPUT.fields_by_name['time_end'].containing_oneof = _MODELOUTPUT.oneofs_by_name['_time_end'] -DESCRIPTOR.message_types_by_name['ModelInput'] = _MODELINPUT +DESCRIPTOR.message_types_by_name['L3CentralizedattackdetectorMetrics'] = _L3CENTRALIZEDATTACKDETECTORMETRICS DESCRIPTOR.message_types_by_name['Empty'] = _EMPTY -DESCRIPTOR.message_types_by_name['ModelOutput'] = _MODELOUTPUT +DESCRIPTOR.message_types_by_name['L3CentralizedattackdetectorModelOutput'] = _L3CENTRALIZEDATTACKDETECTORMODELOUTPUT _sym_db.RegisterFileDescriptor(DESCRIPTOR) -ModelInput = _reflection.GeneratedProtocolMessageType('ModelInput', (_message.Message,), { - 'DESCRIPTOR' : _MODELINPUT, +L3CentralizedattackdetectorMetrics = _reflection.GeneratedProtocolMessageType('L3CentralizedattackdetectorMetrics', (_message.Message,), { + 'DESCRIPTOR' : _L3CENTRALIZEDATTACKDETECTORMETRICS, '__module__' : 'l3_centralizedattackdetector_pb2' - # @@protoc_insertion_point(class_scope:ModelInput) + # @@protoc_insertion_point(class_scope:L3CentralizedattackdetectorMetrics) }) -_sym_db.RegisterMessage(ModelInput) +_sym_db.RegisterMessage(L3CentralizedattackdetectorMetrics) Empty = _reflection.GeneratedProtocolMessageType('Empty', (_message.Message,), { 'DESCRIPTOR' : _EMPTY, @@ -362,12 +314,12 @@ Empty = _reflection.GeneratedProtocolMessageType('Empty', (_message.Message,), { }) _sym_db.RegisterMessage(Empty) -ModelOutput = _reflection.GeneratedProtocolMessageType('ModelOutput', (_message.Message,), { - 'DESCRIPTOR' : _MODELOUTPUT, +L3CentralizedattackdetectorModelOutput = _reflection.GeneratedProtocolMessageType('L3CentralizedattackdetectorModelOutput', (_message.Message,), { + 'DESCRIPTOR' : _L3CENTRALIZEDATTACKDETECTORMODELOUTPUT, '__module__' : 'l3_centralizedattackdetector_pb2' - # @@protoc_insertion_point(class_scope:ModelOutput) + # @@protoc_insertion_point(class_scope:L3CentralizedattackdetectorModelOutput) }) -_sym_db.RegisterMessage(ModelOutput) +_sym_db.RegisterMessage(L3CentralizedattackdetectorModelOutput) @@ -378,15 +330,15 @@ _L3CENTRALIZEDATTACKDETECTOR = _descriptor.ServiceDescriptor( index=0, serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_start=814, - serialized_end=916, + serialized_start=758, + serialized_end=911, methods=[ _descriptor.MethodDescriptor( name='SendInput', full_name='L3Centralizedattackdetector.SendInput', index=0, containing_service=None, - input_type=_MODELINPUT, + input_type=_L3CENTRALIZEDATTACKDETECTORMETRICS, output_type=_EMPTY, serialized_options=None, create_key=_descriptor._internal_create_key, @@ -397,7 +349,7 @@ _L3CENTRALIZEDATTACKDETECTOR = _descriptor.ServiceDescriptor( index=1, containing_service=None, input_type=_EMPTY, - output_type=_MODELOUTPUT, + output_type=_L3CENTRALIZEDATTACKDETECTORMODELOUTPUT, serialized_options=None, create_key=_descriptor._internal_create_key, ), diff --git a/src/l3_distributedattackdetector/proto/l3_centralizedattackdetector_pb2_grpc.py b/src/l3_distributedattackdetector/proto/l3_centralizedattackdetector_pb2_grpc.py index eaff683645c7d3f62afc8fc3e94c8e5841a42f00..29136b4da95c9fc2ad7d4827521b26e872186dcf 100644 --- a/src/l3_distributedattackdetector/proto/l3_centralizedattackdetector_pb2_grpc.py +++ b/src/l3_distributedattackdetector/proto/l3_centralizedattackdetector_pb2_grpc.py @@ -16,13 +16,13 @@ class L3CentralizedattackdetectorStub(object): """ self.SendInput = channel.unary_unary( '/L3Centralizedattackdetector/SendInput', - request_serializer=l3__centralizedattackdetector__pb2.ModelInput.SerializeToString, + request_serializer=l3__centralizedattackdetector__pb2.L3CentralizedattackdetectorMetrics.SerializeToString, response_deserializer=l3__centralizedattackdetector__pb2.Empty.FromString, ) self.GetOutput = channel.unary_unary( '/L3Centralizedattackdetector/GetOutput', request_serializer=l3__centralizedattackdetector__pb2.Empty.SerializeToString, - response_deserializer=l3__centralizedattackdetector__pb2.ModelOutput.FromString, + response_deserializer=l3__centralizedattackdetector__pb2.L3CentralizedattackdetectorModelOutput.FromString, ) @@ -48,13 +48,13 @@ def add_L3CentralizedattackdetectorServicer_to_server(servicer, server): rpc_method_handlers = { 'SendInput': grpc.unary_unary_rpc_method_handler( servicer.SendInput, - request_deserializer=l3__centralizedattackdetector__pb2.ModelInput.FromString, + request_deserializer=l3__centralizedattackdetector__pb2.L3CentralizedattackdetectorMetrics.FromString, response_serializer=l3__centralizedattackdetector__pb2.Empty.SerializeToString, ), 'GetOutput': grpc.unary_unary_rpc_method_handler( servicer.GetOutput, request_deserializer=l3__centralizedattackdetector__pb2.Empty.FromString, - response_serializer=l3__centralizedattackdetector__pb2.ModelOutput.SerializeToString, + response_serializer=l3__centralizedattackdetector__pb2.L3CentralizedattackdetectorModelOutput.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( @@ -78,7 +78,7 @@ class L3Centralizedattackdetector(object): timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/L3Centralizedattackdetector/SendInput', - l3__centralizedattackdetector__pb2.ModelInput.SerializeToString, + l3__centralizedattackdetector__pb2.L3CentralizedattackdetectorMetrics.SerializeToString, l3__centralizedattackdetector__pb2.Empty.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @@ -96,6 +96,6 @@ class L3Centralizedattackdetector(object): metadata=None): return grpc.experimental.unary_unary(request, target, '/L3Centralizedattackdetector/GetOutput', l3__centralizedattackdetector__pb2.Empty.SerializeToString, - l3__centralizedattackdetector__pb2.ModelOutput.FromString, + l3__centralizedattackdetector__pb2.L3CentralizedattackdetectorModelOutput.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/src/monitoring/.gitlab-ci.yml b/src/monitoring/.gitlab-ci.yml index f715417765de6d7517f2430e9bf3a2a9937fa8d6..61aec5fb3b29b40bc413a5d9a6452086d0005dce 100644 --- a/src/monitoring/.gitlab-ci.yml +++ b/src/monitoring/.gitlab-ci.yml @@ -58,7 +58,6 @@ unit test monitoring: - docker ps -a - docker logs $IMAGE_NAME - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml" - - docker exec -i $IMAGE_NAME bash -c "coverage xml -o /opt/results/${IMAGE_NAME}_coverage.xml" - docker exec -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing" coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' after_script: @@ -79,7 +78,6 @@ unit test monitoring: when: always reports: junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml - cobertura: src/$IMAGE_NAME/tests/${IMAGE_NAME}_coverage.xml # Deployment of the service in Kubernetes Cluster deploy monitoring: diff --git a/src/monitoring/Dockerfile b/src/monitoring/Dockerfile index c1bba549eaaf5cfaaacd16d01a9d2204bc09c393..ca18929f18816176a503126f43514b7ef32a3a12 100644 --- a/src/monitoring/Dockerfile +++ b/src/monitoring/Dockerfile @@ -39,8 +39,6 @@ RUN mkdir -p /var/teraflow/common RUN mkdir -p /var/teraflow/common/tools RUN mkdir -p /var/teraflow/common/rpc_method_wrapper RUN mkdir -p /var/teraflow/device -RUN mkdir -p /var/teraflow/device/proto -RUN mkdir -p /var/teraflow/device/client RUN mkdir -p /var/teraflow/context # Get Python packages per module @@ -50,11 +48,9 @@ RUN python3 -m pip install -r requirements.txt # add files into working directory COPY monitoring/. monitoring -COPY device/proto/. device/proto -COPY device/client/. device/client -COPY device/Config.py device COPY common/. common COPY context/. context +COPY device/. device RUN rm -r common/message_broker/tests RUN rm -r common/orm/tests diff --git a/src/monitoring/client/MonitoringClient.py b/src/monitoring/client/MonitoringClient.py new file mode 100644 index 0000000000000000000000000000000000000000..d8b39b8bf8d0ae84da19fa651da00633486e6bc6 --- /dev/null +++ b/src/monitoring/client/MonitoringClient.py @@ -0,0 +1,99 @@ +# 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. + +import grpc, logging +from typing import Iterator +from common.Constants import ServiceNameEnum +from common.Settings import get_service_host, get_service_port_grpc +from common.tools.client.RetryDecorator import retry, delay_exponential +from common.tools.grpc.Tools import grpc_message_to_json_string +from monitoring.proto.context_pb2 import Empty +from monitoring.proto.monitoring_pb2 import Kpi, KpiDescriptor, KpiId, MonitorKpiRequest +from monitoring.proto.monitoring_pb2_grpc import MonitoringServiceStub + +LOGGER = logging.getLogger(__name__) +MAX_RETRIES = 15 +DELAY_FUNCTION = delay_exponential(initial=0.01, increment=2.0, maximum=5.0) +RETRY_DECORATOR = retry(max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + +class MonitoringClient: + def __init__(self, host=None, port=None): + if not host: host = get_service_host(ServiceNameEnum.MONITORING) + if not port: port = get_service_port_grpc(ServiceNameEnum.MONITORING) + self.endpoint = '{:s}:{:s}'.format(str(host), str(port)) + LOGGER.debug('Creating channel to {:s}...'.format(str(self.endpoint))) + self.channel = None + self.stub = None + self.connect() + LOGGER.debug('Channel created') + + def connect(self): + self.channel = grpc.insecure_channel(self.endpoint) + self.stub = MonitoringServiceStub(self.channel) + + def close(self): + if self.channel is not None: self.channel.close() + self.channel = None + self.stub = None + + @RETRY_DECORATOR + def CreateKpi(self, request : KpiDescriptor) -> KpiId: + LOGGER.debug('CreateKpi: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.CreateKpi(request) + LOGGER.debug('CreateKpi result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def GetKpiDescriptor(self, request : KpiId) -> KpiDescriptor: + LOGGER.debug('GetKpiDescriptor: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.GetKpiDescriptor(request) + LOGGER.debug('GetKpiDescriptor result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def IncludeKpi(self, request : Kpi) -> Empty: + LOGGER.debug('IncludeKpi: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.IncludeKpi(request) + LOGGER.debug('IncludeKpi result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def MonitorKpi(self, request : MonitorKpiRequest) -> Empty: + LOGGER.debug('MonitorKpi: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.MonitorKpi(request) + LOGGER.debug('MonitorKpi result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def GetStreamKpi(self, request : KpiId) -> Iterator[Kpi]: + LOGGER.debug('GetStreamKpi: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.GetStreamKpi(request) + LOGGER.debug('GetStreamKpi result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def GetInstantKpi(self, request : KpiId) -> Kpi: + LOGGER.debug('GetInstantKpi: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.GetInstantKpi(request) + LOGGER.debug('GetInstantKpi result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + +if __name__ == '__main__': + import sys + # get port + _port = sys.argv[1] if len(sys.argv) > 1 else '7070' + + # make call to server + client = MonitoringClient(port=_port) diff --git a/src/monitoring/client/monitoring_client.py b/src/monitoring/client/monitoring_client.py deleted file mode 100644 index 62bfb519e7649427cad5b8f9e3bc0f849a9b9a39..0000000000000000000000000000000000000000 --- a/src/monitoring/client/monitoring_client.py +++ /dev/null @@ -1,75 +0,0 @@ -# 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. - -import sys -import grpc - -from monitoring.proto import monitoring_pb2 -from monitoring.proto import monitoring_pb2_grpc -from monitoring.proto import context_pb2 - -from common.logger import getJSONLogger -LOGGER = getJSONLogger('monitoring-client') -LOGGER.setLevel('DEBUG') - -class MonitoringClient: - - def __init__(self, server='monitoring', port='7070'): - endpoint = '{}:{}'.format(server, port) - LOGGER.info('init monitoringClient {}'.format(endpoint)) - self.channel = grpc.insecure_channel(endpoint) - self.server = monitoring_pb2_grpc.MonitoringServiceStub(self.channel) - - def CreateKpi(self, request): - LOGGER.info('CreateKpi: {}'.format(request)) - response = self.server.CreateKpi(request) - LOGGER.info('CreateKpi result: {}'.format(response)) - return response - - def MonitorKpi(self, request): - LOGGER.info('MonitorKpi: {}'.format(request)) - response = self.server.MonitorKpi(request) - LOGGER.info('MonitorKpi result: {}'.format(response)) - return response - - def IncludeKpi(self, request): - LOGGER.info('IncludeKpi: {}'.format(request)) - response = self.server.IncludeKpi(request) - LOGGER.info('IncludeKpi result: {}'.format(response)) - return response - - def GetStreamKpi(self, request): - LOGGER.info('GetStreamKpi: {}'.format(request)) - response = self.server.GetStreamKpi(request) - LOGGER.info('GetStreamKpi result: {}'.format(response)) - yield monitoring_pb2.Kpi() - - def GetInstantKpi(self, request): - LOGGER.info('GetInstantKpi: {}'.format(request)) - response = self.server.GetInstantKpi(request) - LOGGER.info('GetInstantKpi result: {}'.format(response)) - return monitoring_pb2.Kpi() - - def GetKpiDescriptor(self, request): - LOGGER.info('GetKpiDescriptor: {}'.format(request)) - response = self.server.GetKpiDescriptor(request) - LOGGER.info('GetKpiDescriptor result: {}'.format(response)) - return response - -if __name__ == '__main__': - # get port - port = sys.argv[1] if len(sys.argv) > 1 else '7070' - - # make call to server - client = MonitoringClient(port=port) diff --git a/src/monitoring/genproto.sh b/src/monitoring/genproto.sh index b37b49ba2078301d837610d10c10b9a095bec783..793e40ad2b411b6bc843e58f0a0e0ad6441b5e4a 100755 --- a/src/monitoring/genproto.sh +++ b/src/monitoring/genproto.sh @@ -1,6 +1,6 @@ #!/bin/bash -eu # -# Copyright 2018 Google LLC +# 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. @@ -19,7 +19,22 @@ cd $(dirname $0) rm -rf proto/*.py rm -rf proto/__pycache__ -touch proto/__init__.py +tee proto/__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 python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto monitoring.proto python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto context.proto diff --git a/src/monitoring/proto/context_pb2.py b/src/monitoring/proto/context_pb2.py index 68602b16f264ceac9acc3ef6669b09d5984e72c2..50d501d3ac053ad644554331af26e3c40cd426a1 100644 --- a/src/monitoring/proto/context_pb2.py +++ b/src/monitoring/proto/context_pb2.py @@ -21,7 +21,7 @@ DESCRIPTOR = _descriptor.FileDescriptor( syntax='proto3', serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\rcontext.proto\x12\x07\x63ontext\x1a\x16kpi_sample_types.proto\"\x07\n\x05\x45mpty\"\x14\n\x04Uuid\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"F\n\x05\x45vent\x12\x11\n\ttimestamp\x18\x01 \x01(\x01\x12*\n\nevent_type\x18\x02 \x01(\x0e\x32\x16.context.EventTypeEnum\"0\n\tContextId\x12#\n\x0c\x63ontext_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xb6\x01\n\x07\x43ontext\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12)\n\x0ctopology_ids\x18\x02 \x03(\x0b\x32\x13.context.TopologyId\x12\'\n\x0bservice_ids\x18\x03 \x03(\x0b\x32\x12.context.ServiceId\x12/\n\ncontroller\x18\x04 \x01(\x0b\x32\x1b.context.TeraFlowController\"8\n\rContextIdList\x12\'\n\x0b\x63ontext_ids\x18\x01 \x03(\x0b\x32\x12.context.ContextId\"1\n\x0b\x43ontextList\x12\"\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32\x10.context.Context\"U\n\x0c\x43ontextEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\ncontext_id\x18\x02 \x01(\x0b\x32\x12.context.ContextId\"Z\n\nTopologyId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12$\n\rtopology_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"~\n\x08Topology\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12%\n\ndevice_ids\x18\x02 \x03(\x0b\x32\x11.context.DeviceId\x12!\n\x08link_ids\x18\x03 \x03(\x0b\x32\x0f.context.LinkId\";\n\x0eTopologyIdList\x12)\n\x0ctopology_ids\x18\x01 \x03(\x0b\x32\x13.context.TopologyId\"5\n\x0cTopologyList\x12%\n\ntopologies\x18\x01 \x03(\x0b\x32\x11.context.Topology\"X\n\rTopologyEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12(\n\x0btopology_id\x18\x02 \x01(\x0b\x32\x13.context.TopologyId\".\n\x08\x44\x65viceId\x12\"\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x9a\x02\n\x06\x44\x65vice\x12$\n\tdevice_id\x18\x01 \x01(\x0b\x32\x11.context.DeviceId\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12,\n\rdevice_config\x18\x03 \x01(\x0b\x32\x15.context.DeviceConfig\x12G\n\x19\x64\x65vice_operational_status\x18\x04 \x01(\x0e\x32$.context.DeviceOperationalStatusEnum\x12\x31\n\x0e\x64\x65vice_drivers\x18\x05 \x03(\x0e\x32\x19.context.DeviceDriverEnum\x12+\n\x10\x64\x65vice_endpoints\x18\x06 \x03(\x0b\x32\x11.context.EndPoint\"9\n\x0c\x44\x65viceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"5\n\x0c\x44\x65viceIdList\x12%\n\ndevice_ids\x18\x01 \x03(\x0b\x32\x11.context.DeviceId\".\n\nDeviceList\x12 \n\x07\x64\x65vices\x18\x01 \x03(\x0b\x32\x0f.context.Device\"R\n\x0b\x44\x65viceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"*\n\x06LinkId\x12 \n\tlink_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"X\n\x04Link\x12 \n\x07link_id\x18\x01 \x01(\x0b\x32\x0f.context.LinkId\x12.\n\x11link_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\"/\n\nLinkIdList\x12!\n\x08link_ids\x18\x01 \x03(\x0b\x32\x0f.context.LinkId\"(\n\x08LinkList\x12\x1c\n\x05links\x18\x01 \x03(\x0b\x32\r.context.Link\"L\n\tLinkEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12 \n\x07link_id\x18\x02 \x01(\x0b\x32\x0f.context.LinkId\"X\n\tServiceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12#\n\x0cservice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\xa6\x02\n\x07Service\x12&\n\nservice_id\x18\x01 \x01(\x0b\x32\x12.context.ServiceId\x12.\n\x0cservice_type\x18\x02 \x01(\x0e\x32\x18.context.ServiceTypeEnum\x12\x31\n\x14service_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12\x30\n\x13service_constraints\x18\x04 \x03(\x0b\x32\x13.context.Constraint\x12.\n\x0eservice_status\x18\x05 \x01(\x0b\x32\x16.context.ServiceStatus\x12.\n\x0eservice_config\x18\x06 \x01(\x0b\x32\x16.context.ServiceConfig\"C\n\rServiceStatus\x12\x32\n\x0eservice_status\x18\x01 \x01(\x0e\x32\x1a.context.ServiceStatusEnum\":\n\rServiceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"8\n\rServiceIdList\x12\'\n\x0bservice_ids\x18\x01 \x03(\x0b\x32\x12.context.ServiceId\"1\n\x0bServiceList\x12\"\n\x08services\x18\x01 \x03(\x0b\x32\x10.context.Service\"U\n\x0cServiceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\"6\n\x0c\x43onnectionId\x12&\n\x0f\x63onnection_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xc4\x01\n\nConnection\x12,\n\rconnection_id\x18\x01 \x01(\x0b\x32\x15.context.ConnectionId\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\x12\x33\n\x16path_hops_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12+\n\x0fsub_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\"A\n\x10\x43onnectionIdList\x12-\n\x0e\x63onnection_ids\x18\x01 \x03(\x0b\x32\x15.context.ConnectionId\":\n\x0e\x43onnectionList\x12(\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x13.context.Connection\"^\n\x0f\x43onnectionEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12,\n\rconnection_id\x18\x02 \x01(\x0b\x32\x15.context.ConnectionId\"\x82\x01\n\nEndPointId\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\x12$\n\rendpoint_uuid\x18\x03 \x01(\x0b\x32\r.context.Uuid\"\x86\x01\n\x08\x45ndPoint\x12(\n\x0b\x65ndpoint_id\x18\x01 \x01(\x0b\x32\x13.context.EndPointId\x12\x15\n\rendpoint_type\x18\x02 \x01(\t\x12\x39\n\x10kpi_sample_types\x18\x03 \x03(\x0e\x32\x1f.kpi_sample_types.KpiSampleType\"e\n\nConfigRule\x12)\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x19.context.ConfigActionEnum\x12\x14\n\x0cresource_key\x18\x02 \x01(\t\x12\x16\n\x0eresource_value\x18\x03 \x01(\t\"?\n\nConstraint\x12\x17\n\x0f\x63onstraint_type\x18\x01 \x01(\t\x12\x18\n\x10\x63onstraint_value\x18\x02 \x01(\t\"^\n\x12TeraFlowController\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x12\n\nip_address\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\"U\n\x14\x41uthenticationResult\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x15\n\rauthenticated\x18\x02 \x01(\x08*j\n\rEventTypeEnum\x12\x17\n\x13\x45VENTTYPE_UNDEFINED\x10\x00\x12\x14\n\x10\x45VENTTYPE_CREATE\x10\x01\x12\x14\n\x10\x45VENTTYPE_UPDATE\x10\x02\x12\x14\n\x10\x45VENTTYPE_REMOVE\x10\x03*\xc5\x01\n\x10\x44\x65viceDriverEnum\x12\x1a\n\x16\x44\x45VICEDRIVER_UNDEFINED\x10\x00\x12\x1b\n\x17\x44\x45VICEDRIVER_OPENCONFIG\x10\x01\x12\x1e\n\x1a\x44\x45VICEDRIVER_TRANSPORT_API\x10\x02\x12\x13\n\x0f\x44\x45VICEDRIVER_P4\x10\x03\x12&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOGY\x10\x04\x12\x1b\n\x17\x44\x45VICEDRIVER_ONF_TR_352\x10\x05*\x8f\x01\n\x1b\x44\x65viceOperationalStatusEnum\x12%\n!DEVICEOPERATIONALSTATUS_UNDEFINED\x10\x00\x12$\n DEVICEOPERATIONALSTATUS_DISABLED\x10\x01\x12#\n\x1f\x44\x45VICEOPERATIONALSTATUS_ENABLED\x10\x02*\x81\x01\n\x0fServiceTypeEnum\x12\x17\n\x13SERVICETYPE_UNKNOWN\x10\x00\x12\x14\n\x10SERVICETYPE_L3NM\x10\x01\x12\x14\n\x10SERVICETYPE_L2NM\x10\x02\x12)\n%SERVICETYPE_TAPI_CONNECTIVITY_SERVICE\x10\x03*\x88\x01\n\x11ServiceStatusEnum\x12\x1b\n\x17SERVICESTATUS_UNDEFINED\x10\x00\x12\x19\n\x15SERVICESTATUS_PLANNED\x10\x01\x12\x18\n\x14SERVICESTATUS_ACTIVE\x10\x02\x12!\n\x1dSERVICESTATUS_PENDING_REMOVAL\x10\x03*]\n\x10\x43onfigActionEnum\x12\x1a\n\x16\x43ONFIGACTION_UNDEFINED\x10\x00\x12\x14\n\x10\x43ONFIGACTION_SET\x10\x01\x12\x17\n\x13\x43ONFIGACTION_DELETE\x10\x02\x32\xad\x10\n\x0e\x43ontextService\x12:\n\x0eListContextIds\x12\x0e.context.Empty\x1a\x16.context.ContextIdList\"\x00\x12\x36\n\x0cListContexts\x12\x0e.context.Empty\x1a\x14.context.ContextList\"\x00\x12\x34\n\nGetContext\x12\x12.context.ContextId\x1a\x10.context.Context\"\x00\x12\x34\n\nSetContext\x12\x10.context.Context\x1a\x12.context.ContextId\"\x00\x12\x35\n\rRemoveContext\x12\x12.context.ContextId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetContextEvents\x12\x0e.context.Empty\x1a\x15.context.ContextEvent\"\x00\x30\x01\x12@\n\x0fListTopologyIds\x12\x12.context.ContextId\x1a\x17.context.TopologyIdList\"\x00\x12=\n\x0eListTopologies\x12\x12.context.ContextId\x1a\x15.context.TopologyList\"\x00\x12\x37\n\x0bGetTopology\x12\x13.context.TopologyId\x1a\x11.context.Topology\"\x00\x12\x37\n\x0bSetTopology\x12\x11.context.Topology\x1a\x13.context.TopologyId\"\x00\x12\x37\n\x0eRemoveTopology\x12\x13.context.TopologyId\x1a\x0e.context.Empty\"\x00\x12?\n\x11GetTopologyEvents\x12\x0e.context.Empty\x1a\x16.context.TopologyEvent\"\x00\x30\x01\x12\x38\n\rListDeviceIds\x12\x0e.context.Empty\x1a\x15.context.DeviceIdList\"\x00\x12\x34\n\x0bListDevices\x12\x0e.context.Empty\x1a\x13.context.DeviceList\"\x00\x12\x31\n\tGetDevice\x12\x11.context.DeviceId\x1a\x0f.context.Device\"\x00\x12\x31\n\tSetDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0cRemoveDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x12;\n\x0fGetDeviceEvents\x12\x0e.context.Empty\x1a\x14.context.DeviceEvent\"\x00\x30\x01\x12\x34\n\x0bListLinkIds\x12\x0e.context.Empty\x1a\x13.context.LinkIdList\"\x00\x12\x30\n\tListLinks\x12\x0e.context.Empty\x1a\x11.context.LinkList\"\x00\x12+\n\x07GetLink\x12\x0f.context.LinkId\x1a\r.context.Link\"\x00\x12+\n\x07SetLink\x12\r.context.Link\x1a\x0f.context.LinkId\"\x00\x12/\n\nRemoveLink\x12\x0f.context.LinkId\x1a\x0e.context.Empty\"\x00\x12\x37\n\rGetLinkEvents\x12\x0e.context.Empty\x1a\x12.context.LinkEvent\"\x00\x30\x01\x12>\n\x0eListServiceIds\x12\x12.context.ContextId\x1a\x16.context.ServiceIdList\"\x00\x12:\n\x0cListServices\x12\x12.context.ContextId\x1a\x14.context.ServiceList\"\x00\x12\x34\n\nGetService\x12\x12.context.ServiceId\x1a\x10.context.Service\"\x00\x12\x34\n\nSetService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rRemoveService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetServiceEvents\x12\x0e.context.Empty\x1a\x15.context.ServiceEvent\"\x00\x30\x01\x12\x44\n\x11ListConnectionIds\x12\x12.context.ServiceId\x1a\x19.context.ConnectionIdList\"\x00\x12@\n\x0fListConnections\x12\x12.context.ServiceId\x1a\x17.context.ConnectionList\"\x00\x12=\n\rGetConnection\x12\x15.context.ConnectionId\x1a\x13.context.Connection\"\x00\x12=\n\rSetConnection\x12\x13.context.Connection\x1a\x15.context.ConnectionId\"\x00\x12;\n\x10RemoveConnection\x12\x15.context.ConnectionId\x1a\x0e.context.Empty\"\x00\x12\x43\n\x13GetConnectionEvents\x12\x0e.context.Empty\x1a\x18.context.ConnectionEvent\"\x00\x30\x01\x62\x06proto3' + serialized_pb=b'\n\rcontext.proto\x12\x07\x63ontext\x1a\x16kpi_sample_types.proto\"\x07\n\x05\x45mpty\"\x14\n\x04Uuid\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"F\n\x05\x45vent\x12\x11\n\ttimestamp\x18\x01 \x01(\x01\x12*\n\nevent_type\x18\x02 \x01(\x0e\x32\x16.context.EventTypeEnum\"0\n\tContextId\x12#\n\x0c\x63ontext_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xb6\x01\n\x07\x43ontext\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12)\n\x0ctopology_ids\x18\x02 \x03(\x0b\x32\x13.context.TopologyId\x12\'\n\x0bservice_ids\x18\x03 \x03(\x0b\x32\x12.context.ServiceId\x12/\n\ncontroller\x18\x04 \x01(\x0b\x32\x1b.context.TeraFlowController\"8\n\rContextIdList\x12\'\n\x0b\x63ontext_ids\x18\x01 \x03(\x0b\x32\x12.context.ContextId\"1\n\x0b\x43ontextList\x12\"\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32\x10.context.Context\"U\n\x0c\x43ontextEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\ncontext_id\x18\x02 \x01(\x0b\x32\x12.context.ContextId\"Z\n\nTopologyId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12$\n\rtopology_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"~\n\x08Topology\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12%\n\ndevice_ids\x18\x02 \x03(\x0b\x32\x11.context.DeviceId\x12!\n\x08link_ids\x18\x03 \x03(\x0b\x32\x0f.context.LinkId\";\n\x0eTopologyIdList\x12)\n\x0ctopology_ids\x18\x01 \x03(\x0b\x32\x13.context.TopologyId\"5\n\x0cTopologyList\x12%\n\ntopologies\x18\x01 \x03(\x0b\x32\x11.context.Topology\"X\n\rTopologyEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12(\n\x0btopology_id\x18\x02 \x01(\x0b\x32\x13.context.TopologyId\".\n\x08\x44\x65viceId\x12\"\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x9a\x02\n\x06\x44\x65vice\x12$\n\tdevice_id\x18\x01 \x01(\x0b\x32\x11.context.DeviceId\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12,\n\rdevice_config\x18\x03 \x01(\x0b\x32\x15.context.DeviceConfig\x12G\n\x19\x64\x65vice_operational_status\x18\x04 \x01(\x0e\x32$.context.DeviceOperationalStatusEnum\x12\x31\n\x0e\x64\x65vice_drivers\x18\x05 \x03(\x0e\x32\x19.context.DeviceDriverEnum\x12+\n\x10\x64\x65vice_endpoints\x18\x06 \x03(\x0b\x32\x11.context.EndPoint\"9\n\x0c\x44\x65viceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"5\n\x0c\x44\x65viceIdList\x12%\n\ndevice_ids\x18\x01 \x03(\x0b\x32\x11.context.DeviceId\".\n\nDeviceList\x12 \n\x07\x64\x65vices\x18\x01 \x03(\x0b\x32\x0f.context.Device\"R\n\x0b\x44\x65viceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"*\n\x06LinkId\x12 \n\tlink_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"X\n\x04Link\x12 \n\x07link_id\x18\x01 \x01(\x0b\x32\x0f.context.LinkId\x12.\n\x11link_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\"/\n\nLinkIdList\x12!\n\x08link_ids\x18\x01 \x03(\x0b\x32\x0f.context.LinkId\"(\n\x08LinkList\x12\x1c\n\x05links\x18\x01 \x03(\x0b\x32\r.context.Link\"L\n\tLinkEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12 \n\x07link_id\x18\x02 \x01(\x0b\x32\x0f.context.LinkId\"X\n\tServiceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12#\n\x0cservice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\xa6\x02\n\x07Service\x12&\n\nservice_id\x18\x01 \x01(\x0b\x32\x12.context.ServiceId\x12.\n\x0cservice_type\x18\x02 \x01(\x0e\x32\x18.context.ServiceTypeEnum\x12\x31\n\x14service_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12\x30\n\x13service_constraints\x18\x04 \x03(\x0b\x32\x13.context.Constraint\x12.\n\x0eservice_status\x18\x05 \x01(\x0b\x32\x16.context.ServiceStatus\x12.\n\x0eservice_config\x18\x06 \x01(\x0b\x32\x16.context.ServiceConfig\"C\n\rServiceStatus\x12\x32\n\x0eservice_status\x18\x01 \x01(\x0e\x32\x1a.context.ServiceStatusEnum\":\n\rServiceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"8\n\rServiceIdList\x12\'\n\x0bservice_ids\x18\x01 \x03(\x0b\x32\x12.context.ServiceId\"1\n\x0bServiceList\x12\"\n\x08services\x18\x01 \x03(\x0b\x32\x10.context.Service\"U\n\x0cServiceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\"T\n\x07SliceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12!\n\nslice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\x95\x02\n\x05Slice\x12\"\n\x08slice_id\x18\x01 \x01(\x0b\x32\x10.context.SliceId\x12/\n\x12slice_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\x12.\n\x11slice_constraints\x18\x03 \x03(\x0b\x32\x13.context.Constraint\x12-\n\x11slice_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\x12,\n\x12slice_subslice_ids\x18\x05 \x03(\x0b\x32\x10.context.SliceId\x12*\n\x0cslice_status\x18\x06 \x01(\x0b\x32\x14.context.SliceStatus\"=\n\x0bSliceStatus\x12.\n\x0cslice_status\x18\x01 \x01(\x0e\x32\x18.context.SliceStatusEnum\"2\n\x0bSliceIdList\x12#\n\tslice_ids\x18\x01 \x03(\x0b\x32\x10.context.SliceId\"+\n\tSliceList\x12\x1e\n\x06slices\x18\x01 \x03(\x0b\x32\x0e.context.Slice\"O\n\nSliceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12\"\n\x08slice_id\x18\x02 \x01(\x0b\x32\x10.context.SliceId\"6\n\x0c\x43onnectionId\x12&\n\x0f\x63onnection_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xc4\x01\n\nConnection\x12,\n\rconnection_id\x18\x01 \x01(\x0b\x32\x15.context.ConnectionId\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\x12\x33\n\x16path_hops_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12+\n\x0fsub_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\"A\n\x10\x43onnectionIdList\x12-\n\x0e\x63onnection_ids\x18\x01 \x03(\x0b\x32\x15.context.ConnectionId\":\n\x0e\x43onnectionList\x12(\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x13.context.Connection\"^\n\x0f\x43onnectionEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12,\n\rconnection_id\x18\x02 \x01(\x0b\x32\x15.context.ConnectionId\"\x82\x01\n\nEndPointId\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\x12$\n\rendpoint_uuid\x18\x03 \x01(\x0b\x32\r.context.Uuid\"\x86\x01\n\x08\x45ndPoint\x12(\n\x0b\x65ndpoint_id\x18\x01 \x01(\x0b\x32\x13.context.EndPointId\x12\x15\n\rendpoint_type\x18\x02 \x01(\t\x12\x39\n\x10kpi_sample_types\x18\x03 \x03(\x0e\x32\x1f.kpi_sample_types.KpiSampleType\"e\n\nConfigRule\x12)\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x19.context.ConfigActionEnum\x12\x14\n\x0cresource_key\x18\x02 \x01(\t\x12\x16\n\x0eresource_value\x18\x03 \x01(\t\"?\n\nConstraint\x12\x17\n\x0f\x63onstraint_type\x18\x01 \x01(\t\x12\x18\n\x10\x63onstraint_value\x18\x02 \x01(\t\"^\n\x12TeraFlowController\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x12\n\nip_address\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\"U\n\x14\x41uthenticationResult\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x15\n\rauthenticated\x18\x02 \x01(\x08*j\n\rEventTypeEnum\x12\x17\n\x13\x45VENTTYPE_UNDEFINED\x10\x00\x12\x14\n\x10\x45VENTTYPE_CREATE\x10\x01\x12\x14\n\x10\x45VENTTYPE_UPDATE\x10\x02\x12\x14\n\x10\x45VENTTYPE_REMOVE\x10\x03*\xc5\x01\n\x10\x44\x65viceDriverEnum\x12\x1a\n\x16\x44\x45VICEDRIVER_UNDEFINED\x10\x00\x12\x1b\n\x17\x44\x45VICEDRIVER_OPENCONFIG\x10\x01\x12\x1e\n\x1a\x44\x45VICEDRIVER_TRANSPORT_API\x10\x02\x12\x13\n\x0f\x44\x45VICEDRIVER_P4\x10\x03\x12&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOGY\x10\x04\x12\x1b\n\x17\x44\x45VICEDRIVER_ONF_TR_352\x10\x05*\x8f\x01\n\x1b\x44\x65viceOperationalStatusEnum\x12%\n!DEVICEOPERATIONALSTATUS_UNDEFINED\x10\x00\x12$\n DEVICEOPERATIONALSTATUS_DISABLED\x10\x01\x12#\n\x1f\x44\x45VICEOPERATIONALSTATUS_ENABLED\x10\x02*\x81\x01\n\x0fServiceTypeEnum\x12\x17\n\x13SERVICETYPE_UNKNOWN\x10\x00\x12\x14\n\x10SERVICETYPE_L3NM\x10\x01\x12\x14\n\x10SERVICETYPE_L2NM\x10\x02\x12)\n%SERVICETYPE_TAPI_CONNECTIVITY_SERVICE\x10\x03*\x88\x01\n\x11ServiceStatusEnum\x12\x1b\n\x17SERVICESTATUS_UNDEFINED\x10\x00\x12\x19\n\x15SERVICESTATUS_PLANNED\x10\x01\x12\x18\n\x14SERVICESTATUS_ACTIVE\x10\x02\x12!\n\x1dSERVICESTATUS_PENDING_REMOVAL\x10\x03*\x8b\x01\n\x0fSliceStatusEnum\x12\x19\n\x15SLICESTATUS_UNDEFINED\x10\x00\x12\x17\n\x13SLICESTATUS_PLANNED\x10\x01\x12\x14\n\x10SLICESTATUS_INIT\x10\x02\x12\x16\n\x12SLICESTATUS_ACTIVE\x10\x03\x12\x16\n\x12SLICESTATUS_DEINIT\x10\x04*]\n\x10\x43onfigActionEnum\x12\x1a\n\x16\x43ONFIGACTION_UNDEFINED\x10\x00\x12\x14\n\x10\x43ONFIGACTION_SET\x10\x01\x12\x17\n\x13\x43ONFIGACTION_DELETE\x10\x02\x32\xef\x12\n\x0e\x43ontextService\x12:\n\x0eListContextIds\x12\x0e.context.Empty\x1a\x16.context.ContextIdList\"\x00\x12\x36\n\x0cListContexts\x12\x0e.context.Empty\x1a\x14.context.ContextList\"\x00\x12\x34\n\nGetContext\x12\x12.context.ContextId\x1a\x10.context.Context\"\x00\x12\x34\n\nSetContext\x12\x10.context.Context\x1a\x12.context.ContextId\"\x00\x12\x35\n\rRemoveContext\x12\x12.context.ContextId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetContextEvents\x12\x0e.context.Empty\x1a\x15.context.ContextEvent\"\x00\x30\x01\x12@\n\x0fListTopologyIds\x12\x12.context.ContextId\x1a\x17.context.TopologyIdList\"\x00\x12=\n\x0eListTopologies\x12\x12.context.ContextId\x1a\x15.context.TopologyList\"\x00\x12\x37\n\x0bGetTopology\x12\x13.context.TopologyId\x1a\x11.context.Topology\"\x00\x12\x37\n\x0bSetTopology\x12\x11.context.Topology\x1a\x13.context.TopologyId\"\x00\x12\x37\n\x0eRemoveTopology\x12\x13.context.TopologyId\x1a\x0e.context.Empty\"\x00\x12?\n\x11GetTopologyEvents\x12\x0e.context.Empty\x1a\x16.context.TopologyEvent\"\x00\x30\x01\x12\x38\n\rListDeviceIds\x12\x0e.context.Empty\x1a\x15.context.DeviceIdList\"\x00\x12\x34\n\x0bListDevices\x12\x0e.context.Empty\x1a\x13.context.DeviceList\"\x00\x12\x31\n\tGetDevice\x12\x11.context.DeviceId\x1a\x0f.context.Device\"\x00\x12\x31\n\tSetDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0cRemoveDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x12;\n\x0fGetDeviceEvents\x12\x0e.context.Empty\x1a\x14.context.DeviceEvent\"\x00\x30\x01\x12\x34\n\x0bListLinkIds\x12\x0e.context.Empty\x1a\x13.context.LinkIdList\"\x00\x12\x30\n\tListLinks\x12\x0e.context.Empty\x1a\x11.context.LinkList\"\x00\x12+\n\x07GetLink\x12\x0f.context.LinkId\x1a\r.context.Link\"\x00\x12+\n\x07SetLink\x12\r.context.Link\x1a\x0f.context.LinkId\"\x00\x12/\n\nRemoveLink\x12\x0f.context.LinkId\x1a\x0e.context.Empty\"\x00\x12\x37\n\rGetLinkEvents\x12\x0e.context.Empty\x1a\x12.context.LinkEvent\"\x00\x30\x01\x12>\n\x0eListServiceIds\x12\x12.context.ContextId\x1a\x16.context.ServiceIdList\"\x00\x12:\n\x0cListServices\x12\x12.context.ContextId\x1a\x14.context.ServiceList\"\x00\x12\x34\n\nGetService\x12\x12.context.ServiceId\x1a\x10.context.Service\"\x00\x12\x34\n\nSetService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rRemoveService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetServiceEvents\x12\x0e.context.Empty\x1a\x15.context.ServiceEvent\"\x00\x30\x01\x12:\n\x0cListSliceIds\x12\x12.context.ContextId\x1a\x14.context.SliceIdList\"\x00\x12\x36\n\nListSlices\x12\x12.context.ContextId\x1a\x12.context.SliceList\"\x00\x12.\n\x08GetSlice\x12\x10.context.SliceId\x1a\x0e.context.Slice\"\x00\x12.\n\x08SetSlice\x12\x0e.context.Slice\x1a\x10.context.SliceId\"\x00\x12\x31\n\x0bRemoveSlice\x12\x10.context.SliceId\x1a\x0e.context.Empty\"\x00\x12\x39\n\x0eGetSliceEvents\x12\x0e.context.Empty\x1a\x13.context.SliceEvent\"\x00\x30\x01\x12\x44\n\x11ListConnectionIds\x12\x12.context.ServiceId\x1a\x19.context.ConnectionIdList\"\x00\x12@\n\x0fListConnections\x12\x12.context.ServiceId\x1a\x17.context.ConnectionList\"\x00\x12=\n\rGetConnection\x12\x15.context.ConnectionId\x1a\x13.context.Connection\"\x00\x12=\n\rSetConnection\x12\x13.context.Connection\x1a\x15.context.ConnectionId\"\x00\x12;\n\x10RemoveConnection\x12\x15.context.ConnectionId\x1a\x0e.context.Empty\"\x00\x12\x43\n\x13GetConnectionEvents\x12\x0e.context.Empty\x1a\x18.context.ConnectionEvent\"\x00\x30\x01\x62\x06proto3' , dependencies=[kpi__sample__types__pb2.DESCRIPTOR,]) @@ -55,8 +55,8 @@ _EVENTTYPEENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=3703, - serialized_end=3809, + serialized_start=4310, + serialized_end=4416, ) _sym_db.RegisterEnumDescriptor(_EVENTTYPEENUM) @@ -101,8 +101,8 @@ _DEVICEDRIVERENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=3812, - serialized_end=4009, + serialized_start=4419, + serialized_end=4616, ) _sym_db.RegisterEnumDescriptor(_DEVICEDRIVERENUM) @@ -132,8 +132,8 @@ _DEVICEOPERATIONALSTATUSENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4012, - serialized_end=4155, + serialized_start=4619, + serialized_end=4762, ) _sym_db.RegisterEnumDescriptor(_DEVICEOPERATIONALSTATUSENUM) @@ -168,8 +168,8 @@ _SERVICETYPEENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4158, - serialized_end=4287, + serialized_start=4765, + serialized_end=4894, ) _sym_db.RegisterEnumDescriptor(_SERVICETYPEENUM) @@ -204,12 +204,53 @@ _SERVICESTATUSENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4290, - serialized_end=4426, + serialized_start=4897, + serialized_end=5033, ) _sym_db.RegisterEnumDescriptor(_SERVICESTATUSENUM) ServiceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICESTATUSENUM) +_SLICESTATUSENUM = _descriptor.EnumDescriptor( + name='SliceStatusEnum', + full_name='context.SliceStatusEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_PLANNED', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_INIT', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_ACTIVE', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_DEINIT', index=4, number=4, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=5036, + serialized_end=5175, +) +_sym_db.RegisterEnumDescriptor(_SLICESTATUSENUM) + +SliceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SLICESTATUSENUM) _CONFIGACTIONENUM = _descriptor.EnumDescriptor( name='ConfigActionEnum', full_name='context.ConfigActionEnum', @@ -235,8 +276,8 @@ _CONFIGACTIONENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4428, - serialized_end=4521, + serialized_start=5177, + serialized_end=5270, ) _sym_db.RegisterEnumDescriptor(_CONFIGACTIONENUM) @@ -262,6 +303,11 @@ SERVICESTATUS_UNDEFINED = 0 SERVICESTATUS_PLANNED = 1 SERVICESTATUS_ACTIVE = 2 SERVICESTATUS_PENDING_REMOVAL = 3 +SLICESTATUS_UNDEFINED = 0 +SLICESTATUS_PLANNED = 1 +SLICESTATUS_INIT = 2 +SLICESTATUS_ACTIVE = 3 +SLICESTATUS_DEINIT = 4 CONFIGACTION_UNDEFINED = 0 CONFIGACTION_SET = 1 CONFIGACTION_DELETE = 2 @@ -1421,6 +1467,247 @@ _SERVICEEVENT = _descriptor.Descriptor( ) +_SLICEID = _descriptor.Descriptor( + name='SliceId', + full_name='context.SliceId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_id', full_name='context.SliceId.context_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_uuid', full_name='context.SliceId.slice_uuid', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2604, + serialized_end=2688, +) + + +_SLICE = _descriptor.Descriptor( + name='Slice', + full_name='context.Slice', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_id', full_name='context.Slice.slice_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_endpoint_ids', full_name='context.Slice.slice_endpoint_ids', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_constraints', full_name='context.Slice.slice_constraints', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_service_ids', full_name='context.Slice.slice_service_ids', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_subslice_ids', full_name='context.Slice.slice_subslice_ids', index=4, + number=5, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_status', full_name='context.Slice.slice_status', index=5, + number=6, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2691, + serialized_end=2968, +) + + +_SLICESTATUS = _descriptor.Descriptor( + name='SliceStatus', + full_name='context.SliceStatus', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_status', full_name='context.SliceStatus.slice_status', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2970, + serialized_end=3031, +) + + +_SLICEIDLIST = _descriptor.Descriptor( + name='SliceIdList', + full_name='context.SliceIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_ids', full_name='context.SliceIdList.slice_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3033, + serialized_end=3083, +) + + +_SLICELIST = _descriptor.Descriptor( + name='SliceList', + full_name='context.SliceList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slices', full_name='context.SliceList.slices', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3085, + serialized_end=3128, +) + + +_SLICEEVENT = _descriptor.Descriptor( + name='SliceEvent', + full_name='context.SliceEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.SliceEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_id', full_name='context.SliceEvent.slice_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3130, + serialized_end=3209, +) + + _CONNECTIONID = _descriptor.Descriptor( name='ConnectionId', full_name='context.ConnectionId', @@ -1448,8 +1735,8 @@ _CONNECTIONID = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2604, - serialized_end=2658, + serialized_start=3211, + serialized_end=3265, ) @@ -1501,8 +1788,8 @@ _CONNECTION = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2661, - serialized_end=2857, + serialized_start=3268, + serialized_end=3464, ) @@ -1533,8 +1820,8 @@ _CONNECTIONIDLIST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2859, - serialized_end=2924, + serialized_start=3466, + serialized_end=3531, ) @@ -1565,8 +1852,8 @@ _CONNECTIONLIST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2926, - serialized_end=2984, + serialized_start=3533, + serialized_end=3591, ) @@ -1604,8 +1891,8 @@ _CONNECTIONEVENT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2986, - serialized_end=3080, + serialized_start=3593, + serialized_end=3687, ) @@ -1650,8 +1937,8 @@ _ENDPOINTID = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3083, - serialized_end=3213, + serialized_start=3690, + serialized_end=3820, ) @@ -1696,8 +1983,8 @@ _ENDPOINT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3216, - serialized_end=3350, + serialized_start=3823, + serialized_end=3957, ) @@ -1742,8 +2029,8 @@ _CONFIGRULE = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3352, - serialized_end=3453, + serialized_start=3959, + serialized_end=4060, ) @@ -1781,8 +2068,8 @@ _CONSTRAINT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3455, - serialized_end=3518, + serialized_start=4062, + serialized_end=4125, ) @@ -1827,8 +2114,8 @@ _TERAFLOWCONTROLLER = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3520, - serialized_end=3614, + serialized_start=4127, + serialized_end=4221, ) @@ -1866,8 +2153,8 @@ _AUTHENTICATIONRESULT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3616, - serialized_end=3701, + serialized_start=4223, + serialized_end=4308, ) _EVENT.fields_by_name['event_type'].enum_type = _EVENTTYPEENUM @@ -1921,6 +2208,19 @@ _SERVICEIDLIST.fields_by_name['service_ids'].message_type = _SERVICEID _SERVICELIST.fields_by_name['services'].message_type = _SERVICE _SERVICEEVENT.fields_by_name['event'].message_type = _EVENT _SERVICEEVENT.fields_by_name['service_id'].message_type = _SERVICEID +_SLICEID.fields_by_name['context_id'].message_type = _CONTEXTID +_SLICEID.fields_by_name['slice_uuid'].message_type = _UUID +_SLICE.fields_by_name['slice_id'].message_type = _SLICEID +_SLICE.fields_by_name['slice_endpoint_ids'].message_type = _ENDPOINTID +_SLICE.fields_by_name['slice_constraints'].message_type = _CONSTRAINT +_SLICE.fields_by_name['slice_service_ids'].message_type = _SERVICEID +_SLICE.fields_by_name['slice_subslice_ids'].message_type = _SLICEID +_SLICE.fields_by_name['slice_status'].message_type = _SLICESTATUS +_SLICESTATUS.fields_by_name['slice_status'].enum_type = _SLICESTATUSENUM +_SLICEIDLIST.fields_by_name['slice_ids'].message_type = _SLICEID +_SLICELIST.fields_by_name['slices'].message_type = _SLICE +_SLICEEVENT.fields_by_name['event'].message_type = _EVENT +_SLICEEVENT.fields_by_name['slice_id'].message_type = _SLICEID _CONNECTIONID.fields_by_name['connection_uuid'].message_type = _UUID _CONNECTION.fields_by_name['connection_id'].message_type = _CONNECTIONID _CONNECTION.fields_by_name['service_id'].message_type = _SERVICEID @@ -1969,6 +2269,12 @@ DESCRIPTOR.message_types_by_name['ServiceConfig'] = _SERVICECONFIG DESCRIPTOR.message_types_by_name['ServiceIdList'] = _SERVICEIDLIST DESCRIPTOR.message_types_by_name['ServiceList'] = _SERVICELIST DESCRIPTOR.message_types_by_name['ServiceEvent'] = _SERVICEEVENT +DESCRIPTOR.message_types_by_name['SliceId'] = _SLICEID +DESCRIPTOR.message_types_by_name['Slice'] = _SLICE +DESCRIPTOR.message_types_by_name['SliceStatus'] = _SLICESTATUS +DESCRIPTOR.message_types_by_name['SliceIdList'] = _SLICEIDLIST +DESCRIPTOR.message_types_by_name['SliceList'] = _SLICELIST +DESCRIPTOR.message_types_by_name['SliceEvent'] = _SLICEEVENT DESCRIPTOR.message_types_by_name['ConnectionId'] = _CONNECTIONID DESCRIPTOR.message_types_by_name['Connection'] = _CONNECTION DESCRIPTOR.message_types_by_name['ConnectionIdList'] = _CONNECTIONIDLIST @@ -1985,6 +2291,7 @@ DESCRIPTOR.enum_types_by_name['DeviceDriverEnum'] = _DEVICEDRIVERENUM DESCRIPTOR.enum_types_by_name['DeviceOperationalStatusEnum'] = _DEVICEOPERATIONALSTATUSENUM DESCRIPTOR.enum_types_by_name['ServiceTypeEnum'] = _SERVICETYPEENUM DESCRIPTOR.enum_types_by_name['ServiceStatusEnum'] = _SERVICESTATUSENUM +DESCRIPTOR.enum_types_by_name['SliceStatusEnum'] = _SLICESTATUSENUM DESCRIPTOR.enum_types_by_name['ConfigActionEnum'] = _CONFIGACTIONENUM _sym_db.RegisterFileDescriptor(DESCRIPTOR) @@ -2205,6 +2512,48 @@ ServiceEvent = _reflection.GeneratedProtocolMessageType('ServiceEvent', (_messag }) _sym_db.RegisterMessage(ServiceEvent) +SliceId = _reflection.GeneratedProtocolMessageType('SliceId', (_message.Message,), { + 'DESCRIPTOR' : _SLICEID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceId) + }) +_sym_db.RegisterMessage(SliceId) + +Slice = _reflection.GeneratedProtocolMessageType('Slice', (_message.Message,), { + 'DESCRIPTOR' : _SLICE, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Slice) + }) +_sym_db.RegisterMessage(Slice) + +SliceStatus = _reflection.GeneratedProtocolMessageType('SliceStatus', (_message.Message,), { + 'DESCRIPTOR' : _SLICESTATUS, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceStatus) + }) +_sym_db.RegisterMessage(SliceStatus) + +SliceIdList = _reflection.GeneratedProtocolMessageType('SliceIdList', (_message.Message,), { + 'DESCRIPTOR' : _SLICEIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceIdList) + }) +_sym_db.RegisterMessage(SliceIdList) + +SliceList = _reflection.GeneratedProtocolMessageType('SliceList', (_message.Message,), { + 'DESCRIPTOR' : _SLICELIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceList) + }) +_sym_db.RegisterMessage(SliceList) + +SliceEvent = _reflection.GeneratedProtocolMessageType('SliceEvent', (_message.Message,), { + 'DESCRIPTOR' : _SLICEEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceEvent) + }) +_sym_db.RegisterMessage(SliceEvent) + ConnectionId = _reflection.GeneratedProtocolMessageType('ConnectionId', (_message.Message,), { 'DESCRIPTOR' : _CONNECTIONID, '__module__' : 'context_pb2' @@ -2291,8 +2640,8 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( index=0, serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_start=4524, - serialized_end=6617, + serialized_start=5273, + serialized_end=7688, methods=[ _descriptor.MethodDescriptor( name='ListContextIds', @@ -2594,10 +2943,70 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( serialized_options=None, create_key=_descriptor._internal_create_key, ), + _descriptor.MethodDescriptor( + name='ListSliceIds', + full_name='context.ContextService.ListSliceIds', + index=30, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SLICEIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListSlices', + full_name='context.ContextService.ListSlices', + index=31, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SLICELIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetSlice', + full_name='context.ContextService.GetSlice', + index=32, + containing_service=None, + input_type=_SLICEID, + output_type=_SLICE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetSlice', + full_name='context.ContextService.SetSlice', + index=33, + containing_service=None, + input_type=_SLICE, + output_type=_SLICEID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveSlice', + full_name='context.ContextService.RemoveSlice', + index=34, + containing_service=None, + input_type=_SLICEID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetSliceEvents', + full_name='context.ContextService.GetSliceEvents', + index=35, + containing_service=None, + input_type=_EMPTY, + output_type=_SLICEEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), _descriptor.MethodDescriptor( name='ListConnectionIds', full_name='context.ContextService.ListConnectionIds', - index=30, + index=36, containing_service=None, input_type=_SERVICEID, output_type=_CONNECTIONIDLIST, @@ -2607,7 +3016,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='ListConnections', full_name='context.ContextService.ListConnections', - index=31, + index=37, containing_service=None, input_type=_SERVICEID, output_type=_CONNECTIONLIST, @@ -2617,7 +3026,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='GetConnection', full_name='context.ContextService.GetConnection', - index=32, + index=38, containing_service=None, input_type=_CONNECTIONID, output_type=_CONNECTION, @@ -2627,7 +3036,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='SetConnection', full_name='context.ContextService.SetConnection', - index=33, + index=39, containing_service=None, input_type=_CONNECTION, output_type=_CONNECTIONID, @@ -2637,7 +3046,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='RemoveConnection', full_name='context.ContextService.RemoveConnection', - index=34, + index=40, containing_service=None, input_type=_CONNECTIONID, output_type=_EMPTY, @@ -2647,7 +3056,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='GetConnectionEvents', full_name='context.ContextService.GetConnectionEvents', - index=35, + index=41, containing_service=None, input_type=_EMPTY, output_type=_CONNECTIONEVENT, diff --git a/src/monitoring/requirements.in b/src/monitoring/requirements.in index 77b66b79498d6df89a1d3b8989a02c06078eb1b9..4d4f057bdc6b66d699ef1e723b64c05d60f5cc0e 100644 --- a/src/monitoring/requirements.in +++ b/src/monitoring/requirements.in @@ -1,16 +1,25 @@ -google-api-core -grpcio-health-checking -grpcio -opencensus[stackdriver] -python-json-logger -google-cloud-profiler -numpy -prometheus-client -pytest -pytest-benchmark +anytree==2.8.0 +APScheduler==3.8.1 +fastcache==1.1.0 +grpcio==1.43.0 +grpcio-health-checking==1.43.0 +#google-api-core +#opencensus[stackdriver] +#google-cloud-profiler +#numpy +Jinja2==3.0.3 +ncclient==0.6.13 +p4runtime==1.3.0 +paramiko==2.9.2 +prometheus-client==0.13.0 +protobuf==3.19.3 +pytest==6.2.5 +pytest-benchmark==3.4.1 influxdb -redis -anytree -apscheduler -xmltodict -coverage +python-dateutil==2.8.2 +python-json-logger==2.0.2 +pytz==2021.3 +redis==4.1.2 +requests==2.27.1 +xmltodict==0.12.0 +coverage==6.3 diff --git a/src/monitoring/service/EventTools.py b/src/monitoring/service/EventTools.py index 636556425af9ac02487386d81b9d8d4e786aa560..04c06e74203efcd3fab7566b2687dcdfc7e62658 100644 --- a/src/monitoring/service/EventTools.py +++ b/src/monitoring/service/EventTools.py @@ -19,26 +19,27 @@ import grpc from common.rpc_method_wrapper.ServiceExceptions import ServiceException from context.client.ContextClient import ContextClient -from context.proto import kpi_sample_types_pb2 +#from context.proto import kpi_sample_types_pb2 from context.proto.context_pb2 import Empty, EventTypeEnum from common.logger import getJSONLogger -from monitoring.client.monitoring_client import MonitoringClient +from monitoring.client.MonitoringClient import MonitoringClient from monitoring.proto import monitoring_pb2 LOGGER = getJSONLogger('monitoringservice-server') LOGGER.setLevel('DEBUG') class EventsDeviceCollector: - def __init__(self, context_client_grpc : ContextClient, monitoring_client_grpc : MonitoringClient) -> None: # pylint: disable=redefined-outer-name + def __init__(self) -> None: # pylint: disable=redefined-outer-name self._events_queue = Queue() - self._device_stream = context_client_grpc.GetDeviceEvents(Empty()) - self._context_client = context_client_grpc - self._channel = context_client_grpc.channel - self._monitoring_client = monitoring_client_grpc + self._context_client_grpc = ContextClient() + self._device_stream = self._context_client_grpc.GetDeviceEvents(Empty()) + self._context_client = self._context_client_grpc + self._channel = self._context_client_grpc.channel + self._monitoring_client = MonitoringClient(host='127.0.0.1') - self._device_thread = threading.Thread(target=self._collect, args=(self._device_stream ,), daemon=False) + self._device_thread = threading.Thread(target=self._collect, args=(self._device_stream,), daemon=False) def grpc_server_on(self): try: diff --git a/src/monitoring/service/MonitoringService.py b/src/monitoring/service/MonitoringService.py index f1ecba3664dfee74fddb7093ff352724791b4f7d..0736eba435820344750225c28e5b1348c7f7dfbc 100644 --- a/src/monitoring/service/MonitoringService.py +++ b/src/monitoring/service/MonitoringService.py @@ -12,63 +12,17 @@ # See the License for the specific language governing permissions and # limitations under the License. -from concurrent import futures - -import grpc, logging - -from monitoring.service.MonitoringServiceServicerImpl import MonitoringServiceServicerImpl -from monitoring.Config import GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD -from monitoring.proto.monitoring_pb2_grpc import add_MonitoringServiceServicer_to_server - -from grpc_health.v1 import health -from grpc_health.v1 import health_pb2 -from grpc_health.v1.health_pb2_grpc import add_HealthServicer_to_server - -from common.logger import getJSONLogger -LOGGER = getJSONLogger('monitoring-server') - -BIND_ADDRESS = '0.0.0.0' - -class MonitoringService: - def __init__(self, address=BIND_ADDRESS, port=GRPC_SERVICE_PORT, max_workers=GRPC_MAX_WORKERS, - grace_period=GRPC_GRACE_PERIOD): - self.address = address - self.port = port - self.endpoint = None - self.max_workers = max_workers - self.grace_period = grace_period - self.monitoring_servicer = None - self.health_servicer = None - self.pool = None - self.server = None - - def start(self): - # create gRPC server - self.server = grpc.server(futures.ThreadPoolExecutor(max_workers=self.max_workers)) # ,interceptors=(tracer_interceptor,)) - - # add monitoring servicer class to gRPC server +from common.Constants import ServiceNameEnum +from common.Settings import get_service_port_grpc +from common.tools.service.GenericGrpcService import GenericGrpcService +from monitoring.proto.monitoring_pb2_grpc import add_MonitoringServiceServicer_to_server +from .MonitoringServiceServicerImpl import MonitoringServiceServicerImpl + +class MonitoringService(GenericGrpcService): + def __init__(self, cls_name: str = __name__) -> None: + port = get_service_port_grpc(ServiceNameEnum.MONITORING) + super().__init__(port, cls_name=cls_name) self.monitoring_servicer = MonitoringServiceServicerImpl() - add_MonitoringServiceServicer_to_server(self.monitoring_servicer, self.server) - - # add gRPC health checker servicer class to gRPC server - self.health_servicer = health.HealthServicer( - experimental_non_blocking=True, experimental_thread_pool=futures.ThreadPoolExecutor(max_workers=1)) - add_HealthServicer_to_server(self.health_servicer, self.server) - - # start server - self.endpoint = '{:s}:{:s}'.format(str(self.address), str(self.port)) - LOGGER.info('Starting Service (tentative endpoint: {:s}, max_workers: {:s})...'.format( - str(self.endpoint), str(self.max_workers))) - - self.server.add_insecure_port(self.endpoint) - self.server.start() - self.health_servicer.set('', health_pb2.HealthCheckResponse.SERVING) # pylint: disable=maybe-no-member - - LOGGER.debug('Service started') - - def stop(self): - LOGGER.debug('Stopping service (grace period {} seconds)...'.format(self.grace_period)) - self.health_servicer.enter_graceful_shutdown() - self.server.stop(self.grace_period) - LOGGER.debug('Service stopped') + def install_servicers(self): + add_MonitoringServiceServicer_to_server(self.monitoring_servicer, self.server) diff --git a/src/monitoring/service/MonitoringServiceServicerImpl.py b/src/monitoring/service/MonitoringServiceServicerImpl.py index 88cd2d3a83357dec5c49e1894ed4243ceb1b4b6e..28c1ed12045a8d6dfbd9669e8ce2f081248cabd4 100644 --- a/src/monitoring/service/MonitoringServiceServicerImpl.py +++ b/src/monitoring/service/MonitoringServiceServicerImpl.py @@ -12,29 +12,21 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os,grpc, logging -import socket - -from prometheus_client import Summary -from prometheus_client import Counter -from common.Settings import get_setting - -from monitoring.Config import DEVICE_GRPC_SERVICE_PORT, DEVICE_SERVICE_HOST +import os, grpc, logging +from prometheus_client import Counter, Summary from monitoring.proto.kpi_sample_types_pb2 import KpiSampleType from monitoring.service import SqliteTools, InfluxTools from monitoring.proto import monitoring_pb2 from monitoring.proto import monitoring_pb2_grpc - from common.rpc_method_wrapper.ServiceExceptions import ServiceException - from context.proto import context_pb2 - from device.client.DeviceClient import DeviceClient from device.proto import device_pb2 LOGGER = logging.getLogger(__name__) -MONITORING_GETINSTANTKPI_REQUEST_TIME = Summary('monitoring_getinstantkpi_processing_seconds', 'Time spent processing monitoring instant kpi request') +MONITORING_GETINSTANTKPI_REQUEST_TIME = Summary( + 'monitoring_getinstantkpi_processing_seconds', 'Time spent processing monitoring instant kpi request') MONITORING_INCLUDEKPI_COUNTER = Counter('monitoring_includekpi_counter', 'Monitoring include kpi request counter') INFLUXDB_HOSTNAME = os.environ.get("INFLUXDB_HOSTNAME") @@ -42,9 +34,6 @@ INFLUXDB_USER = os.environ.get("INFLUXDB_USER") INFLUXDB_PASSWORD = os.environ.get("INFLUXDB_PASSWORD") INFLUXDB_DATABASE = os.environ.get("INFLUXDB_DATABASE") -DEVICE_SERVICE_HOST = get_setting('DEVICESERVICE_SERVICE_HOST', default=DEVICE_SERVICE_HOST ) -DEVICE_SERVICE_PORT = get_setting('DEVICESERVICE_SERVICE_PORT_GRPC', default=DEVICE_GRPC_SERVICE_PORT) - class MonitoringServiceServicerImpl(monitoring_pb2_grpc.MonitoringServiceServicer): def __init__(self): @@ -52,13 +41,14 @@ class MonitoringServiceServicerImpl(monitoring_pb2_grpc.MonitoringServiceService # Init sqlite monitoring db self.sql_db = SqliteTools.SQLite('monitoring.db') - self.deviceClient = DeviceClient(address=DEVICE_SERVICE_HOST, port=DEVICE_GRPC_SERVICE_PORT) # instantiate the client # Create influx_db client self.influx_db = InfluxTools.Influx(INFLUXDB_HOSTNAME,"8086",INFLUXDB_USER,INFLUXDB_PASSWORD,INFLUXDB_DATABASE) # CreateKpi (CreateKpiRequest) returns (KpiId) {} - def CreateKpi(self, request : monitoring_pb2.KpiDescriptor, grpc_context : grpc.ServicerContext) -> monitoring_pb2.KpiId : + def CreateKpi( + self, request : monitoring_pb2.KpiDescriptor, grpc_context : grpc.ServicerContext + ) -> monitoring_pb2.KpiId: # CREATEKPI_COUNTER_STARTED.inc() LOGGER.info('CreateKpi') try: @@ -71,7 +61,8 @@ class MonitoringServiceServicerImpl(monitoring_pb2_grpc.MonitoringServiceService kpi_endpoint_id = request.endpoint_id.endpoint_uuid.uuid kpi_service_id = request.service_id.service_uuid.uuid - data = self.sql_db.insert_KPI(kpi_description, kpi_sample_type, kpi_device_id, kpi_endpoint_id, kpi_service_id) + data = self.sql_db.insert_KPI( + kpi_description, kpi_sample_type, kpi_device_id, kpi_endpoint_id, kpi_service_id) kpi_id.kpi_id.uuid = str(data) @@ -87,7 +78,9 @@ class MonitoringServiceServicerImpl(monitoring_pb2_grpc.MonitoringServiceService grpc_context.abort(grpc.StatusCode.INTERNAL, str(e)) # rpc MonitorKpi (MonitorKpiRequest) returns (context.Empty) {} - def MonitorKpi ( self, request : monitoring_pb2.MonitorKpiRequest, grpc_context : grpc.ServicerContext) -> context_pb2.Empty: + def MonitorKpi( + self, request : monitoring_pb2.MonitorKpiRequest, grpc_context : grpc.ServicerContext + ) -> context_pb2.Empty: LOGGER.info('MonitorKpi') try: @@ -97,25 +90,23 @@ class MonitoringServiceServicerImpl(monitoring_pb2_grpc.MonitoringServiceService kpiDescriptor = self.GetKpiDescriptor(request.kpi_id, grpc_context) monitor_device_request.kpi_descriptor.CopyFrom(kpiDescriptor) - monitor_device_request.kpi_id.kpi_id.uuid = request.kpi_id.kpi_id.uuid - monitor_device_request.sampling_duration_s = request.sampling_duration_s - monitor_device_request.sampling_interval_s = request.sampling_interval_s + monitor_device_request.kpi_id.kpi_id.uuid = request.kpi_id.kpi_id.uuid + monitor_device_request.sampling_duration_s = request.sampling_duration_s + monitor_device_request.sampling_interval_s = request.sampling_interval_s - s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - if s.connect_ex((DEVICE_SERVICE_HOST, DEVICE_GRPC_SERVICE_PORT)) == 0: - self.deviceClient.MonitorDeviceKpi(monitor_device_request) - else: - LOGGER.warning('Device service is not reachable') + device_client = DeviceClient() + device_client.MonitorDeviceKpi(monitor_device_request) - return context_pb2.Empty() except ServiceException as e: LOGGER.exception('MonitorKpi exception') # CREATEKPI_COUNTER_FAILED.inc() grpc_context.abort(e.code, e.details) except Exception as e: # pragma: no cover LOGGER.exception('MonitorKpi exception') + grpc_context.abort(grpc.StatusCode.INTERNAL, str(e)) # CREATEKPI_COUNTER_FAILED.inc() + return context_pb2.Empty() # rpc IncludeKpi(IncludeKpiRequest) returns(context.Empty) {} def IncludeKpi(self, request : monitoring_pb2.Kpi, grpc_context : grpc.ServicerContext) -> context_pb2.Empty: @@ -145,7 +136,7 @@ class MonitoringServiceServicerImpl(monitoring_pb2_grpc.MonitoringServiceService LOGGER.exception('IncludeKpi exception') # CREATEKPI_COUNTER_FAILED.inc() grpc_context.abort(e.code, e.details) - except Exception as e: # pragma: no cover + except Exception: # pragma: no cover LOGGER.exception('IncludeKpi exception') # CREATEKPI_COUNTER_FAILED.inc() return context_pb2.Empty() @@ -162,7 +153,9 @@ class MonitoringServiceServicerImpl(monitoring_pb2_grpc.MonitoringServiceService return monitoring_pb2.Kpi() - def GetKpiDescriptor(self, request : monitoring_pb2.KpiId, grpc_context : grpc.ServicerContext) -> monitoring_pb2.KpiDescriptor: + def GetKpiDescriptor( + self, request : monitoring_pb2.KpiId, grpc_context : grpc.ServicerContext + ) -> monitoring_pb2.KpiDescriptor: LOGGER.info('getting Kpi by KpiID') try: kpi_db = self.sql_db.get_KPI(int(request.kpi_id.uuid)) @@ -183,5 +176,5 @@ class MonitoringServiceServicerImpl(monitoring_pb2_grpc.MonitoringServiceService LOGGER.exception('GetKpiDescriptor exception') grpc_context.abort(e.code, e.details) - except Exception as e: # pragma: no cover + except Exception: # pragma: no cover LOGGER.exception('GetKpiDescriptor exception') diff --git a/src/monitoring/service/__main__.py b/src/monitoring/service/__main__.py index 7835b4fc8a37f27419cebebfd0bf75b86820f38d..714046517e7b0ea591dce7411c5cb91ca3b867a6 100644 --- a/src/monitoring/service/__main__.py +++ b/src/monitoring/service/__main__.py @@ -12,44 +12,27 @@ # See the License for the specific language governing permissions and # limitations under the License. -import logging, signal, sys, threading, socket - -from common.Settings import get_setting, wait_for_environment_variables -from context.client.ContextClient import ContextClient -from monitoring.Config import ( - GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD, LOG_LEVEL, METRICS_PORT, CONTEXT_GRPC_SERVICE_PORT, - CONTEXT_SERVICE_HOST) - -from monitoring.client.monitoring_client import MonitoringClient -from monitoring.proto import monitoring_pb2 -from monitoring.service.EventTools import EventsDeviceCollector -from monitoring.service.MonitoringService import MonitoringService - +import logging, signal, sys, threading from prometheus_client import start_http_server +from common.Constants import ServiceNameEnum +from common.Settings import ( + ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_log_level, get_metrics_port, + wait_for_environment_variables) +from monitoring.proto import monitoring_pb2 +from .EventTools import EventsDeviceCollector +from .MonitoringService import MonitoringService terminate = threading.Event() LOGGER = None -LOCALHOST = '127.0.0.1' -def signal_handler(signal, frame): +def signal_handler(signal, frame): # pylint: disable=redefined-outer-name LOGGER.warning('Terminate signal received') terminate.set() def start_monitoring(): LOGGER.info('Start Monitoring...',) - grpc_service_port = get_setting('MONITORINGSERVICE_SERVICE_PORT_GRPC', default=GRPC_SERVICE_PORT ) - context_service_host = get_setting('CONTEXTSERVICE_SERVICE_HOST', default=CONTEXT_SERVICE_HOST ) - context_service_port = get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC', default=CONTEXT_GRPC_SERVICE_PORT) - - s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - if s.connect_ex((context_service_host, int(context_service_port))) != 0: - LOGGER.info('Context service is not reachable') - return - - context_client_grpc = ContextClient(address=context_service_host, port=context_service_port) - monitoring_client = MonitoringClient(server=LOCALHOST, port=grpc_service_port) # instantiate the client - events_collector = EventsDeviceCollector(context_client_grpc, monitoring_client) + events_collector = EventsDeviceCollector() events_collector.start() # Iterate while terminate is not set @@ -64,8 +47,7 @@ def start_monitoring(): monitor_kpi_request.kpi_id.CopyFrom(kpi_id) monitor_kpi_request.sampling_duration_s = 86400 monitor_kpi_request.sampling_interval_s = 30 - - monitoring_client.MonitorKpi(monitor_kpi_request) + events_collector._monitoring_client.MonitorKpi(monitor_kpi_request) else: # Terminate is set, looping terminates LOGGER.warning("Stopping execution...") @@ -73,31 +55,28 @@ def start_monitoring(): events_collector.start() def main(): - global LOGGER - - grpc_service_port = get_setting('MONITORINGSERVICE_SERVICE_PORT_GRPC', default=GRPC_SERVICE_PORT) - max_workers = get_setting('MAX_WORKERS', default=GRPC_MAX_WORKERS ) - grace_period = get_setting('GRACE_PERIOD', default=GRPC_GRACE_PERIOD) - log_level = get_setting('LOG_LEVEL', default=LOG_LEVEL ) - metrics_port = get_setting('METRICS_PORT', default=METRICS_PORT ) + global LOGGER # pylint: disable=global-statement + log_level = get_log_level() logging.basicConfig(level=log_level) LOGGER = logging.getLogger(__name__) wait_for_environment_variables([ - 'CONTEXTSERVICE_SERVICE_HOST', 'CONTEXTSERVICE_SERVICE_PORT_GRPC', - 'DEVICESERVICE_SERVICE_HOST', 'DEVICESERVICE_SERVICE_PORT_GRPC' + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_HOST ), + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC), ]) signal.signal(signal.SIGINT, signal_handler) signal.signal(signal.SIGTERM, signal_handler) LOGGER.info('Starting...') + # Start metrics server + metrics_port = get_metrics_port() start_http_server(metrics_port) # Starting monitoring service - grpc_service = MonitoringService(port=grpc_service_port, max_workers=max_workers, grace_period=grace_period) + grpc_service = MonitoringService() grpc_service.start() start_monitoring() @@ -112,4 +91,4 @@ def main(): return 0 if __name__ == '__main__': - sys.exit(main()) \ No newline at end of file + sys.exit(main()) diff --git a/src/monitoring/tests/Messages.py b/src/monitoring/tests/Messages.py new file mode 100644 index 0000000000000000000000000000000000000000..dd4db01fdd6f94e0e376129b90c89b6475b48449 --- /dev/null +++ b/src/monitoring/tests/Messages.py @@ -0,0 +1,49 @@ +# 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. + +from monitoring.proto import monitoring_pb2 +from monitoring.proto.kpi_sample_types_pb2 import KpiSampleType + +def kpi(): + _kpi = monitoring_pb2.Kpi() + _kpi.kpi_id.kpi_id.uuid = 'KPIID0000' # pylint: disable=maybe-no-member + return _kpi + +def kpi_id(): + _kpi_id = monitoring_pb2.KpiId() + _kpi_id.kpi_id.uuid = str(1) # pylint: disable=maybe-no-member + return _kpi_id + +def create_kpi_request(): + _create_kpi_request = monitoring_pb2.KpiDescriptor() + _create_kpi_request.kpi_description = 'KPI Description Test' + _create_kpi_request.kpi_sample_type = KpiSampleType.KPISAMPLETYPE_PACKETS_TRANSMITTED + _create_kpi_request.device_id.device_uuid.uuid = 'DEV1' # pylint: disable=maybe-no-member + _create_kpi_request.service_id.service_uuid.uuid = 'SERV1' # pylint: disable=maybe-no-member + _create_kpi_request.endpoint_id.endpoint_uuid.uuid = 'END1' # pylint: disable=maybe-no-member + return _create_kpi_request + +def monitor_kpi_request(kpi_uuid, sampling_duration_s, sampling_interval_s): + _monitor_kpi_request = monitoring_pb2.MonitorKpiRequest() + _monitor_kpi_request.kpi_id.kpi_id.uuid = kpi_uuid # pylint: disable=maybe-no-member + _monitor_kpi_request.sampling_duration_s = sampling_duration_s + _monitor_kpi_request.sampling_interval_s = sampling_interval_s + return _monitor_kpi_request + +def include_kpi_request(): + _include_kpi_request = monitoring_pb2.Kpi() + _include_kpi_request.kpi_id.kpi_id.uuid = str(1) # pylint: disable=maybe-no-member + _include_kpi_request.timestamp = "2021-10-12T13:14:42Z" + _include_kpi_request.kpi_value.intVal = 500 # pylint: disable=maybe-no-member + return _include_kpi_request diff --git a/src/monitoring/tests/Objects.py b/src/monitoring/tests/Objects.py new file mode 100644 index 0000000000000000000000000000000000000000..852da6bc98dee441a1e21e60e1b3ae7436b98ebf --- /dev/null +++ b/src/monitoring/tests/Objects.py @@ -0,0 +1,30 @@ +# 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. + +from common.tools.object_factory.Device import ( + json_device_emulated_connect_rules, json_device_emulated_packet_router_disabled) +from context.proto.kpi_sample_types_pb2 import KpiSampleType + +PACKET_PORT_SAMPLE_TYPES = [ + KpiSampleType.KPISAMPLETYPE_PACKETS_TRANSMITTED, + KpiSampleType.KPISAMPLETYPE_PACKETS_RECEIVED, + KpiSampleType.KPISAMPLETYPE_BYTES_TRANSMITTED, + KpiSampleType.KPISAMPLETYPE_BYTES_RECEIVED, +] + +DEVICE_DEV1_UUID = 'DEV1' +ENDPOINT_END1_UUID = 'END1' +DEVICE_DEV1_ENDPOINT_DEFS = [(ENDPOINT_END1_UUID, 'copper', PACKET_PORT_SAMPLE_TYPES)] +DEVICE_DEV1 = json_device_emulated_packet_router_disabled(DEVICE_DEV1_UUID) +DEVICE_DEV1_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_DEV1_ENDPOINT_DEFS) diff --git a/src/monitoring/tests/test_unitary.py b/src/monitoring/tests/test_unitary.py index 97cdf48905cfc0dfae0dc1a4fa1f2c84ea50df7a..d3799689eee4a1a12f4d4d7998d92482c59adb16 100644 --- a/src/monitoring/tests/test_unitary.py +++ b/src/monitoring/tests/test_unitary.py @@ -12,33 +12,35 @@ # See the License for the specific language governing permissions and # limitations under the License. -import logging -import os -import socket -import pytest +import copy, logging, os, pytest from typing import Tuple - - -from monitoring.proto import context_pb2, kpi_sample_types_pb2 -from monitoring.proto import monitoring_pb2 -from monitoring.client.monitoring_client import MonitoringClient -from monitoring.Config import GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD, DEVICE_GRPC_GRACE_PERIOD, DEVICE_GRPC_MAX_WORKERS, DEVICE_GRPC_SERVICE_PORT, DEVICE_SERVICE_HOST -from monitoring.proto.kpi_sample_types_pb2 import KpiSampleType -from monitoring.service import SqliteTools, InfluxTools -from monitoring.service.MonitoringService import MonitoringService -from monitoring.service.EventTools import EventsDeviceCollector - +from common.Constants import ServiceNameEnum +from common.Settings import ( + ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_service_port_grpc) from common.orm.Database import Database from common.orm.Factory import get_database_backend, BackendEnum as DatabaseBackendEnum from common.message_broker.Factory import get_messagebroker_backend, BackendEnum as MessageBrokerBackendEnum from common.message_broker.MessageBroker import MessageBroker -from context.Config import GRPC_SERVICE_PORT as grpc_port_context, GRPC_MAX_WORKERS as grpc_workers_context, GRPC_GRACE_PERIOD as grpc_grace_context from context.client.ContextClient import ContextClient from context.service.grpc_server.ContextService import ContextService -from context.service.Populate import populate from context.proto.context_pb2 import EventTypeEnum, DeviceEvent, Device -from context.tests.Objects import (DEVICE_R1, DEVICE_R1_UUID) + +from device.client.DeviceClient import DeviceClient +from device.service.DeviceService import DeviceService +from device.service.driver_api.DriverFactory import DriverFactory +from device.service.driver_api.DriverInstanceCache import DriverInstanceCache +from device.service.drivers import DRIVERS + +from monitoring.client.MonitoringClient import MonitoringClient +from monitoring.proto import context_pb2, monitoring_pb2 +from monitoring.proto.kpi_sample_types_pb2 import KpiSampleType +from monitoring.service import SqliteTools, InfluxTools +from monitoring.service.MonitoringService import MonitoringService +from monitoring.service.EventTools import EventsDeviceCollector +from monitoring.tests.Messages import create_kpi_request, include_kpi_request, kpi, kpi_id, monitor_kpi_request +from monitoring.tests.Objects import DEVICE_DEV1, DEVICE_DEV1_CONNECT_RULES, DEVICE_DEV1_UUID + LOGGER = logging.getLogger(__name__) LOGGER.setLevel(logging.DEBUG) @@ -47,18 +49,19 @@ LOGGER.setLevel(logging.DEBUG) # Tests Setup ########################### -SERVER_ADDRESS = '127.0.0.1' -LISTEN_ADDRESS = '[::]' -GRPC_PORT_MONITORING = 7070 +LOCAL_HOST = '127.0.0.1' -GRPC_PORT_CONTEXT = 10000 + grpc_port_context # avoid privileged ports -DEVICE_GRPC_SERVICE_PORT = 10000 + DEVICE_GRPC_SERVICE_PORT # avoid privileged ports -MONITORING_GRPC_SERVICE_PORT = GRPC_PORT_MONITORING # avoid privileged ports +CONTEXT_SERVICE_PORT = 10000 + get_service_port_grpc(ServiceNameEnum.CONTEXT) # avoid privileged ports +os.environ[get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_HOST )] = str(LOCAL_HOST) +os.environ[get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(CONTEXT_SERVICE_PORT) +DEVICE_SERVICE_PORT = 10000 + get_service_port_grpc(ServiceNameEnum.DEVICE) # avoid privileged ports +os.environ[get_env_var_name(ServiceNameEnum.DEVICE, ENVVAR_SUFIX_SERVICE_HOST )] = str(LOCAL_HOST) +os.environ[get_env_var_name(ServiceNameEnum.DEVICE, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(DEVICE_SERVICE_PORT) -SCENARIOS = [ # comment/uncomment scenarios to activate/deactivate them in the test unit - ('all_inmemory', DatabaseBackendEnum.INMEMORY, {}, MessageBrokerBackendEnum.INMEMORY, {} ), -] +MONITORING_SERVICE_PORT = 10000 + get_service_port_grpc(ServiceNameEnum.MONITORING) # avoid privileged ports +os.environ[get_env_var_name(ServiceNameEnum.MONITORING, ENVVAR_SUFIX_SERVICE_HOST )] = str(LOCAL_HOST) +os.environ[get_env_var_name(ServiceNameEnum.MONITORING, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(MONITORING_SERVICE_PORT) INFLUXDB_HOSTNAME = os.environ.get("INFLUXDB_HOSTNAME") INFLUXDB_PORT = os.environ.get("INFLUXDB_PORT") @@ -66,275 +69,250 @@ INFLUXDB_USER = os.environ.get("INFLUXDB_USER") INFLUXDB_PASSWORD = os.environ.get("INFLUXDB_PASSWORD") INFLUXDB_DATABASE = os.environ.get("INFLUXDB_DATABASE") -@pytest.fixture(scope='session', ids=[str(scenario[0]) for scenario in SCENARIOS], params=SCENARIOS) -def context_db_mb(request) -> Tuple[Database, MessageBroker]: - name,db_backend,db_settings,mb_backend,mb_settings = request.param - msg = 'Running scenario {:s} db_backend={:s}, db_settings={:s}, mb_backend={:s}, mb_settings={:s}...' - LOGGER.info(msg.format(str(name), str(db_backend.value), str(db_settings), str(mb_backend.value), str(mb_settings))) - _database = Database(get_database_backend(backend=db_backend, **db_settings)) - _message_broker = MessageBroker(get_messagebroker_backend(backend=mb_backend, **mb_settings)) +@pytest.fixture(scope='session') +def context_db_mb() -> Tuple[Database, MessageBroker]: + _database = Database(get_database_backend(backend=DatabaseBackendEnum.INMEMORY)) + _message_broker = MessageBroker(get_messagebroker_backend(backend=MessageBrokerBackendEnum.INMEMORY)) yield _database, _message_broker _message_broker.terminate() @pytest.fixture(scope='session') -def context_service_grpc(context_db_mb : Tuple[Database, MessageBroker]): # pylint: disable=redefined-outer-name - database = context_db_mb[0] +def context_service(context_db_mb : Tuple[Database, MessageBroker]): # pylint: disable=redefined-outer-name + database, message_broker = context_db_mb database.clear_all() - _service = ContextService( - database, context_db_mb[1], port=GRPC_PORT_CONTEXT, max_workers=grpc_workers_context, - grace_period=grpc_grace_context) + _service = ContextService(database, message_broker) _service.start() yield _service _service.stop() @pytest.fixture(scope='session') -def context_client_grpc(context_service_grpc : ContextService): # pylint: disable=redefined-outer-name - _client = ContextClient(address='localhost', port=GRPC_PORT_CONTEXT) +def context_client(context_service : ContextService): # pylint: disable=redefined-outer-name + _client = ContextClient() yield _client _client.close() - -# This fixture will be requested by test cases and last during testing session @pytest.fixture(scope='session') -def monitoring_service(): - LOGGER.warning('monitoring_service begin') +def device_service(context_service : ContextService): # pylint: disable=redefined-outer-name + LOGGER.info('Initializing DeviceService...') + driver_factory = DriverFactory(DRIVERS) + driver_instance_cache = DriverInstanceCache(driver_factory) + _service = DeviceService(driver_instance_cache) + _service.start() + + # yield the server, when test finishes, execution will resume to stop it + LOGGER.info('Yielding DeviceService...') + yield _service + + LOGGER.info('Terminating DeviceService...') + _service.stop() - service_port = GRPC_SERVICE_PORT - max_workers = GRPC_MAX_WORKERS - grace_period = GRPC_GRACE_PERIOD +@pytest.fixture(scope='session') +def device_client(device_service : DeviceService): # pylint: disable=redefined-outer-name + _client = DeviceClient() + yield _client + _client.close() +# This fixture will be requested by test cases and last during testing session +@pytest.fixture(scope='session') +def monitoring_service( + context_service : ContextService, # pylint: disable=redefined-outer-name + device_service : DeviceService # pylint: disable=redefined-outer-name + ): LOGGER.info('Initializing MonitoringService...') - grpc_service = MonitoringService(port=service_port, max_workers=max_workers, grace_period=grace_period) - server = grpc_service.start() + _service = MonitoringService() + _service.start() # yield the server, when test finishes, execution will resume to stop it - LOGGER.warning('monitoring_service yielding') - yield server + LOGGER.info('Yielding MonitoringService...') + yield _service LOGGER.info('Terminating MonitoringService...') - grpc_service.stop() + _service.stop() # This fixture will be requested by test cases and last during testing session. # The client requires the server, so client fixture has the server as dependency. @pytest.fixture(scope='session') -def monitoring_client(monitoring_service): - LOGGER.warning('monitoring_client begin') - client = MonitoringClient(server=SERVER_ADDRESS, port=GRPC_PORT_MONITORING) # instantiate the client - LOGGER.warning('monitoring_client returning') - return client - -# This fixture will be requested by test cases and last during testing session. -@pytest.fixture(scope='session') -def kpi(): - LOGGER.warning('test_include_kpi begin') - # form request - kpi = monitoring_pb2.Kpi() - kpi.kpi_id.kpi_id.uuid = 'KPIID0000' - kpi.kpiDescription = 'KPI Desc' - return kpi - -@pytest.fixture(scope='session') -def kpi_id(): - LOGGER.warning('test_include_kpi begin') +def monitoring_client(monitoring_service : MonitoringService): # pylint: disable=redefined-outer-name + LOGGER.info('Initializing MonitoringClient...') + _client = MonitoringClient() - # form request - kpi_id = monitoring_pb2.KpiId() - kpi_id.kpi_id.uuid = str(1) + # yield the server, when test finishes, execution will resume to stop it + LOGGER.info('Yielding MonitoringClient...') + yield _client - return kpi_id + LOGGER.info('Closing MonitoringClient...') + _client.close() @pytest.fixture(scope='session') def sql_db(): - sql_db = SqliteTools.SQLite('monitoring.db') - return sql_db + _sql_db = SqliteTools.SQLite('monitoring.db') + return _sql_db @pytest.fixture(scope='session') def influx_db(): - influx_db = InfluxTools.Influx(INFLUXDB_HOSTNAME, INFLUXDB_PORT, INFLUXDB_USER, INFLUXDB_PASSWORD, INFLUXDB_DATABASE) - return influx_db + _influx_db = InfluxTools.Influx( + INFLUXDB_HOSTNAME, INFLUXDB_PORT, INFLUXDB_USER, INFLUXDB_PASSWORD, INFLUXDB_DATABASE) + return _influx_db -@pytest.fixture(scope='session') -def create_kpi_request(): - LOGGER.warning('test_include_kpi begin') - - create_kpi_request = monitoring_pb2.KpiDescriptor() - create_kpi_request.kpi_description = 'KPI Description Test' - create_kpi_request.kpi_sample_type = kpi_sample_types_pb2.KpiSampleType.KPISAMPLETYPE_PACKETS_TRANSMITTED - create_kpi_request.device_id.device_uuid.uuid = 'DEV1' # pylint: disable=maybe-no-member - create_kpi_request.service_id.service_uuid.uuid = "SERV1" - create_kpi_request.endpoint_id.endpoint_uuid.uuid = "END1" - - return create_kpi_request - -@pytest.fixture(scope='session') -def monitor_kpi_request(): - LOGGER.warning('test_monitor_kpi begin') - - monitor_kpi_request = monitoring_pb2.MonitorKpiRequest() - monitor_kpi_request.kpi_id.kpi_id.uuid = str(1) - monitor_kpi_request.sampling_duration_s = 120 - monitor_kpi_request.sampling_interval_s = 5 - - return monitor_kpi_request - - -@pytest.fixture(scope='session') -def include_kpi_request(): - LOGGER.warning('test_include_kpi begin') - - include_kpi_request = monitoring_pb2.Kpi() - include_kpi_request.kpi_id.kpi_id.uuid = str(1) - include_kpi_request.timestamp = "2021-10-12T13:14:42Z" - include_kpi_request.kpi_value.intVal = 500 - - return include_kpi_request - -@pytest.fixture(scope='session') -def address(): - address = '127.0.0.1' - return address - -@pytest.fixture(scope='session') -def port(): - port = 7070 - return port ########################### # Tests Implementation ########################### # Test case that makes use of client fixture to test server's CreateKpi method -def test_create_kpi(monitoring_client,create_kpi_request): +def test_create_kpi(monitoring_client): # pylint: disable=redefined-outer-name # make call to server LOGGER.warning('test_create_kpi requesting') - response = monitoring_client.CreateKpi(create_kpi_request) + response = monitoring_client.CreateKpi(create_kpi_request()) LOGGER.debug(str(response)) assert isinstance(response, monitoring_pb2.KpiId) # Test case that makes use of client fixture to test server's MonitorKpi method -def test_monitor_kpi(monitoring_client,create_kpi_request): +def test_monitor_kpi( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + monitoring_client : MonitoringClient, # pylint: disable=redefined-outer-name + context_db_mb : Tuple[Database, MessageBroker] # pylint: disable=redefined-outer-name + ): LOGGER.warning('test_monitor_kpi begin') - response = monitoring_client.CreateKpi(create_kpi_request) + context_database = context_db_mb[0] - monitor_kpi_request = monitoring_pb2.MonitorKpiRequest() - monitor_kpi_request.kpi_id.kpi_id.uuid = response.kpi_id.uuid - monitor_kpi_request.sampling_duration_s = 120 - monitor_kpi_request.sampling_interval_s = 5 + # ----- Clean the database ----------------------------------------------------------------------------------------- + context_database.clear_all() - response = monitoring_client.MonitorKpi(monitor_kpi_request) + # ----- Dump state of database before create the object ------------------------------------------------------------ + db_entries = context_database.dump() + LOGGER.info('----- Database Dump [{:3d} entries] -------------------------'.format(len(db_entries))) + for db_entry in db_entries: + LOGGER.info(' [{:>4s}] {:40s} :: {:s}'.format(*db_entry)) # pragma: no cover + LOGGER.info('-----------------------------------------------------------') + assert len(db_entries) == 0 + + # ----- Update the object ------------------------------------------------------------------------------------------ + LOGGER.info('Adding Device {:s}'.format(DEVICE_DEV1_UUID)) + device_with_connect_rules = copy.deepcopy(DEVICE_DEV1) + device_with_connect_rules['device_config']['config_rules'].extend(DEVICE_DEV1_CONNECT_RULES) + response = device_client.AddDevice(Device(**device_with_connect_rules)) + assert response.device_uuid.uuid == DEVICE_DEV1_UUID + + response = monitoring_client.CreateKpi(create_kpi_request()) + _monitor_kpi_request = monitor_kpi_request(response.kpi_id.uuid, 120, 5) # pylint: disable=maybe-no-member + response = monitoring_client.MonitorKpi(_monitor_kpi_request) LOGGER.debug(str(response)) assert isinstance(response, context_pb2.Empty) # Test case that makes use of client fixture to test server's IncludeKpi method -def test_include_kpi(monitoring_client,include_kpi_request): +def test_include_kpi(monitoring_client): # pylint: disable=redefined-outer-name # make call to server LOGGER.warning('test_include_kpi requesting') - response = monitoring_client.IncludeKpi(include_kpi_request) + response = monitoring_client.IncludeKpi(include_kpi_request()) LOGGER.debug(str(response)) assert isinstance(response, context_pb2.Empty) # Test case that makes use of client fixture to test server's GetStreamKpi method -def test_get_stream_kpi(monitoring_client,include_kpi_request): +def test_get_stream_kpi(monitoring_client): # pylint: disable=redefined-outer-name LOGGER.warning('test_getstream_kpi begin') - response = monitoring_client.GetStreamKpi(kpi) + response = monitoring_client.GetStreamKpi(kpi()) LOGGER.debug(str(response)) #assert isinstance(response, monitoring_pb2.Kpi) # Test case that makes use of client fixture to test server's GetInstantKpi method -def test_get_instant_kpi(monitoring_client,kpi_id): +def test_get_instant_kpi(monitoring_client): # pylint: disable=redefined-outer-name LOGGER.warning('test_getinstant_kpi begin') - response = monitoring_client.GetInstantKpi(kpi_id) + response = monitoring_client.GetInstantKpi(kpi_id()) LOGGER.debug(str(response)) assert isinstance(response, monitoring_pb2.Kpi) # Test case that makes use of client fixture to test server's GetInstantKpi method -def test_get_kpidescritor_kpi(monitoring_client,create_kpi_request): +def test_get_kpidescritor_kpi(monitoring_client): # pylint: disable=redefined-outer-name LOGGER.warning('test_getkpidescritor_kpi begin') - - response = monitoring_client.CreateKpi(create_kpi_request) - + response = monitoring_client.CreateKpi(create_kpi_request()) response = monitoring_client.GetKpiDescriptor(response) LOGGER.debug(str(response)) assert isinstance(response, monitoring_pb2.KpiDescriptor) -def test_sqlitedb_tools_insert_kpi(sql_db, create_kpi_request): +def test_sqlitedb_tools_insert_kpi(sql_db): # pylint: disable=redefined-outer-name LOGGER.warning('test_sqlitedb_tools_insert_kpi begin') - - kpi_description = create_kpi_request.kpi_description - kpi_sample_type = create_kpi_request.kpi_sample_type - kpi_device_id = create_kpi_request.device_id.device_uuid.uuid - kpi_endpoint_id = create_kpi_request.endpoint_id.endpoint_uuid.uuid - kpi_service_id = create_kpi_request.service_id.service_uuid.uuid + _create_kpi_request = create_kpi_request() + kpi_description = _create_kpi_request.kpi_description # pylint: disable=maybe-no-member + kpi_sample_type = _create_kpi_request.kpi_sample_type # pylint: disable=maybe-no-member + kpi_device_id = _create_kpi_request.device_id.device_uuid.uuid # pylint: disable=maybe-no-member + kpi_endpoint_id = _create_kpi_request.endpoint_id.endpoint_uuid.uuid # pylint: disable=maybe-no-member + kpi_service_id = _create_kpi_request.service_id.service_uuid.uuid # pylint: disable=maybe-no-member response = sql_db.insert_KPI(kpi_description, kpi_sample_type, kpi_device_id, kpi_endpoint_id, kpi_service_id) assert isinstance(response, int) -def test_sqlitedb_tools_get_kpi(sql_db, create_kpi_request): +def test_sqlitedb_tools_get_kpi(sql_db): # pylint: disable=redefined-outer-name LOGGER.warning('test_sqlitedb_tools_get_kpi begin') - - kpi_description = create_kpi_request.kpi_description - kpi_sample_type = create_kpi_request.kpi_sample_type - kpi_device_id = create_kpi_request.device_id.device_uuid.uuid - kpi_endpoint_id = create_kpi_request.endpoint_id.endpoint_uuid.uuid - kpi_service_id = create_kpi_request.service_id.service_uuid.uuid - - kpi_id = sql_db.insert_KPI(kpi_description, kpi_sample_type, kpi_device_id, kpi_endpoint_id, kpi_service_id) - - response = sql_db.get_KPI(kpi_id) + _create_kpi_request = create_kpi_request() + kpi_description = _create_kpi_request.kpi_description # pylint: disable=maybe-no-member + kpi_sample_type = _create_kpi_request.kpi_sample_type # pylint: disable=maybe-no-member + kpi_device_id = _create_kpi_request.device_id.device_uuid.uuid # pylint: disable=maybe-no-member + kpi_endpoint_id = _create_kpi_request.endpoint_id.endpoint_uuid.uuid # pylint: disable=maybe-no-member + kpi_service_id = _create_kpi_request.service_id.service_uuid.uuid # pylint: disable=maybe-no-member + + _kpi_id = sql_db.insert_KPI(kpi_description, kpi_sample_type, kpi_device_id, kpi_endpoint_id, kpi_service_id) + response = sql_db.get_KPI(_kpi_id) assert isinstance(response, tuple) -def test_sqlitedb_tools_get_kpis(sql_db): +def test_sqlitedb_tools_get_kpis(sql_db): # pylint: disable=redefined-outer-name LOGGER.warning('test_sqlitedb_tools_get_kpis begin') response = sql_db.get_KPIS() assert isinstance(response, list) -def test_sqlitedb_tools_delete_kpi(sql_db, create_kpi_request): +def test_sqlitedb_tools_delete_kpi(sql_db): # pylint: disable=redefined-outer-name LOGGER.warning('test_sqlitedb_tools_get_kpi begin') - response = sql_db.delete_KPI("DEV1",kpi_sample_types_pb2.KpiSampleType.KPISAMPLETYPE_PACKETS_TRANSMITTED) + response = sql_db.delete_KPI("DEV1",KpiSampleType.KPISAMPLETYPE_PACKETS_TRANSMITTED) - if response == False: - kpi_description = create_kpi_request.kpi_description - kpi_sample_type = create_kpi_request.kpi_sample_type - kpi_device_id = create_kpi_request.device_id.device_uuid.uuid - kpi_endpoint_id = create_kpi_request.endpoint_id.endpoint_uuid.uuid - kpi_service_id = create_kpi_request.service_id.service_uuid.uuid + if not response: + _create_kpi_request = create_kpi_request() + kpi_description = _create_kpi_request.kpi_description # pylint: disable=maybe-no-member + kpi_sample_type = _create_kpi_request.kpi_sample_type # pylint: disable=maybe-no-member + kpi_device_id = _create_kpi_request.device_id.device_uuid.uuid # pylint: disable=maybe-no-member + kpi_endpoint_id = _create_kpi_request.endpoint_id.endpoint_uuid.uuid # pylint: disable=maybe-no-member + kpi_service_id = _create_kpi_request.service_id.service_uuid.uuid # pylint: disable=maybe-no-member sql_db.insert_KPI(kpi_description, kpi_sample_type, kpi_device_id, kpi_endpoint_id, kpi_service_id) - response = sql_db.delete_KPI("DEV1", kpi_sample_types_pb2.KpiSampleType.KPISAMPLETYPE_PACKETS_TRANSMITTED) + response = sql_db.delete_KPI("DEV1", KpiSampleType.KPISAMPLETYPE_PACKETS_TRANSMITTED) - assert response == True + assert response -def test_sqlitedb_tools_delete_kpid_id(sql_db, create_kpi_request): +def test_sqlitedb_tools_delete_kpid_id(sql_db): # pylint: disable=redefined-outer-name LOGGER.warning('test_sqlitedb_tools_delete_kpid_id begin') response = sql_db.delete_kpid_id(1) - if response == False: - kpi_description = create_kpi_request.kpi_description - kpi_sample_type = create_kpi_request.kpi_sample_type - kpi_device_id = create_kpi_request.device_id.device_uuid.uuid - kpi_endpoint_id = create_kpi_request.endpoint_id.endpoint_uuid.uuid - kpi_service_id = create_kpi_request.service_id.service_uuid.uuid + if not response: + _create_kpi_request = create_kpi_request() + kpi_description = _create_kpi_request.kpi_description # pylint: disable=maybe-no-member + kpi_sample_type = _create_kpi_request.kpi_sample_type # pylint: disable=maybe-no-member + kpi_device_id = _create_kpi_request.device_id.device_uuid.uuid # pylint: disable=maybe-no-member + kpi_endpoint_id = _create_kpi_request.endpoint_id.endpoint_uuid.uuid # pylint: disable=maybe-no-member + kpi_service_id = _create_kpi_request.service_id.service_uuid.uuid # pylint: disable=maybe-no-member - kpi_id = sql_db.insert_KPI(kpi_description, kpi_sample_type, kpi_device_id, kpi_endpoint_id, kpi_service_id) - response = sql_db.delete_kpid_id(kpi_id) + _kpi_id = sql_db.insert_KPI(kpi_description, kpi_sample_type, kpi_device_id, kpi_endpoint_id, kpi_service_id) + response = sql_db.delete_kpid_id(_kpi_id) - assert response == True + assert response -def test_influxdb_tools_write_kpi(influx_db): +def test_influxdb_tools_write_kpi(influx_db): # pylint: disable=redefined-outer-name LOGGER.warning('test_influxdb_tools_write_kpi begin') -def test_influxdb_tools_read_kpi_points(influx_db): +def test_influxdb_tools_read_kpi_points(influx_db): # pylint: disable=redefined-outer-name LOGGER.warning('test_influxdb_tools_read_kpi_points begin') -def test_events_tools(context_client_grpc: ContextClient, # pylint: disable=redefined-outer-name - monitoring_client : MonitoringClient, - context_db_mb: Tuple[Database, MessageBroker]): +def test_events_tools( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + monitoring_client : MonitoringClient, # pylint: disable=redefined-outer-name + context_db_mb : Tuple[Database, MessageBroker] # pylint: disable=redefined-outer-name + ): LOGGER.warning('test_get_device_events begin') context_database = context_db_mb[0] @@ -343,10 +321,10 @@ def test_events_tools(context_client_grpc: ContextClient, # pylint: disable=red context_database.clear_all() # ----- Initialize the EventsCollector ----------------------------------------------------------------------------- - events_collector = EventsDeviceCollector(context_client_grpc, monitoring_client) + events_collector = EventsDeviceCollector() events_collector.start() - # # ----- Dump state of database before create the object ------------------------------------------------------------ + # ----- Dump state of database before create the object ------------------------------------------------------------ db_entries = context_database.dump() LOGGER.info('----- Database Dump [{:3d} entries] -------------------------'.format(len(db_entries))) for db_entry in db_entries: @@ -354,18 +332,22 @@ def test_events_tools(context_client_grpc: ContextClient, # pylint: disable=red LOGGER.info('-----------------------------------------------------------') assert len(db_entries) == 0 - populate('localhost', GRPC_PORT_CONTEXT) # place this call in the appropriate line, according to your tests - # ----- Update the object ------------------------------------------------------------------------------------------ - response = context_client_grpc.SetDevice(Device(**DEVICE_R1)) - assert response.device_uuid.uuid == DEVICE_R1_UUID + LOGGER.info('Adding Device {:s}'.format(DEVICE_DEV1_UUID)) + device_with_connect_rules = copy.deepcopy(DEVICE_DEV1) + device_with_connect_rules['device_config']['config_rules'].extend(DEVICE_DEV1_CONNECT_RULES) + response = device_client.AddDevice(Device(**device_with_connect_rules)) + assert response.device_uuid.uuid == DEVICE_DEV1_UUID events_collector.stop() -def test_get_device_events(context_client_grpc: ContextClient, # pylint: disable=redefined-outer-name - monitoring_client : MonitoringClient, - context_db_mb: Tuple[Database, MessageBroker]): +def test_get_device_events( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + monitoring_client : MonitoringClient, # pylint: disable=redefined-outer-name + context_db_mb : Tuple[Database, MessageBroker] # pylint: disable=redefined-outer-name + ): LOGGER.warning('test_get_device_events begin') @@ -375,10 +357,10 @@ def test_get_device_events(context_client_grpc: ContextClient, # pylint: disabl context_database.clear_all() # ----- Initialize the EventsCollector ----------------------------------------------------------------------------- - events_collector = EventsDeviceCollector(context_client_grpc,monitoring_client) + events_collector = EventsDeviceCollector() events_collector.start() - # # ----- Dump state of database before create the object ------------------------------------------------------------ + # ----- Dump state of database before create the object ------------------------------------------------------------ db_entries = context_database.dump() LOGGER.info('----- Database Dump [{:3d} entries] -------------------------'.format(len(db_entries))) for db_entry in db_entries: @@ -386,20 +368,26 @@ def test_get_device_events(context_client_grpc: ContextClient, # pylint: disabl LOGGER.info('-----------------------------------------------------------') assert len(db_entries) == 0 - populate('localhost', GRPC_PORT_CONTEXT) # place this call in the appropriate line, according to your tests - # ----- Check create event ----------------------------------------------------------------------------------------- - event = events_collector.get_event(block=True) + LOGGER.info('Adding Device {:s}'.format(DEVICE_DEV1_UUID)) + device_with_connect_rules = copy.deepcopy(DEVICE_DEV1) + device_with_connect_rules['device_config']['config_rules'].extend(DEVICE_DEV1_CONNECT_RULES) + response = device_client.AddDevice(Device(**device_with_connect_rules)) + assert response.device_uuid.uuid == DEVICE_DEV1_UUID + event = events_collector.get_event(block=True) assert isinstance(event, DeviceEvent) assert event.event.event_type == EventTypeEnum.EVENTTYPE_CREATE - assert event.device_id.device_uuid.uuid == DEVICE_R1_UUID + assert event.device_id.device_uuid.uuid == DEVICE_DEV1_UUID events_collector.stop() -def test_listen_events(monitoring_client: MonitoringClient, - context_client_grpc: ContextClient, # pylint: disable=redefined-outer-name - context_db_mb: Tuple[Database, MessageBroker]): +def test_listen_events( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + monitoring_client : MonitoringClient, # pylint: disable=redefined-outer-name + context_db_mb : Tuple[Database, MessageBroker] # pylint: disable=redefined-outer-name + ): LOGGER.warning('test_listen_events begin') @@ -409,10 +397,10 @@ def test_listen_events(monitoring_client: MonitoringClient, context_database.clear_all() # ----- Initialize the EventsCollector ----------------------------------------------------------------------------- - events_collector = EventsDeviceCollector(context_client_grpc,monitoring_client) + events_collector = EventsDeviceCollector() events_collector.start() - # # ----- Dump state of database before create the object ------------------------------------------------------------ + # ----- Dump state of database before create the object ------------------------------------------------------------ db_entries = context_database.dump() LOGGER.info('----- Database Dump [{:3d} entries] -------------------------'.format(len(db_entries))) for db_entry in db_entries: @@ -420,18 +408,12 @@ def test_listen_events(monitoring_client: MonitoringClient, LOGGER.info('-----------------------------------------------------------') assert len(db_entries) == 0 - populate('localhost', GRPC_PORT_CONTEXT) # place this call in the appropriate line, according to your tests + LOGGER.info('Adding Device {:s}'.format(DEVICE_DEV1_UUID)) + device_with_connect_rules = copy.deepcopy(DEVICE_DEV1) + device_with_connect_rules['device_config']['config_rules'].extend(DEVICE_DEV1_CONNECT_RULES) + response = device_client.AddDevice(Device(**device_with_connect_rules)) + assert response.device_uuid.uuid == DEVICE_DEV1_UUID kpi_id_list = events_collector.listen_events() - assert bool(kpi_id_list) == True - -def test_socket_ports(address, port): - s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - result = s.connect_ex((address,port)) - - if result == 0: - print('socket is open') - else: - print('socket is not open') - s.close() + assert len(kpi_id_list) > 0 diff --git a/src/opticalattackmitigator/.gitlab-ci.yml b/src/opticalattackmitigator/.gitlab-ci.yml index a39a83f6f4a7f98cce08fd4b7d5b9a0379105935..5b9a133bd0cbf4b7dc4a4b6cf290a3be9adf663e 100644 --- a/src/opticalattackmitigator/.gitlab-ci.yml +++ b/src/opticalattackmitigator/.gitlab-ci.yml @@ -55,7 +55,6 @@ unit test opticalattackmitigator: - sleep 5 - docker ps -a - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml" - - docker exec -i $IMAGE_NAME bash -c "coverage xml -o /opt/results/${IMAGE_NAME}_coverage.xml" - docker exec -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing" coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' after_script: @@ -75,7 +74,6 @@ unit test opticalattackmitigator: when: always reports: junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml - cobertura: src/$IMAGE_NAME/tests/${IMAGE_NAME}_coverage.xml # Deployment of the opticalattackmitigator service in Kubernetes Cluster diff --git a/src/opticalattackmitigator/genproto.sh b/src/opticalattackmitigator/genproto.sh index 9f0651441172ee902f16faedf65c6c0c54fba9a7..500fd19301599b1e0370bf4a9fe8d1a6f298b6bb 100755 --- a/src/opticalattackmitigator/genproto.sh +++ b/src/opticalattackmitigator/genproto.sh @@ -1,6 +1,6 @@ #!/bin/bash -eu # -# Copyright 2018 Google LLC +# 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. @@ -14,14 +14,27 @@ # See the License for the specific language governing permissions and # limitations under the License. -#!/bin/bash -e - # Make folder containing the script the root folder for its execution cd $(dirname $0) rm -rf proto/*.py rm -rf proto/__pycache__ -touch proto/__init__.py +tee proto/__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 # building protos of services used python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto context.proto diff --git a/src/opticalattackmitigator/proto/context_pb2.py b/src/opticalattackmitigator/proto/context_pb2.py index 68602b16f264ceac9acc3ef6669b09d5984e72c2..50d501d3ac053ad644554331af26e3c40cd426a1 100644 --- a/src/opticalattackmitigator/proto/context_pb2.py +++ b/src/opticalattackmitigator/proto/context_pb2.py @@ -21,7 +21,7 @@ DESCRIPTOR = _descriptor.FileDescriptor( syntax='proto3', serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\rcontext.proto\x12\x07\x63ontext\x1a\x16kpi_sample_types.proto\"\x07\n\x05\x45mpty\"\x14\n\x04Uuid\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"F\n\x05\x45vent\x12\x11\n\ttimestamp\x18\x01 \x01(\x01\x12*\n\nevent_type\x18\x02 \x01(\x0e\x32\x16.context.EventTypeEnum\"0\n\tContextId\x12#\n\x0c\x63ontext_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xb6\x01\n\x07\x43ontext\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12)\n\x0ctopology_ids\x18\x02 \x03(\x0b\x32\x13.context.TopologyId\x12\'\n\x0bservice_ids\x18\x03 \x03(\x0b\x32\x12.context.ServiceId\x12/\n\ncontroller\x18\x04 \x01(\x0b\x32\x1b.context.TeraFlowController\"8\n\rContextIdList\x12\'\n\x0b\x63ontext_ids\x18\x01 \x03(\x0b\x32\x12.context.ContextId\"1\n\x0b\x43ontextList\x12\"\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32\x10.context.Context\"U\n\x0c\x43ontextEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\ncontext_id\x18\x02 \x01(\x0b\x32\x12.context.ContextId\"Z\n\nTopologyId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12$\n\rtopology_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"~\n\x08Topology\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12%\n\ndevice_ids\x18\x02 \x03(\x0b\x32\x11.context.DeviceId\x12!\n\x08link_ids\x18\x03 \x03(\x0b\x32\x0f.context.LinkId\";\n\x0eTopologyIdList\x12)\n\x0ctopology_ids\x18\x01 \x03(\x0b\x32\x13.context.TopologyId\"5\n\x0cTopologyList\x12%\n\ntopologies\x18\x01 \x03(\x0b\x32\x11.context.Topology\"X\n\rTopologyEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12(\n\x0btopology_id\x18\x02 \x01(\x0b\x32\x13.context.TopologyId\".\n\x08\x44\x65viceId\x12\"\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x9a\x02\n\x06\x44\x65vice\x12$\n\tdevice_id\x18\x01 \x01(\x0b\x32\x11.context.DeviceId\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12,\n\rdevice_config\x18\x03 \x01(\x0b\x32\x15.context.DeviceConfig\x12G\n\x19\x64\x65vice_operational_status\x18\x04 \x01(\x0e\x32$.context.DeviceOperationalStatusEnum\x12\x31\n\x0e\x64\x65vice_drivers\x18\x05 \x03(\x0e\x32\x19.context.DeviceDriverEnum\x12+\n\x10\x64\x65vice_endpoints\x18\x06 \x03(\x0b\x32\x11.context.EndPoint\"9\n\x0c\x44\x65viceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"5\n\x0c\x44\x65viceIdList\x12%\n\ndevice_ids\x18\x01 \x03(\x0b\x32\x11.context.DeviceId\".\n\nDeviceList\x12 \n\x07\x64\x65vices\x18\x01 \x03(\x0b\x32\x0f.context.Device\"R\n\x0b\x44\x65viceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"*\n\x06LinkId\x12 \n\tlink_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"X\n\x04Link\x12 \n\x07link_id\x18\x01 \x01(\x0b\x32\x0f.context.LinkId\x12.\n\x11link_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\"/\n\nLinkIdList\x12!\n\x08link_ids\x18\x01 \x03(\x0b\x32\x0f.context.LinkId\"(\n\x08LinkList\x12\x1c\n\x05links\x18\x01 \x03(\x0b\x32\r.context.Link\"L\n\tLinkEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12 \n\x07link_id\x18\x02 \x01(\x0b\x32\x0f.context.LinkId\"X\n\tServiceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12#\n\x0cservice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\xa6\x02\n\x07Service\x12&\n\nservice_id\x18\x01 \x01(\x0b\x32\x12.context.ServiceId\x12.\n\x0cservice_type\x18\x02 \x01(\x0e\x32\x18.context.ServiceTypeEnum\x12\x31\n\x14service_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12\x30\n\x13service_constraints\x18\x04 \x03(\x0b\x32\x13.context.Constraint\x12.\n\x0eservice_status\x18\x05 \x01(\x0b\x32\x16.context.ServiceStatus\x12.\n\x0eservice_config\x18\x06 \x01(\x0b\x32\x16.context.ServiceConfig\"C\n\rServiceStatus\x12\x32\n\x0eservice_status\x18\x01 \x01(\x0e\x32\x1a.context.ServiceStatusEnum\":\n\rServiceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"8\n\rServiceIdList\x12\'\n\x0bservice_ids\x18\x01 \x03(\x0b\x32\x12.context.ServiceId\"1\n\x0bServiceList\x12\"\n\x08services\x18\x01 \x03(\x0b\x32\x10.context.Service\"U\n\x0cServiceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\"6\n\x0c\x43onnectionId\x12&\n\x0f\x63onnection_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xc4\x01\n\nConnection\x12,\n\rconnection_id\x18\x01 \x01(\x0b\x32\x15.context.ConnectionId\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\x12\x33\n\x16path_hops_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12+\n\x0fsub_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\"A\n\x10\x43onnectionIdList\x12-\n\x0e\x63onnection_ids\x18\x01 \x03(\x0b\x32\x15.context.ConnectionId\":\n\x0e\x43onnectionList\x12(\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x13.context.Connection\"^\n\x0f\x43onnectionEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12,\n\rconnection_id\x18\x02 \x01(\x0b\x32\x15.context.ConnectionId\"\x82\x01\n\nEndPointId\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\x12$\n\rendpoint_uuid\x18\x03 \x01(\x0b\x32\r.context.Uuid\"\x86\x01\n\x08\x45ndPoint\x12(\n\x0b\x65ndpoint_id\x18\x01 \x01(\x0b\x32\x13.context.EndPointId\x12\x15\n\rendpoint_type\x18\x02 \x01(\t\x12\x39\n\x10kpi_sample_types\x18\x03 \x03(\x0e\x32\x1f.kpi_sample_types.KpiSampleType\"e\n\nConfigRule\x12)\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x19.context.ConfigActionEnum\x12\x14\n\x0cresource_key\x18\x02 \x01(\t\x12\x16\n\x0eresource_value\x18\x03 \x01(\t\"?\n\nConstraint\x12\x17\n\x0f\x63onstraint_type\x18\x01 \x01(\t\x12\x18\n\x10\x63onstraint_value\x18\x02 \x01(\t\"^\n\x12TeraFlowController\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x12\n\nip_address\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\"U\n\x14\x41uthenticationResult\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x15\n\rauthenticated\x18\x02 \x01(\x08*j\n\rEventTypeEnum\x12\x17\n\x13\x45VENTTYPE_UNDEFINED\x10\x00\x12\x14\n\x10\x45VENTTYPE_CREATE\x10\x01\x12\x14\n\x10\x45VENTTYPE_UPDATE\x10\x02\x12\x14\n\x10\x45VENTTYPE_REMOVE\x10\x03*\xc5\x01\n\x10\x44\x65viceDriverEnum\x12\x1a\n\x16\x44\x45VICEDRIVER_UNDEFINED\x10\x00\x12\x1b\n\x17\x44\x45VICEDRIVER_OPENCONFIG\x10\x01\x12\x1e\n\x1a\x44\x45VICEDRIVER_TRANSPORT_API\x10\x02\x12\x13\n\x0f\x44\x45VICEDRIVER_P4\x10\x03\x12&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOGY\x10\x04\x12\x1b\n\x17\x44\x45VICEDRIVER_ONF_TR_352\x10\x05*\x8f\x01\n\x1b\x44\x65viceOperationalStatusEnum\x12%\n!DEVICEOPERATIONALSTATUS_UNDEFINED\x10\x00\x12$\n DEVICEOPERATIONALSTATUS_DISABLED\x10\x01\x12#\n\x1f\x44\x45VICEOPERATIONALSTATUS_ENABLED\x10\x02*\x81\x01\n\x0fServiceTypeEnum\x12\x17\n\x13SERVICETYPE_UNKNOWN\x10\x00\x12\x14\n\x10SERVICETYPE_L3NM\x10\x01\x12\x14\n\x10SERVICETYPE_L2NM\x10\x02\x12)\n%SERVICETYPE_TAPI_CONNECTIVITY_SERVICE\x10\x03*\x88\x01\n\x11ServiceStatusEnum\x12\x1b\n\x17SERVICESTATUS_UNDEFINED\x10\x00\x12\x19\n\x15SERVICESTATUS_PLANNED\x10\x01\x12\x18\n\x14SERVICESTATUS_ACTIVE\x10\x02\x12!\n\x1dSERVICESTATUS_PENDING_REMOVAL\x10\x03*]\n\x10\x43onfigActionEnum\x12\x1a\n\x16\x43ONFIGACTION_UNDEFINED\x10\x00\x12\x14\n\x10\x43ONFIGACTION_SET\x10\x01\x12\x17\n\x13\x43ONFIGACTION_DELETE\x10\x02\x32\xad\x10\n\x0e\x43ontextService\x12:\n\x0eListContextIds\x12\x0e.context.Empty\x1a\x16.context.ContextIdList\"\x00\x12\x36\n\x0cListContexts\x12\x0e.context.Empty\x1a\x14.context.ContextList\"\x00\x12\x34\n\nGetContext\x12\x12.context.ContextId\x1a\x10.context.Context\"\x00\x12\x34\n\nSetContext\x12\x10.context.Context\x1a\x12.context.ContextId\"\x00\x12\x35\n\rRemoveContext\x12\x12.context.ContextId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetContextEvents\x12\x0e.context.Empty\x1a\x15.context.ContextEvent\"\x00\x30\x01\x12@\n\x0fListTopologyIds\x12\x12.context.ContextId\x1a\x17.context.TopologyIdList\"\x00\x12=\n\x0eListTopologies\x12\x12.context.ContextId\x1a\x15.context.TopologyList\"\x00\x12\x37\n\x0bGetTopology\x12\x13.context.TopologyId\x1a\x11.context.Topology\"\x00\x12\x37\n\x0bSetTopology\x12\x11.context.Topology\x1a\x13.context.TopologyId\"\x00\x12\x37\n\x0eRemoveTopology\x12\x13.context.TopologyId\x1a\x0e.context.Empty\"\x00\x12?\n\x11GetTopologyEvents\x12\x0e.context.Empty\x1a\x16.context.TopologyEvent\"\x00\x30\x01\x12\x38\n\rListDeviceIds\x12\x0e.context.Empty\x1a\x15.context.DeviceIdList\"\x00\x12\x34\n\x0bListDevices\x12\x0e.context.Empty\x1a\x13.context.DeviceList\"\x00\x12\x31\n\tGetDevice\x12\x11.context.DeviceId\x1a\x0f.context.Device\"\x00\x12\x31\n\tSetDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0cRemoveDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x12;\n\x0fGetDeviceEvents\x12\x0e.context.Empty\x1a\x14.context.DeviceEvent\"\x00\x30\x01\x12\x34\n\x0bListLinkIds\x12\x0e.context.Empty\x1a\x13.context.LinkIdList\"\x00\x12\x30\n\tListLinks\x12\x0e.context.Empty\x1a\x11.context.LinkList\"\x00\x12+\n\x07GetLink\x12\x0f.context.LinkId\x1a\r.context.Link\"\x00\x12+\n\x07SetLink\x12\r.context.Link\x1a\x0f.context.LinkId\"\x00\x12/\n\nRemoveLink\x12\x0f.context.LinkId\x1a\x0e.context.Empty\"\x00\x12\x37\n\rGetLinkEvents\x12\x0e.context.Empty\x1a\x12.context.LinkEvent\"\x00\x30\x01\x12>\n\x0eListServiceIds\x12\x12.context.ContextId\x1a\x16.context.ServiceIdList\"\x00\x12:\n\x0cListServices\x12\x12.context.ContextId\x1a\x14.context.ServiceList\"\x00\x12\x34\n\nGetService\x12\x12.context.ServiceId\x1a\x10.context.Service\"\x00\x12\x34\n\nSetService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rRemoveService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetServiceEvents\x12\x0e.context.Empty\x1a\x15.context.ServiceEvent\"\x00\x30\x01\x12\x44\n\x11ListConnectionIds\x12\x12.context.ServiceId\x1a\x19.context.ConnectionIdList\"\x00\x12@\n\x0fListConnections\x12\x12.context.ServiceId\x1a\x17.context.ConnectionList\"\x00\x12=\n\rGetConnection\x12\x15.context.ConnectionId\x1a\x13.context.Connection\"\x00\x12=\n\rSetConnection\x12\x13.context.Connection\x1a\x15.context.ConnectionId\"\x00\x12;\n\x10RemoveConnection\x12\x15.context.ConnectionId\x1a\x0e.context.Empty\"\x00\x12\x43\n\x13GetConnectionEvents\x12\x0e.context.Empty\x1a\x18.context.ConnectionEvent\"\x00\x30\x01\x62\x06proto3' + serialized_pb=b'\n\rcontext.proto\x12\x07\x63ontext\x1a\x16kpi_sample_types.proto\"\x07\n\x05\x45mpty\"\x14\n\x04Uuid\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"F\n\x05\x45vent\x12\x11\n\ttimestamp\x18\x01 \x01(\x01\x12*\n\nevent_type\x18\x02 \x01(\x0e\x32\x16.context.EventTypeEnum\"0\n\tContextId\x12#\n\x0c\x63ontext_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xb6\x01\n\x07\x43ontext\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12)\n\x0ctopology_ids\x18\x02 \x03(\x0b\x32\x13.context.TopologyId\x12\'\n\x0bservice_ids\x18\x03 \x03(\x0b\x32\x12.context.ServiceId\x12/\n\ncontroller\x18\x04 \x01(\x0b\x32\x1b.context.TeraFlowController\"8\n\rContextIdList\x12\'\n\x0b\x63ontext_ids\x18\x01 \x03(\x0b\x32\x12.context.ContextId\"1\n\x0b\x43ontextList\x12\"\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32\x10.context.Context\"U\n\x0c\x43ontextEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\ncontext_id\x18\x02 \x01(\x0b\x32\x12.context.ContextId\"Z\n\nTopologyId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12$\n\rtopology_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"~\n\x08Topology\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12%\n\ndevice_ids\x18\x02 \x03(\x0b\x32\x11.context.DeviceId\x12!\n\x08link_ids\x18\x03 \x03(\x0b\x32\x0f.context.LinkId\";\n\x0eTopologyIdList\x12)\n\x0ctopology_ids\x18\x01 \x03(\x0b\x32\x13.context.TopologyId\"5\n\x0cTopologyList\x12%\n\ntopologies\x18\x01 \x03(\x0b\x32\x11.context.Topology\"X\n\rTopologyEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12(\n\x0btopology_id\x18\x02 \x01(\x0b\x32\x13.context.TopologyId\".\n\x08\x44\x65viceId\x12\"\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x9a\x02\n\x06\x44\x65vice\x12$\n\tdevice_id\x18\x01 \x01(\x0b\x32\x11.context.DeviceId\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12,\n\rdevice_config\x18\x03 \x01(\x0b\x32\x15.context.DeviceConfig\x12G\n\x19\x64\x65vice_operational_status\x18\x04 \x01(\x0e\x32$.context.DeviceOperationalStatusEnum\x12\x31\n\x0e\x64\x65vice_drivers\x18\x05 \x03(\x0e\x32\x19.context.DeviceDriverEnum\x12+\n\x10\x64\x65vice_endpoints\x18\x06 \x03(\x0b\x32\x11.context.EndPoint\"9\n\x0c\x44\x65viceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"5\n\x0c\x44\x65viceIdList\x12%\n\ndevice_ids\x18\x01 \x03(\x0b\x32\x11.context.DeviceId\".\n\nDeviceList\x12 \n\x07\x64\x65vices\x18\x01 \x03(\x0b\x32\x0f.context.Device\"R\n\x0b\x44\x65viceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"*\n\x06LinkId\x12 \n\tlink_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"X\n\x04Link\x12 \n\x07link_id\x18\x01 \x01(\x0b\x32\x0f.context.LinkId\x12.\n\x11link_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\"/\n\nLinkIdList\x12!\n\x08link_ids\x18\x01 \x03(\x0b\x32\x0f.context.LinkId\"(\n\x08LinkList\x12\x1c\n\x05links\x18\x01 \x03(\x0b\x32\r.context.Link\"L\n\tLinkEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12 \n\x07link_id\x18\x02 \x01(\x0b\x32\x0f.context.LinkId\"X\n\tServiceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12#\n\x0cservice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\xa6\x02\n\x07Service\x12&\n\nservice_id\x18\x01 \x01(\x0b\x32\x12.context.ServiceId\x12.\n\x0cservice_type\x18\x02 \x01(\x0e\x32\x18.context.ServiceTypeEnum\x12\x31\n\x14service_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12\x30\n\x13service_constraints\x18\x04 \x03(\x0b\x32\x13.context.Constraint\x12.\n\x0eservice_status\x18\x05 \x01(\x0b\x32\x16.context.ServiceStatus\x12.\n\x0eservice_config\x18\x06 \x01(\x0b\x32\x16.context.ServiceConfig\"C\n\rServiceStatus\x12\x32\n\x0eservice_status\x18\x01 \x01(\x0e\x32\x1a.context.ServiceStatusEnum\":\n\rServiceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"8\n\rServiceIdList\x12\'\n\x0bservice_ids\x18\x01 \x03(\x0b\x32\x12.context.ServiceId\"1\n\x0bServiceList\x12\"\n\x08services\x18\x01 \x03(\x0b\x32\x10.context.Service\"U\n\x0cServiceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\"T\n\x07SliceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12!\n\nslice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\x95\x02\n\x05Slice\x12\"\n\x08slice_id\x18\x01 \x01(\x0b\x32\x10.context.SliceId\x12/\n\x12slice_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\x12.\n\x11slice_constraints\x18\x03 \x03(\x0b\x32\x13.context.Constraint\x12-\n\x11slice_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\x12,\n\x12slice_subslice_ids\x18\x05 \x03(\x0b\x32\x10.context.SliceId\x12*\n\x0cslice_status\x18\x06 \x01(\x0b\x32\x14.context.SliceStatus\"=\n\x0bSliceStatus\x12.\n\x0cslice_status\x18\x01 \x01(\x0e\x32\x18.context.SliceStatusEnum\"2\n\x0bSliceIdList\x12#\n\tslice_ids\x18\x01 \x03(\x0b\x32\x10.context.SliceId\"+\n\tSliceList\x12\x1e\n\x06slices\x18\x01 \x03(\x0b\x32\x0e.context.Slice\"O\n\nSliceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12\"\n\x08slice_id\x18\x02 \x01(\x0b\x32\x10.context.SliceId\"6\n\x0c\x43onnectionId\x12&\n\x0f\x63onnection_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xc4\x01\n\nConnection\x12,\n\rconnection_id\x18\x01 \x01(\x0b\x32\x15.context.ConnectionId\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\x12\x33\n\x16path_hops_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12+\n\x0fsub_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\"A\n\x10\x43onnectionIdList\x12-\n\x0e\x63onnection_ids\x18\x01 \x03(\x0b\x32\x15.context.ConnectionId\":\n\x0e\x43onnectionList\x12(\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x13.context.Connection\"^\n\x0f\x43onnectionEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12,\n\rconnection_id\x18\x02 \x01(\x0b\x32\x15.context.ConnectionId\"\x82\x01\n\nEndPointId\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\x12$\n\rendpoint_uuid\x18\x03 \x01(\x0b\x32\r.context.Uuid\"\x86\x01\n\x08\x45ndPoint\x12(\n\x0b\x65ndpoint_id\x18\x01 \x01(\x0b\x32\x13.context.EndPointId\x12\x15\n\rendpoint_type\x18\x02 \x01(\t\x12\x39\n\x10kpi_sample_types\x18\x03 \x03(\x0e\x32\x1f.kpi_sample_types.KpiSampleType\"e\n\nConfigRule\x12)\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x19.context.ConfigActionEnum\x12\x14\n\x0cresource_key\x18\x02 \x01(\t\x12\x16\n\x0eresource_value\x18\x03 \x01(\t\"?\n\nConstraint\x12\x17\n\x0f\x63onstraint_type\x18\x01 \x01(\t\x12\x18\n\x10\x63onstraint_value\x18\x02 \x01(\t\"^\n\x12TeraFlowController\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x12\n\nip_address\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\"U\n\x14\x41uthenticationResult\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x15\n\rauthenticated\x18\x02 \x01(\x08*j\n\rEventTypeEnum\x12\x17\n\x13\x45VENTTYPE_UNDEFINED\x10\x00\x12\x14\n\x10\x45VENTTYPE_CREATE\x10\x01\x12\x14\n\x10\x45VENTTYPE_UPDATE\x10\x02\x12\x14\n\x10\x45VENTTYPE_REMOVE\x10\x03*\xc5\x01\n\x10\x44\x65viceDriverEnum\x12\x1a\n\x16\x44\x45VICEDRIVER_UNDEFINED\x10\x00\x12\x1b\n\x17\x44\x45VICEDRIVER_OPENCONFIG\x10\x01\x12\x1e\n\x1a\x44\x45VICEDRIVER_TRANSPORT_API\x10\x02\x12\x13\n\x0f\x44\x45VICEDRIVER_P4\x10\x03\x12&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOGY\x10\x04\x12\x1b\n\x17\x44\x45VICEDRIVER_ONF_TR_352\x10\x05*\x8f\x01\n\x1b\x44\x65viceOperationalStatusEnum\x12%\n!DEVICEOPERATIONALSTATUS_UNDEFINED\x10\x00\x12$\n DEVICEOPERATIONALSTATUS_DISABLED\x10\x01\x12#\n\x1f\x44\x45VICEOPERATIONALSTATUS_ENABLED\x10\x02*\x81\x01\n\x0fServiceTypeEnum\x12\x17\n\x13SERVICETYPE_UNKNOWN\x10\x00\x12\x14\n\x10SERVICETYPE_L3NM\x10\x01\x12\x14\n\x10SERVICETYPE_L2NM\x10\x02\x12)\n%SERVICETYPE_TAPI_CONNECTIVITY_SERVICE\x10\x03*\x88\x01\n\x11ServiceStatusEnum\x12\x1b\n\x17SERVICESTATUS_UNDEFINED\x10\x00\x12\x19\n\x15SERVICESTATUS_PLANNED\x10\x01\x12\x18\n\x14SERVICESTATUS_ACTIVE\x10\x02\x12!\n\x1dSERVICESTATUS_PENDING_REMOVAL\x10\x03*\x8b\x01\n\x0fSliceStatusEnum\x12\x19\n\x15SLICESTATUS_UNDEFINED\x10\x00\x12\x17\n\x13SLICESTATUS_PLANNED\x10\x01\x12\x14\n\x10SLICESTATUS_INIT\x10\x02\x12\x16\n\x12SLICESTATUS_ACTIVE\x10\x03\x12\x16\n\x12SLICESTATUS_DEINIT\x10\x04*]\n\x10\x43onfigActionEnum\x12\x1a\n\x16\x43ONFIGACTION_UNDEFINED\x10\x00\x12\x14\n\x10\x43ONFIGACTION_SET\x10\x01\x12\x17\n\x13\x43ONFIGACTION_DELETE\x10\x02\x32\xef\x12\n\x0e\x43ontextService\x12:\n\x0eListContextIds\x12\x0e.context.Empty\x1a\x16.context.ContextIdList\"\x00\x12\x36\n\x0cListContexts\x12\x0e.context.Empty\x1a\x14.context.ContextList\"\x00\x12\x34\n\nGetContext\x12\x12.context.ContextId\x1a\x10.context.Context\"\x00\x12\x34\n\nSetContext\x12\x10.context.Context\x1a\x12.context.ContextId\"\x00\x12\x35\n\rRemoveContext\x12\x12.context.ContextId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetContextEvents\x12\x0e.context.Empty\x1a\x15.context.ContextEvent\"\x00\x30\x01\x12@\n\x0fListTopologyIds\x12\x12.context.ContextId\x1a\x17.context.TopologyIdList\"\x00\x12=\n\x0eListTopologies\x12\x12.context.ContextId\x1a\x15.context.TopologyList\"\x00\x12\x37\n\x0bGetTopology\x12\x13.context.TopologyId\x1a\x11.context.Topology\"\x00\x12\x37\n\x0bSetTopology\x12\x11.context.Topology\x1a\x13.context.TopologyId\"\x00\x12\x37\n\x0eRemoveTopology\x12\x13.context.TopologyId\x1a\x0e.context.Empty\"\x00\x12?\n\x11GetTopologyEvents\x12\x0e.context.Empty\x1a\x16.context.TopologyEvent\"\x00\x30\x01\x12\x38\n\rListDeviceIds\x12\x0e.context.Empty\x1a\x15.context.DeviceIdList\"\x00\x12\x34\n\x0bListDevices\x12\x0e.context.Empty\x1a\x13.context.DeviceList\"\x00\x12\x31\n\tGetDevice\x12\x11.context.DeviceId\x1a\x0f.context.Device\"\x00\x12\x31\n\tSetDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0cRemoveDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x12;\n\x0fGetDeviceEvents\x12\x0e.context.Empty\x1a\x14.context.DeviceEvent\"\x00\x30\x01\x12\x34\n\x0bListLinkIds\x12\x0e.context.Empty\x1a\x13.context.LinkIdList\"\x00\x12\x30\n\tListLinks\x12\x0e.context.Empty\x1a\x11.context.LinkList\"\x00\x12+\n\x07GetLink\x12\x0f.context.LinkId\x1a\r.context.Link\"\x00\x12+\n\x07SetLink\x12\r.context.Link\x1a\x0f.context.LinkId\"\x00\x12/\n\nRemoveLink\x12\x0f.context.LinkId\x1a\x0e.context.Empty\"\x00\x12\x37\n\rGetLinkEvents\x12\x0e.context.Empty\x1a\x12.context.LinkEvent\"\x00\x30\x01\x12>\n\x0eListServiceIds\x12\x12.context.ContextId\x1a\x16.context.ServiceIdList\"\x00\x12:\n\x0cListServices\x12\x12.context.ContextId\x1a\x14.context.ServiceList\"\x00\x12\x34\n\nGetService\x12\x12.context.ServiceId\x1a\x10.context.Service\"\x00\x12\x34\n\nSetService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rRemoveService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetServiceEvents\x12\x0e.context.Empty\x1a\x15.context.ServiceEvent\"\x00\x30\x01\x12:\n\x0cListSliceIds\x12\x12.context.ContextId\x1a\x14.context.SliceIdList\"\x00\x12\x36\n\nListSlices\x12\x12.context.ContextId\x1a\x12.context.SliceList\"\x00\x12.\n\x08GetSlice\x12\x10.context.SliceId\x1a\x0e.context.Slice\"\x00\x12.\n\x08SetSlice\x12\x0e.context.Slice\x1a\x10.context.SliceId\"\x00\x12\x31\n\x0bRemoveSlice\x12\x10.context.SliceId\x1a\x0e.context.Empty\"\x00\x12\x39\n\x0eGetSliceEvents\x12\x0e.context.Empty\x1a\x13.context.SliceEvent\"\x00\x30\x01\x12\x44\n\x11ListConnectionIds\x12\x12.context.ServiceId\x1a\x19.context.ConnectionIdList\"\x00\x12@\n\x0fListConnections\x12\x12.context.ServiceId\x1a\x17.context.ConnectionList\"\x00\x12=\n\rGetConnection\x12\x15.context.ConnectionId\x1a\x13.context.Connection\"\x00\x12=\n\rSetConnection\x12\x13.context.Connection\x1a\x15.context.ConnectionId\"\x00\x12;\n\x10RemoveConnection\x12\x15.context.ConnectionId\x1a\x0e.context.Empty\"\x00\x12\x43\n\x13GetConnectionEvents\x12\x0e.context.Empty\x1a\x18.context.ConnectionEvent\"\x00\x30\x01\x62\x06proto3' , dependencies=[kpi__sample__types__pb2.DESCRIPTOR,]) @@ -55,8 +55,8 @@ _EVENTTYPEENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=3703, - serialized_end=3809, + serialized_start=4310, + serialized_end=4416, ) _sym_db.RegisterEnumDescriptor(_EVENTTYPEENUM) @@ -101,8 +101,8 @@ _DEVICEDRIVERENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=3812, - serialized_end=4009, + serialized_start=4419, + serialized_end=4616, ) _sym_db.RegisterEnumDescriptor(_DEVICEDRIVERENUM) @@ -132,8 +132,8 @@ _DEVICEOPERATIONALSTATUSENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4012, - serialized_end=4155, + serialized_start=4619, + serialized_end=4762, ) _sym_db.RegisterEnumDescriptor(_DEVICEOPERATIONALSTATUSENUM) @@ -168,8 +168,8 @@ _SERVICETYPEENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4158, - serialized_end=4287, + serialized_start=4765, + serialized_end=4894, ) _sym_db.RegisterEnumDescriptor(_SERVICETYPEENUM) @@ -204,12 +204,53 @@ _SERVICESTATUSENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4290, - serialized_end=4426, + serialized_start=4897, + serialized_end=5033, ) _sym_db.RegisterEnumDescriptor(_SERVICESTATUSENUM) ServiceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICESTATUSENUM) +_SLICESTATUSENUM = _descriptor.EnumDescriptor( + name='SliceStatusEnum', + full_name='context.SliceStatusEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_PLANNED', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_INIT', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_ACTIVE', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_DEINIT', index=4, number=4, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=5036, + serialized_end=5175, +) +_sym_db.RegisterEnumDescriptor(_SLICESTATUSENUM) + +SliceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SLICESTATUSENUM) _CONFIGACTIONENUM = _descriptor.EnumDescriptor( name='ConfigActionEnum', full_name='context.ConfigActionEnum', @@ -235,8 +276,8 @@ _CONFIGACTIONENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4428, - serialized_end=4521, + serialized_start=5177, + serialized_end=5270, ) _sym_db.RegisterEnumDescriptor(_CONFIGACTIONENUM) @@ -262,6 +303,11 @@ SERVICESTATUS_UNDEFINED = 0 SERVICESTATUS_PLANNED = 1 SERVICESTATUS_ACTIVE = 2 SERVICESTATUS_PENDING_REMOVAL = 3 +SLICESTATUS_UNDEFINED = 0 +SLICESTATUS_PLANNED = 1 +SLICESTATUS_INIT = 2 +SLICESTATUS_ACTIVE = 3 +SLICESTATUS_DEINIT = 4 CONFIGACTION_UNDEFINED = 0 CONFIGACTION_SET = 1 CONFIGACTION_DELETE = 2 @@ -1421,6 +1467,247 @@ _SERVICEEVENT = _descriptor.Descriptor( ) +_SLICEID = _descriptor.Descriptor( + name='SliceId', + full_name='context.SliceId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_id', full_name='context.SliceId.context_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_uuid', full_name='context.SliceId.slice_uuid', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2604, + serialized_end=2688, +) + + +_SLICE = _descriptor.Descriptor( + name='Slice', + full_name='context.Slice', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_id', full_name='context.Slice.slice_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_endpoint_ids', full_name='context.Slice.slice_endpoint_ids', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_constraints', full_name='context.Slice.slice_constraints', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_service_ids', full_name='context.Slice.slice_service_ids', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_subslice_ids', full_name='context.Slice.slice_subslice_ids', index=4, + number=5, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_status', full_name='context.Slice.slice_status', index=5, + number=6, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2691, + serialized_end=2968, +) + + +_SLICESTATUS = _descriptor.Descriptor( + name='SliceStatus', + full_name='context.SliceStatus', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_status', full_name='context.SliceStatus.slice_status', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2970, + serialized_end=3031, +) + + +_SLICEIDLIST = _descriptor.Descriptor( + name='SliceIdList', + full_name='context.SliceIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_ids', full_name='context.SliceIdList.slice_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3033, + serialized_end=3083, +) + + +_SLICELIST = _descriptor.Descriptor( + name='SliceList', + full_name='context.SliceList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slices', full_name='context.SliceList.slices', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3085, + serialized_end=3128, +) + + +_SLICEEVENT = _descriptor.Descriptor( + name='SliceEvent', + full_name='context.SliceEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.SliceEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_id', full_name='context.SliceEvent.slice_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3130, + serialized_end=3209, +) + + _CONNECTIONID = _descriptor.Descriptor( name='ConnectionId', full_name='context.ConnectionId', @@ -1448,8 +1735,8 @@ _CONNECTIONID = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2604, - serialized_end=2658, + serialized_start=3211, + serialized_end=3265, ) @@ -1501,8 +1788,8 @@ _CONNECTION = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2661, - serialized_end=2857, + serialized_start=3268, + serialized_end=3464, ) @@ -1533,8 +1820,8 @@ _CONNECTIONIDLIST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2859, - serialized_end=2924, + serialized_start=3466, + serialized_end=3531, ) @@ -1565,8 +1852,8 @@ _CONNECTIONLIST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2926, - serialized_end=2984, + serialized_start=3533, + serialized_end=3591, ) @@ -1604,8 +1891,8 @@ _CONNECTIONEVENT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2986, - serialized_end=3080, + serialized_start=3593, + serialized_end=3687, ) @@ -1650,8 +1937,8 @@ _ENDPOINTID = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3083, - serialized_end=3213, + serialized_start=3690, + serialized_end=3820, ) @@ -1696,8 +1983,8 @@ _ENDPOINT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3216, - serialized_end=3350, + serialized_start=3823, + serialized_end=3957, ) @@ -1742,8 +2029,8 @@ _CONFIGRULE = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3352, - serialized_end=3453, + serialized_start=3959, + serialized_end=4060, ) @@ -1781,8 +2068,8 @@ _CONSTRAINT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3455, - serialized_end=3518, + serialized_start=4062, + serialized_end=4125, ) @@ -1827,8 +2114,8 @@ _TERAFLOWCONTROLLER = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3520, - serialized_end=3614, + serialized_start=4127, + serialized_end=4221, ) @@ -1866,8 +2153,8 @@ _AUTHENTICATIONRESULT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3616, - serialized_end=3701, + serialized_start=4223, + serialized_end=4308, ) _EVENT.fields_by_name['event_type'].enum_type = _EVENTTYPEENUM @@ -1921,6 +2208,19 @@ _SERVICEIDLIST.fields_by_name['service_ids'].message_type = _SERVICEID _SERVICELIST.fields_by_name['services'].message_type = _SERVICE _SERVICEEVENT.fields_by_name['event'].message_type = _EVENT _SERVICEEVENT.fields_by_name['service_id'].message_type = _SERVICEID +_SLICEID.fields_by_name['context_id'].message_type = _CONTEXTID +_SLICEID.fields_by_name['slice_uuid'].message_type = _UUID +_SLICE.fields_by_name['slice_id'].message_type = _SLICEID +_SLICE.fields_by_name['slice_endpoint_ids'].message_type = _ENDPOINTID +_SLICE.fields_by_name['slice_constraints'].message_type = _CONSTRAINT +_SLICE.fields_by_name['slice_service_ids'].message_type = _SERVICEID +_SLICE.fields_by_name['slice_subslice_ids'].message_type = _SLICEID +_SLICE.fields_by_name['slice_status'].message_type = _SLICESTATUS +_SLICESTATUS.fields_by_name['slice_status'].enum_type = _SLICESTATUSENUM +_SLICEIDLIST.fields_by_name['slice_ids'].message_type = _SLICEID +_SLICELIST.fields_by_name['slices'].message_type = _SLICE +_SLICEEVENT.fields_by_name['event'].message_type = _EVENT +_SLICEEVENT.fields_by_name['slice_id'].message_type = _SLICEID _CONNECTIONID.fields_by_name['connection_uuid'].message_type = _UUID _CONNECTION.fields_by_name['connection_id'].message_type = _CONNECTIONID _CONNECTION.fields_by_name['service_id'].message_type = _SERVICEID @@ -1969,6 +2269,12 @@ DESCRIPTOR.message_types_by_name['ServiceConfig'] = _SERVICECONFIG DESCRIPTOR.message_types_by_name['ServiceIdList'] = _SERVICEIDLIST DESCRIPTOR.message_types_by_name['ServiceList'] = _SERVICELIST DESCRIPTOR.message_types_by_name['ServiceEvent'] = _SERVICEEVENT +DESCRIPTOR.message_types_by_name['SliceId'] = _SLICEID +DESCRIPTOR.message_types_by_name['Slice'] = _SLICE +DESCRIPTOR.message_types_by_name['SliceStatus'] = _SLICESTATUS +DESCRIPTOR.message_types_by_name['SliceIdList'] = _SLICEIDLIST +DESCRIPTOR.message_types_by_name['SliceList'] = _SLICELIST +DESCRIPTOR.message_types_by_name['SliceEvent'] = _SLICEEVENT DESCRIPTOR.message_types_by_name['ConnectionId'] = _CONNECTIONID DESCRIPTOR.message_types_by_name['Connection'] = _CONNECTION DESCRIPTOR.message_types_by_name['ConnectionIdList'] = _CONNECTIONIDLIST @@ -1985,6 +2291,7 @@ DESCRIPTOR.enum_types_by_name['DeviceDriverEnum'] = _DEVICEDRIVERENUM DESCRIPTOR.enum_types_by_name['DeviceOperationalStatusEnum'] = _DEVICEOPERATIONALSTATUSENUM DESCRIPTOR.enum_types_by_name['ServiceTypeEnum'] = _SERVICETYPEENUM DESCRIPTOR.enum_types_by_name['ServiceStatusEnum'] = _SERVICESTATUSENUM +DESCRIPTOR.enum_types_by_name['SliceStatusEnum'] = _SLICESTATUSENUM DESCRIPTOR.enum_types_by_name['ConfigActionEnum'] = _CONFIGACTIONENUM _sym_db.RegisterFileDescriptor(DESCRIPTOR) @@ -2205,6 +2512,48 @@ ServiceEvent = _reflection.GeneratedProtocolMessageType('ServiceEvent', (_messag }) _sym_db.RegisterMessage(ServiceEvent) +SliceId = _reflection.GeneratedProtocolMessageType('SliceId', (_message.Message,), { + 'DESCRIPTOR' : _SLICEID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceId) + }) +_sym_db.RegisterMessage(SliceId) + +Slice = _reflection.GeneratedProtocolMessageType('Slice', (_message.Message,), { + 'DESCRIPTOR' : _SLICE, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Slice) + }) +_sym_db.RegisterMessage(Slice) + +SliceStatus = _reflection.GeneratedProtocolMessageType('SliceStatus', (_message.Message,), { + 'DESCRIPTOR' : _SLICESTATUS, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceStatus) + }) +_sym_db.RegisterMessage(SliceStatus) + +SliceIdList = _reflection.GeneratedProtocolMessageType('SliceIdList', (_message.Message,), { + 'DESCRIPTOR' : _SLICEIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceIdList) + }) +_sym_db.RegisterMessage(SliceIdList) + +SliceList = _reflection.GeneratedProtocolMessageType('SliceList', (_message.Message,), { + 'DESCRIPTOR' : _SLICELIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceList) + }) +_sym_db.RegisterMessage(SliceList) + +SliceEvent = _reflection.GeneratedProtocolMessageType('SliceEvent', (_message.Message,), { + 'DESCRIPTOR' : _SLICEEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceEvent) + }) +_sym_db.RegisterMessage(SliceEvent) + ConnectionId = _reflection.GeneratedProtocolMessageType('ConnectionId', (_message.Message,), { 'DESCRIPTOR' : _CONNECTIONID, '__module__' : 'context_pb2' @@ -2291,8 +2640,8 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( index=0, serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_start=4524, - serialized_end=6617, + serialized_start=5273, + serialized_end=7688, methods=[ _descriptor.MethodDescriptor( name='ListContextIds', @@ -2594,10 +2943,70 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( serialized_options=None, create_key=_descriptor._internal_create_key, ), + _descriptor.MethodDescriptor( + name='ListSliceIds', + full_name='context.ContextService.ListSliceIds', + index=30, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SLICEIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListSlices', + full_name='context.ContextService.ListSlices', + index=31, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SLICELIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetSlice', + full_name='context.ContextService.GetSlice', + index=32, + containing_service=None, + input_type=_SLICEID, + output_type=_SLICE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetSlice', + full_name='context.ContextService.SetSlice', + index=33, + containing_service=None, + input_type=_SLICE, + output_type=_SLICEID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveSlice', + full_name='context.ContextService.RemoveSlice', + index=34, + containing_service=None, + input_type=_SLICEID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetSliceEvents', + full_name='context.ContextService.GetSliceEvents', + index=35, + containing_service=None, + input_type=_EMPTY, + output_type=_SLICEEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), _descriptor.MethodDescriptor( name='ListConnectionIds', full_name='context.ContextService.ListConnectionIds', - index=30, + index=36, containing_service=None, input_type=_SERVICEID, output_type=_CONNECTIONIDLIST, @@ -2607,7 +3016,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='ListConnections', full_name='context.ContextService.ListConnections', - index=31, + index=37, containing_service=None, input_type=_SERVICEID, output_type=_CONNECTIONLIST, @@ -2617,7 +3026,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='GetConnection', full_name='context.ContextService.GetConnection', - index=32, + index=38, containing_service=None, input_type=_CONNECTIONID, output_type=_CONNECTION, @@ -2627,7 +3036,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='SetConnection', full_name='context.ContextService.SetConnection', - index=33, + index=39, containing_service=None, input_type=_CONNECTION, output_type=_CONNECTIONID, @@ -2637,7 +3046,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='RemoveConnection', full_name='context.ContextService.RemoveConnection', - index=34, + index=40, containing_service=None, input_type=_CONNECTIONID, output_type=_EMPTY, @@ -2647,7 +3056,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='GetConnectionEvents', full_name='context.ContextService.GetConnectionEvents', - index=35, + index=41, containing_service=None, input_type=_EMPTY, output_type=_CONNECTIONEVENT, diff --git a/src/opticalcentralizedattackdetector/.gitlab-ci.yml b/src/opticalcentralizedattackdetector/.gitlab-ci.yml index 8a1445e80347fe64dac1beb1780894fa98ba85fd..c3d91aec6e10c7450cfda0b74d0bc3bbe613558b 100644 --- a/src/opticalcentralizedattackdetector/.gitlab-ci.yml +++ b/src/opticalcentralizedattackdetector/.gitlab-ci.yml @@ -55,7 +55,6 @@ unit test opticalcentralizedattackdetector: - sleep 5 - docker ps -a - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml" - - docker exec -i $IMAGE_NAME bash -c "coverage xml -o /opt/results/${IMAGE_NAME}_coverage.xml" - docker exec -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing" coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' after_script: @@ -75,7 +74,6 @@ unit test opticalcentralizedattackdetector: when: always reports: junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml - cobertura: src/$IMAGE_NAME/tests/${IMAGE_NAME}_coverage.xml # Deployment of the opticalcentralizedattackdetector service in Kubernetes Cluster diff --git a/src/opticalcentralizedattackdetector/genproto.sh b/src/opticalcentralizedattackdetector/genproto.sh index 76df9bf83af19ac8f1528c750b7d7f11e0a97cf3..855231cce17081a359cc510423f877d58833430d 100755 --- a/src/opticalcentralizedattackdetector/genproto.sh +++ b/src/opticalcentralizedattackdetector/genproto.sh @@ -1,6 +1,6 @@ #!/bin/bash -eu # -# Copyright 2018 Google LLC +# 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. @@ -14,14 +14,27 @@ # See the License for the specific language governing permissions and # limitations under the License. -#!/bin/bash -e - # Make folder containing the script the root folder for its execution cd $(dirname $0) rm -rf proto/*.py rm -rf proto/__pycache__ -touch proto/__init__.py +tee proto/__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 # building protos of services used python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto context.proto diff --git a/src/opticalcentralizedattackdetector/proto/context_pb2.py b/src/opticalcentralizedattackdetector/proto/context_pb2.py index 68602b16f264ceac9acc3ef6669b09d5984e72c2..50d501d3ac053ad644554331af26e3c40cd426a1 100644 --- a/src/opticalcentralizedattackdetector/proto/context_pb2.py +++ b/src/opticalcentralizedattackdetector/proto/context_pb2.py @@ -21,7 +21,7 @@ DESCRIPTOR = _descriptor.FileDescriptor( syntax='proto3', serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\rcontext.proto\x12\x07\x63ontext\x1a\x16kpi_sample_types.proto\"\x07\n\x05\x45mpty\"\x14\n\x04Uuid\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"F\n\x05\x45vent\x12\x11\n\ttimestamp\x18\x01 \x01(\x01\x12*\n\nevent_type\x18\x02 \x01(\x0e\x32\x16.context.EventTypeEnum\"0\n\tContextId\x12#\n\x0c\x63ontext_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xb6\x01\n\x07\x43ontext\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12)\n\x0ctopology_ids\x18\x02 \x03(\x0b\x32\x13.context.TopologyId\x12\'\n\x0bservice_ids\x18\x03 \x03(\x0b\x32\x12.context.ServiceId\x12/\n\ncontroller\x18\x04 \x01(\x0b\x32\x1b.context.TeraFlowController\"8\n\rContextIdList\x12\'\n\x0b\x63ontext_ids\x18\x01 \x03(\x0b\x32\x12.context.ContextId\"1\n\x0b\x43ontextList\x12\"\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32\x10.context.Context\"U\n\x0c\x43ontextEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\ncontext_id\x18\x02 \x01(\x0b\x32\x12.context.ContextId\"Z\n\nTopologyId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12$\n\rtopology_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"~\n\x08Topology\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12%\n\ndevice_ids\x18\x02 \x03(\x0b\x32\x11.context.DeviceId\x12!\n\x08link_ids\x18\x03 \x03(\x0b\x32\x0f.context.LinkId\";\n\x0eTopologyIdList\x12)\n\x0ctopology_ids\x18\x01 \x03(\x0b\x32\x13.context.TopologyId\"5\n\x0cTopologyList\x12%\n\ntopologies\x18\x01 \x03(\x0b\x32\x11.context.Topology\"X\n\rTopologyEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12(\n\x0btopology_id\x18\x02 \x01(\x0b\x32\x13.context.TopologyId\".\n\x08\x44\x65viceId\x12\"\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x9a\x02\n\x06\x44\x65vice\x12$\n\tdevice_id\x18\x01 \x01(\x0b\x32\x11.context.DeviceId\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12,\n\rdevice_config\x18\x03 \x01(\x0b\x32\x15.context.DeviceConfig\x12G\n\x19\x64\x65vice_operational_status\x18\x04 \x01(\x0e\x32$.context.DeviceOperationalStatusEnum\x12\x31\n\x0e\x64\x65vice_drivers\x18\x05 \x03(\x0e\x32\x19.context.DeviceDriverEnum\x12+\n\x10\x64\x65vice_endpoints\x18\x06 \x03(\x0b\x32\x11.context.EndPoint\"9\n\x0c\x44\x65viceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"5\n\x0c\x44\x65viceIdList\x12%\n\ndevice_ids\x18\x01 \x03(\x0b\x32\x11.context.DeviceId\".\n\nDeviceList\x12 \n\x07\x64\x65vices\x18\x01 \x03(\x0b\x32\x0f.context.Device\"R\n\x0b\x44\x65viceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"*\n\x06LinkId\x12 \n\tlink_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"X\n\x04Link\x12 \n\x07link_id\x18\x01 \x01(\x0b\x32\x0f.context.LinkId\x12.\n\x11link_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\"/\n\nLinkIdList\x12!\n\x08link_ids\x18\x01 \x03(\x0b\x32\x0f.context.LinkId\"(\n\x08LinkList\x12\x1c\n\x05links\x18\x01 \x03(\x0b\x32\r.context.Link\"L\n\tLinkEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12 \n\x07link_id\x18\x02 \x01(\x0b\x32\x0f.context.LinkId\"X\n\tServiceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12#\n\x0cservice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\xa6\x02\n\x07Service\x12&\n\nservice_id\x18\x01 \x01(\x0b\x32\x12.context.ServiceId\x12.\n\x0cservice_type\x18\x02 \x01(\x0e\x32\x18.context.ServiceTypeEnum\x12\x31\n\x14service_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12\x30\n\x13service_constraints\x18\x04 \x03(\x0b\x32\x13.context.Constraint\x12.\n\x0eservice_status\x18\x05 \x01(\x0b\x32\x16.context.ServiceStatus\x12.\n\x0eservice_config\x18\x06 \x01(\x0b\x32\x16.context.ServiceConfig\"C\n\rServiceStatus\x12\x32\n\x0eservice_status\x18\x01 \x01(\x0e\x32\x1a.context.ServiceStatusEnum\":\n\rServiceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"8\n\rServiceIdList\x12\'\n\x0bservice_ids\x18\x01 \x03(\x0b\x32\x12.context.ServiceId\"1\n\x0bServiceList\x12\"\n\x08services\x18\x01 \x03(\x0b\x32\x10.context.Service\"U\n\x0cServiceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\"6\n\x0c\x43onnectionId\x12&\n\x0f\x63onnection_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xc4\x01\n\nConnection\x12,\n\rconnection_id\x18\x01 \x01(\x0b\x32\x15.context.ConnectionId\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\x12\x33\n\x16path_hops_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12+\n\x0fsub_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\"A\n\x10\x43onnectionIdList\x12-\n\x0e\x63onnection_ids\x18\x01 \x03(\x0b\x32\x15.context.ConnectionId\":\n\x0e\x43onnectionList\x12(\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x13.context.Connection\"^\n\x0f\x43onnectionEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12,\n\rconnection_id\x18\x02 \x01(\x0b\x32\x15.context.ConnectionId\"\x82\x01\n\nEndPointId\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\x12$\n\rendpoint_uuid\x18\x03 \x01(\x0b\x32\r.context.Uuid\"\x86\x01\n\x08\x45ndPoint\x12(\n\x0b\x65ndpoint_id\x18\x01 \x01(\x0b\x32\x13.context.EndPointId\x12\x15\n\rendpoint_type\x18\x02 \x01(\t\x12\x39\n\x10kpi_sample_types\x18\x03 \x03(\x0e\x32\x1f.kpi_sample_types.KpiSampleType\"e\n\nConfigRule\x12)\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x19.context.ConfigActionEnum\x12\x14\n\x0cresource_key\x18\x02 \x01(\t\x12\x16\n\x0eresource_value\x18\x03 \x01(\t\"?\n\nConstraint\x12\x17\n\x0f\x63onstraint_type\x18\x01 \x01(\t\x12\x18\n\x10\x63onstraint_value\x18\x02 \x01(\t\"^\n\x12TeraFlowController\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x12\n\nip_address\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\"U\n\x14\x41uthenticationResult\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x15\n\rauthenticated\x18\x02 \x01(\x08*j\n\rEventTypeEnum\x12\x17\n\x13\x45VENTTYPE_UNDEFINED\x10\x00\x12\x14\n\x10\x45VENTTYPE_CREATE\x10\x01\x12\x14\n\x10\x45VENTTYPE_UPDATE\x10\x02\x12\x14\n\x10\x45VENTTYPE_REMOVE\x10\x03*\xc5\x01\n\x10\x44\x65viceDriverEnum\x12\x1a\n\x16\x44\x45VICEDRIVER_UNDEFINED\x10\x00\x12\x1b\n\x17\x44\x45VICEDRIVER_OPENCONFIG\x10\x01\x12\x1e\n\x1a\x44\x45VICEDRIVER_TRANSPORT_API\x10\x02\x12\x13\n\x0f\x44\x45VICEDRIVER_P4\x10\x03\x12&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOGY\x10\x04\x12\x1b\n\x17\x44\x45VICEDRIVER_ONF_TR_352\x10\x05*\x8f\x01\n\x1b\x44\x65viceOperationalStatusEnum\x12%\n!DEVICEOPERATIONALSTATUS_UNDEFINED\x10\x00\x12$\n DEVICEOPERATIONALSTATUS_DISABLED\x10\x01\x12#\n\x1f\x44\x45VICEOPERATIONALSTATUS_ENABLED\x10\x02*\x81\x01\n\x0fServiceTypeEnum\x12\x17\n\x13SERVICETYPE_UNKNOWN\x10\x00\x12\x14\n\x10SERVICETYPE_L3NM\x10\x01\x12\x14\n\x10SERVICETYPE_L2NM\x10\x02\x12)\n%SERVICETYPE_TAPI_CONNECTIVITY_SERVICE\x10\x03*\x88\x01\n\x11ServiceStatusEnum\x12\x1b\n\x17SERVICESTATUS_UNDEFINED\x10\x00\x12\x19\n\x15SERVICESTATUS_PLANNED\x10\x01\x12\x18\n\x14SERVICESTATUS_ACTIVE\x10\x02\x12!\n\x1dSERVICESTATUS_PENDING_REMOVAL\x10\x03*]\n\x10\x43onfigActionEnum\x12\x1a\n\x16\x43ONFIGACTION_UNDEFINED\x10\x00\x12\x14\n\x10\x43ONFIGACTION_SET\x10\x01\x12\x17\n\x13\x43ONFIGACTION_DELETE\x10\x02\x32\xad\x10\n\x0e\x43ontextService\x12:\n\x0eListContextIds\x12\x0e.context.Empty\x1a\x16.context.ContextIdList\"\x00\x12\x36\n\x0cListContexts\x12\x0e.context.Empty\x1a\x14.context.ContextList\"\x00\x12\x34\n\nGetContext\x12\x12.context.ContextId\x1a\x10.context.Context\"\x00\x12\x34\n\nSetContext\x12\x10.context.Context\x1a\x12.context.ContextId\"\x00\x12\x35\n\rRemoveContext\x12\x12.context.ContextId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetContextEvents\x12\x0e.context.Empty\x1a\x15.context.ContextEvent\"\x00\x30\x01\x12@\n\x0fListTopologyIds\x12\x12.context.ContextId\x1a\x17.context.TopologyIdList\"\x00\x12=\n\x0eListTopologies\x12\x12.context.ContextId\x1a\x15.context.TopologyList\"\x00\x12\x37\n\x0bGetTopology\x12\x13.context.TopologyId\x1a\x11.context.Topology\"\x00\x12\x37\n\x0bSetTopology\x12\x11.context.Topology\x1a\x13.context.TopologyId\"\x00\x12\x37\n\x0eRemoveTopology\x12\x13.context.TopologyId\x1a\x0e.context.Empty\"\x00\x12?\n\x11GetTopologyEvents\x12\x0e.context.Empty\x1a\x16.context.TopologyEvent\"\x00\x30\x01\x12\x38\n\rListDeviceIds\x12\x0e.context.Empty\x1a\x15.context.DeviceIdList\"\x00\x12\x34\n\x0bListDevices\x12\x0e.context.Empty\x1a\x13.context.DeviceList\"\x00\x12\x31\n\tGetDevice\x12\x11.context.DeviceId\x1a\x0f.context.Device\"\x00\x12\x31\n\tSetDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0cRemoveDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x12;\n\x0fGetDeviceEvents\x12\x0e.context.Empty\x1a\x14.context.DeviceEvent\"\x00\x30\x01\x12\x34\n\x0bListLinkIds\x12\x0e.context.Empty\x1a\x13.context.LinkIdList\"\x00\x12\x30\n\tListLinks\x12\x0e.context.Empty\x1a\x11.context.LinkList\"\x00\x12+\n\x07GetLink\x12\x0f.context.LinkId\x1a\r.context.Link\"\x00\x12+\n\x07SetLink\x12\r.context.Link\x1a\x0f.context.LinkId\"\x00\x12/\n\nRemoveLink\x12\x0f.context.LinkId\x1a\x0e.context.Empty\"\x00\x12\x37\n\rGetLinkEvents\x12\x0e.context.Empty\x1a\x12.context.LinkEvent\"\x00\x30\x01\x12>\n\x0eListServiceIds\x12\x12.context.ContextId\x1a\x16.context.ServiceIdList\"\x00\x12:\n\x0cListServices\x12\x12.context.ContextId\x1a\x14.context.ServiceList\"\x00\x12\x34\n\nGetService\x12\x12.context.ServiceId\x1a\x10.context.Service\"\x00\x12\x34\n\nSetService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rRemoveService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetServiceEvents\x12\x0e.context.Empty\x1a\x15.context.ServiceEvent\"\x00\x30\x01\x12\x44\n\x11ListConnectionIds\x12\x12.context.ServiceId\x1a\x19.context.ConnectionIdList\"\x00\x12@\n\x0fListConnections\x12\x12.context.ServiceId\x1a\x17.context.ConnectionList\"\x00\x12=\n\rGetConnection\x12\x15.context.ConnectionId\x1a\x13.context.Connection\"\x00\x12=\n\rSetConnection\x12\x13.context.Connection\x1a\x15.context.ConnectionId\"\x00\x12;\n\x10RemoveConnection\x12\x15.context.ConnectionId\x1a\x0e.context.Empty\"\x00\x12\x43\n\x13GetConnectionEvents\x12\x0e.context.Empty\x1a\x18.context.ConnectionEvent\"\x00\x30\x01\x62\x06proto3' + serialized_pb=b'\n\rcontext.proto\x12\x07\x63ontext\x1a\x16kpi_sample_types.proto\"\x07\n\x05\x45mpty\"\x14\n\x04Uuid\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"F\n\x05\x45vent\x12\x11\n\ttimestamp\x18\x01 \x01(\x01\x12*\n\nevent_type\x18\x02 \x01(\x0e\x32\x16.context.EventTypeEnum\"0\n\tContextId\x12#\n\x0c\x63ontext_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xb6\x01\n\x07\x43ontext\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12)\n\x0ctopology_ids\x18\x02 \x03(\x0b\x32\x13.context.TopologyId\x12\'\n\x0bservice_ids\x18\x03 \x03(\x0b\x32\x12.context.ServiceId\x12/\n\ncontroller\x18\x04 \x01(\x0b\x32\x1b.context.TeraFlowController\"8\n\rContextIdList\x12\'\n\x0b\x63ontext_ids\x18\x01 \x03(\x0b\x32\x12.context.ContextId\"1\n\x0b\x43ontextList\x12\"\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32\x10.context.Context\"U\n\x0c\x43ontextEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\ncontext_id\x18\x02 \x01(\x0b\x32\x12.context.ContextId\"Z\n\nTopologyId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12$\n\rtopology_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"~\n\x08Topology\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12%\n\ndevice_ids\x18\x02 \x03(\x0b\x32\x11.context.DeviceId\x12!\n\x08link_ids\x18\x03 \x03(\x0b\x32\x0f.context.LinkId\";\n\x0eTopologyIdList\x12)\n\x0ctopology_ids\x18\x01 \x03(\x0b\x32\x13.context.TopologyId\"5\n\x0cTopologyList\x12%\n\ntopologies\x18\x01 \x03(\x0b\x32\x11.context.Topology\"X\n\rTopologyEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12(\n\x0btopology_id\x18\x02 \x01(\x0b\x32\x13.context.TopologyId\".\n\x08\x44\x65viceId\x12\"\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x9a\x02\n\x06\x44\x65vice\x12$\n\tdevice_id\x18\x01 \x01(\x0b\x32\x11.context.DeviceId\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12,\n\rdevice_config\x18\x03 \x01(\x0b\x32\x15.context.DeviceConfig\x12G\n\x19\x64\x65vice_operational_status\x18\x04 \x01(\x0e\x32$.context.DeviceOperationalStatusEnum\x12\x31\n\x0e\x64\x65vice_drivers\x18\x05 \x03(\x0e\x32\x19.context.DeviceDriverEnum\x12+\n\x10\x64\x65vice_endpoints\x18\x06 \x03(\x0b\x32\x11.context.EndPoint\"9\n\x0c\x44\x65viceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"5\n\x0c\x44\x65viceIdList\x12%\n\ndevice_ids\x18\x01 \x03(\x0b\x32\x11.context.DeviceId\".\n\nDeviceList\x12 \n\x07\x64\x65vices\x18\x01 \x03(\x0b\x32\x0f.context.Device\"R\n\x0b\x44\x65viceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"*\n\x06LinkId\x12 \n\tlink_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"X\n\x04Link\x12 \n\x07link_id\x18\x01 \x01(\x0b\x32\x0f.context.LinkId\x12.\n\x11link_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\"/\n\nLinkIdList\x12!\n\x08link_ids\x18\x01 \x03(\x0b\x32\x0f.context.LinkId\"(\n\x08LinkList\x12\x1c\n\x05links\x18\x01 \x03(\x0b\x32\r.context.Link\"L\n\tLinkEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12 \n\x07link_id\x18\x02 \x01(\x0b\x32\x0f.context.LinkId\"X\n\tServiceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12#\n\x0cservice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\xa6\x02\n\x07Service\x12&\n\nservice_id\x18\x01 \x01(\x0b\x32\x12.context.ServiceId\x12.\n\x0cservice_type\x18\x02 \x01(\x0e\x32\x18.context.ServiceTypeEnum\x12\x31\n\x14service_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12\x30\n\x13service_constraints\x18\x04 \x03(\x0b\x32\x13.context.Constraint\x12.\n\x0eservice_status\x18\x05 \x01(\x0b\x32\x16.context.ServiceStatus\x12.\n\x0eservice_config\x18\x06 \x01(\x0b\x32\x16.context.ServiceConfig\"C\n\rServiceStatus\x12\x32\n\x0eservice_status\x18\x01 \x01(\x0e\x32\x1a.context.ServiceStatusEnum\":\n\rServiceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"8\n\rServiceIdList\x12\'\n\x0bservice_ids\x18\x01 \x03(\x0b\x32\x12.context.ServiceId\"1\n\x0bServiceList\x12\"\n\x08services\x18\x01 \x03(\x0b\x32\x10.context.Service\"U\n\x0cServiceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\"T\n\x07SliceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12!\n\nslice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\x95\x02\n\x05Slice\x12\"\n\x08slice_id\x18\x01 \x01(\x0b\x32\x10.context.SliceId\x12/\n\x12slice_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\x12.\n\x11slice_constraints\x18\x03 \x03(\x0b\x32\x13.context.Constraint\x12-\n\x11slice_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\x12,\n\x12slice_subslice_ids\x18\x05 \x03(\x0b\x32\x10.context.SliceId\x12*\n\x0cslice_status\x18\x06 \x01(\x0b\x32\x14.context.SliceStatus\"=\n\x0bSliceStatus\x12.\n\x0cslice_status\x18\x01 \x01(\x0e\x32\x18.context.SliceStatusEnum\"2\n\x0bSliceIdList\x12#\n\tslice_ids\x18\x01 \x03(\x0b\x32\x10.context.SliceId\"+\n\tSliceList\x12\x1e\n\x06slices\x18\x01 \x03(\x0b\x32\x0e.context.Slice\"O\n\nSliceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12\"\n\x08slice_id\x18\x02 \x01(\x0b\x32\x10.context.SliceId\"6\n\x0c\x43onnectionId\x12&\n\x0f\x63onnection_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xc4\x01\n\nConnection\x12,\n\rconnection_id\x18\x01 \x01(\x0b\x32\x15.context.ConnectionId\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\x12\x33\n\x16path_hops_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12+\n\x0fsub_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\"A\n\x10\x43onnectionIdList\x12-\n\x0e\x63onnection_ids\x18\x01 \x03(\x0b\x32\x15.context.ConnectionId\":\n\x0e\x43onnectionList\x12(\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x13.context.Connection\"^\n\x0f\x43onnectionEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12,\n\rconnection_id\x18\x02 \x01(\x0b\x32\x15.context.ConnectionId\"\x82\x01\n\nEndPointId\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\x12$\n\rendpoint_uuid\x18\x03 \x01(\x0b\x32\r.context.Uuid\"\x86\x01\n\x08\x45ndPoint\x12(\n\x0b\x65ndpoint_id\x18\x01 \x01(\x0b\x32\x13.context.EndPointId\x12\x15\n\rendpoint_type\x18\x02 \x01(\t\x12\x39\n\x10kpi_sample_types\x18\x03 \x03(\x0e\x32\x1f.kpi_sample_types.KpiSampleType\"e\n\nConfigRule\x12)\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x19.context.ConfigActionEnum\x12\x14\n\x0cresource_key\x18\x02 \x01(\t\x12\x16\n\x0eresource_value\x18\x03 \x01(\t\"?\n\nConstraint\x12\x17\n\x0f\x63onstraint_type\x18\x01 \x01(\t\x12\x18\n\x10\x63onstraint_value\x18\x02 \x01(\t\"^\n\x12TeraFlowController\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x12\n\nip_address\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\"U\n\x14\x41uthenticationResult\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x15\n\rauthenticated\x18\x02 \x01(\x08*j\n\rEventTypeEnum\x12\x17\n\x13\x45VENTTYPE_UNDEFINED\x10\x00\x12\x14\n\x10\x45VENTTYPE_CREATE\x10\x01\x12\x14\n\x10\x45VENTTYPE_UPDATE\x10\x02\x12\x14\n\x10\x45VENTTYPE_REMOVE\x10\x03*\xc5\x01\n\x10\x44\x65viceDriverEnum\x12\x1a\n\x16\x44\x45VICEDRIVER_UNDEFINED\x10\x00\x12\x1b\n\x17\x44\x45VICEDRIVER_OPENCONFIG\x10\x01\x12\x1e\n\x1a\x44\x45VICEDRIVER_TRANSPORT_API\x10\x02\x12\x13\n\x0f\x44\x45VICEDRIVER_P4\x10\x03\x12&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOGY\x10\x04\x12\x1b\n\x17\x44\x45VICEDRIVER_ONF_TR_352\x10\x05*\x8f\x01\n\x1b\x44\x65viceOperationalStatusEnum\x12%\n!DEVICEOPERATIONALSTATUS_UNDEFINED\x10\x00\x12$\n DEVICEOPERATIONALSTATUS_DISABLED\x10\x01\x12#\n\x1f\x44\x45VICEOPERATIONALSTATUS_ENABLED\x10\x02*\x81\x01\n\x0fServiceTypeEnum\x12\x17\n\x13SERVICETYPE_UNKNOWN\x10\x00\x12\x14\n\x10SERVICETYPE_L3NM\x10\x01\x12\x14\n\x10SERVICETYPE_L2NM\x10\x02\x12)\n%SERVICETYPE_TAPI_CONNECTIVITY_SERVICE\x10\x03*\x88\x01\n\x11ServiceStatusEnum\x12\x1b\n\x17SERVICESTATUS_UNDEFINED\x10\x00\x12\x19\n\x15SERVICESTATUS_PLANNED\x10\x01\x12\x18\n\x14SERVICESTATUS_ACTIVE\x10\x02\x12!\n\x1dSERVICESTATUS_PENDING_REMOVAL\x10\x03*\x8b\x01\n\x0fSliceStatusEnum\x12\x19\n\x15SLICESTATUS_UNDEFINED\x10\x00\x12\x17\n\x13SLICESTATUS_PLANNED\x10\x01\x12\x14\n\x10SLICESTATUS_INIT\x10\x02\x12\x16\n\x12SLICESTATUS_ACTIVE\x10\x03\x12\x16\n\x12SLICESTATUS_DEINIT\x10\x04*]\n\x10\x43onfigActionEnum\x12\x1a\n\x16\x43ONFIGACTION_UNDEFINED\x10\x00\x12\x14\n\x10\x43ONFIGACTION_SET\x10\x01\x12\x17\n\x13\x43ONFIGACTION_DELETE\x10\x02\x32\xef\x12\n\x0e\x43ontextService\x12:\n\x0eListContextIds\x12\x0e.context.Empty\x1a\x16.context.ContextIdList\"\x00\x12\x36\n\x0cListContexts\x12\x0e.context.Empty\x1a\x14.context.ContextList\"\x00\x12\x34\n\nGetContext\x12\x12.context.ContextId\x1a\x10.context.Context\"\x00\x12\x34\n\nSetContext\x12\x10.context.Context\x1a\x12.context.ContextId\"\x00\x12\x35\n\rRemoveContext\x12\x12.context.ContextId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetContextEvents\x12\x0e.context.Empty\x1a\x15.context.ContextEvent\"\x00\x30\x01\x12@\n\x0fListTopologyIds\x12\x12.context.ContextId\x1a\x17.context.TopologyIdList\"\x00\x12=\n\x0eListTopologies\x12\x12.context.ContextId\x1a\x15.context.TopologyList\"\x00\x12\x37\n\x0bGetTopology\x12\x13.context.TopologyId\x1a\x11.context.Topology\"\x00\x12\x37\n\x0bSetTopology\x12\x11.context.Topology\x1a\x13.context.TopologyId\"\x00\x12\x37\n\x0eRemoveTopology\x12\x13.context.TopologyId\x1a\x0e.context.Empty\"\x00\x12?\n\x11GetTopologyEvents\x12\x0e.context.Empty\x1a\x16.context.TopologyEvent\"\x00\x30\x01\x12\x38\n\rListDeviceIds\x12\x0e.context.Empty\x1a\x15.context.DeviceIdList\"\x00\x12\x34\n\x0bListDevices\x12\x0e.context.Empty\x1a\x13.context.DeviceList\"\x00\x12\x31\n\tGetDevice\x12\x11.context.DeviceId\x1a\x0f.context.Device\"\x00\x12\x31\n\tSetDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0cRemoveDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x12;\n\x0fGetDeviceEvents\x12\x0e.context.Empty\x1a\x14.context.DeviceEvent\"\x00\x30\x01\x12\x34\n\x0bListLinkIds\x12\x0e.context.Empty\x1a\x13.context.LinkIdList\"\x00\x12\x30\n\tListLinks\x12\x0e.context.Empty\x1a\x11.context.LinkList\"\x00\x12+\n\x07GetLink\x12\x0f.context.LinkId\x1a\r.context.Link\"\x00\x12+\n\x07SetLink\x12\r.context.Link\x1a\x0f.context.LinkId\"\x00\x12/\n\nRemoveLink\x12\x0f.context.LinkId\x1a\x0e.context.Empty\"\x00\x12\x37\n\rGetLinkEvents\x12\x0e.context.Empty\x1a\x12.context.LinkEvent\"\x00\x30\x01\x12>\n\x0eListServiceIds\x12\x12.context.ContextId\x1a\x16.context.ServiceIdList\"\x00\x12:\n\x0cListServices\x12\x12.context.ContextId\x1a\x14.context.ServiceList\"\x00\x12\x34\n\nGetService\x12\x12.context.ServiceId\x1a\x10.context.Service\"\x00\x12\x34\n\nSetService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rRemoveService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetServiceEvents\x12\x0e.context.Empty\x1a\x15.context.ServiceEvent\"\x00\x30\x01\x12:\n\x0cListSliceIds\x12\x12.context.ContextId\x1a\x14.context.SliceIdList\"\x00\x12\x36\n\nListSlices\x12\x12.context.ContextId\x1a\x12.context.SliceList\"\x00\x12.\n\x08GetSlice\x12\x10.context.SliceId\x1a\x0e.context.Slice\"\x00\x12.\n\x08SetSlice\x12\x0e.context.Slice\x1a\x10.context.SliceId\"\x00\x12\x31\n\x0bRemoveSlice\x12\x10.context.SliceId\x1a\x0e.context.Empty\"\x00\x12\x39\n\x0eGetSliceEvents\x12\x0e.context.Empty\x1a\x13.context.SliceEvent\"\x00\x30\x01\x12\x44\n\x11ListConnectionIds\x12\x12.context.ServiceId\x1a\x19.context.ConnectionIdList\"\x00\x12@\n\x0fListConnections\x12\x12.context.ServiceId\x1a\x17.context.ConnectionList\"\x00\x12=\n\rGetConnection\x12\x15.context.ConnectionId\x1a\x13.context.Connection\"\x00\x12=\n\rSetConnection\x12\x13.context.Connection\x1a\x15.context.ConnectionId\"\x00\x12;\n\x10RemoveConnection\x12\x15.context.ConnectionId\x1a\x0e.context.Empty\"\x00\x12\x43\n\x13GetConnectionEvents\x12\x0e.context.Empty\x1a\x18.context.ConnectionEvent\"\x00\x30\x01\x62\x06proto3' , dependencies=[kpi__sample__types__pb2.DESCRIPTOR,]) @@ -55,8 +55,8 @@ _EVENTTYPEENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=3703, - serialized_end=3809, + serialized_start=4310, + serialized_end=4416, ) _sym_db.RegisterEnumDescriptor(_EVENTTYPEENUM) @@ -101,8 +101,8 @@ _DEVICEDRIVERENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=3812, - serialized_end=4009, + serialized_start=4419, + serialized_end=4616, ) _sym_db.RegisterEnumDescriptor(_DEVICEDRIVERENUM) @@ -132,8 +132,8 @@ _DEVICEOPERATIONALSTATUSENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4012, - serialized_end=4155, + serialized_start=4619, + serialized_end=4762, ) _sym_db.RegisterEnumDescriptor(_DEVICEOPERATIONALSTATUSENUM) @@ -168,8 +168,8 @@ _SERVICETYPEENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4158, - serialized_end=4287, + serialized_start=4765, + serialized_end=4894, ) _sym_db.RegisterEnumDescriptor(_SERVICETYPEENUM) @@ -204,12 +204,53 @@ _SERVICESTATUSENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4290, - serialized_end=4426, + serialized_start=4897, + serialized_end=5033, ) _sym_db.RegisterEnumDescriptor(_SERVICESTATUSENUM) ServiceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICESTATUSENUM) +_SLICESTATUSENUM = _descriptor.EnumDescriptor( + name='SliceStatusEnum', + full_name='context.SliceStatusEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_PLANNED', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_INIT', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_ACTIVE', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_DEINIT', index=4, number=4, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=5036, + serialized_end=5175, +) +_sym_db.RegisterEnumDescriptor(_SLICESTATUSENUM) + +SliceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SLICESTATUSENUM) _CONFIGACTIONENUM = _descriptor.EnumDescriptor( name='ConfigActionEnum', full_name='context.ConfigActionEnum', @@ -235,8 +276,8 @@ _CONFIGACTIONENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4428, - serialized_end=4521, + serialized_start=5177, + serialized_end=5270, ) _sym_db.RegisterEnumDescriptor(_CONFIGACTIONENUM) @@ -262,6 +303,11 @@ SERVICESTATUS_UNDEFINED = 0 SERVICESTATUS_PLANNED = 1 SERVICESTATUS_ACTIVE = 2 SERVICESTATUS_PENDING_REMOVAL = 3 +SLICESTATUS_UNDEFINED = 0 +SLICESTATUS_PLANNED = 1 +SLICESTATUS_INIT = 2 +SLICESTATUS_ACTIVE = 3 +SLICESTATUS_DEINIT = 4 CONFIGACTION_UNDEFINED = 0 CONFIGACTION_SET = 1 CONFIGACTION_DELETE = 2 @@ -1421,6 +1467,247 @@ _SERVICEEVENT = _descriptor.Descriptor( ) +_SLICEID = _descriptor.Descriptor( + name='SliceId', + full_name='context.SliceId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_id', full_name='context.SliceId.context_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_uuid', full_name='context.SliceId.slice_uuid', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2604, + serialized_end=2688, +) + + +_SLICE = _descriptor.Descriptor( + name='Slice', + full_name='context.Slice', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_id', full_name='context.Slice.slice_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_endpoint_ids', full_name='context.Slice.slice_endpoint_ids', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_constraints', full_name='context.Slice.slice_constraints', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_service_ids', full_name='context.Slice.slice_service_ids', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_subslice_ids', full_name='context.Slice.slice_subslice_ids', index=4, + number=5, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_status', full_name='context.Slice.slice_status', index=5, + number=6, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2691, + serialized_end=2968, +) + + +_SLICESTATUS = _descriptor.Descriptor( + name='SliceStatus', + full_name='context.SliceStatus', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_status', full_name='context.SliceStatus.slice_status', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2970, + serialized_end=3031, +) + + +_SLICEIDLIST = _descriptor.Descriptor( + name='SliceIdList', + full_name='context.SliceIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_ids', full_name='context.SliceIdList.slice_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3033, + serialized_end=3083, +) + + +_SLICELIST = _descriptor.Descriptor( + name='SliceList', + full_name='context.SliceList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slices', full_name='context.SliceList.slices', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3085, + serialized_end=3128, +) + + +_SLICEEVENT = _descriptor.Descriptor( + name='SliceEvent', + full_name='context.SliceEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.SliceEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_id', full_name='context.SliceEvent.slice_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3130, + serialized_end=3209, +) + + _CONNECTIONID = _descriptor.Descriptor( name='ConnectionId', full_name='context.ConnectionId', @@ -1448,8 +1735,8 @@ _CONNECTIONID = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2604, - serialized_end=2658, + serialized_start=3211, + serialized_end=3265, ) @@ -1501,8 +1788,8 @@ _CONNECTION = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2661, - serialized_end=2857, + serialized_start=3268, + serialized_end=3464, ) @@ -1533,8 +1820,8 @@ _CONNECTIONIDLIST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2859, - serialized_end=2924, + serialized_start=3466, + serialized_end=3531, ) @@ -1565,8 +1852,8 @@ _CONNECTIONLIST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2926, - serialized_end=2984, + serialized_start=3533, + serialized_end=3591, ) @@ -1604,8 +1891,8 @@ _CONNECTIONEVENT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2986, - serialized_end=3080, + serialized_start=3593, + serialized_end=3687, ) @@ -1650,8 +1937,8 @@ _ENDPOINTID = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3083, - serialized_end=3213, + serialized_start=3690, + serialized_end=3820, ) @@ -1696,8 +1983,8 @@ _ENDPOINT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3216, - serialized_end=3350, + serialized_start=3823, + serialized_end=3957, ) @@ -1742,8 +2029,8 @@ _CONFIGRULE = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3352, - serialized_end=3453, + serialized_start=3959, + serialized_end=4060, ) @@ -1781,8 +2068,8 @@ _CONSTRAINT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3455, - serialized_end=3518, + serialized_start=4062, + serialized_end=4125, ) @@ -1827,8 +2114,8 @@ _TERAFLOWCONTROLLER = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3520, - serialized_end=3614, + serialized_start=4127, + serialized_end=4221, ) @@ -1866,8 +2153,8 @@ _AUTHENTICATIONRESULT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3616, - serialized_end=3701, + serialized_start=4223, + serialized_end=4308, ) _EVENT.fields_by_name['event_type'].enum_type = _EVENTTYPEENUM @@ -1921,6 +2208,19 @@ _SERVICEIDLIST.fields_by_name['service_ids'].message_type = _SERVICEID _SERVICELIST.fields_by_name['services'].message_type = _SERVICE _SERVICEEVENT.fields_by_name['event'].message_type = _EVENT _SERVICEEVENT.fields_by_name['service_id'].message_type = _SERVICEID +_SLICEID.fields_by_name['context_id'].message_type = _CONTEXTID +_SLICEID.fields_by_name['slice_uuid'].message_type = _UUID +_SLICE.fields_by_name['slice_id'].message_type = _SLICEID +_SLICE.fields_by_name['slice_endpoint_ids'].message_type = _ENDPOINTID +_SLICE.fields_by_name['slice_constraints'].message_type = _CONSTRAINT +_SLICE.fields_by_name['slice_service_ids'].message_type = _SERVICEID +_SLICE.fields_by_name['slice_subslice_ids'].message_type = _SLICEID +_SLICE.fields_by_name['slice_status'].message_type = _SLICESTATUS +_SLICESTATUS.fields_by_name['slice_status'].enum_type = _SLICESTATUSENUM +_SLICEIDLIST.fields_by_name['slice_ids'].message_type = _SLICEID +_SLICELIST.fields_by_name['slices'].message_type = _SLICE +_SLICEEVENT.fields_by_name['event'].message_type = _EVENT +_SLICEEVENT.fields_by_name['slice_id'].message_type = _SLICEID _CONNECTIONID.fields_by_name['connection_uuid'].message_type = _UUID _CONNECTION.fields_by_name['connection_id'].message_type = _CONNECTIONID _CONNECTION.fields_by_name['service_id'].message_type = _SERVICEID @@ -1969,6 +2269,12 @@ DESCRIPTOR.message_types_by_name['ServiceConfig'] = _SERVICECONFIG DESCRIPTOR.message_types_by_name['ServiceIdList'] = _SERVICEIDLIST DESCRIPTOR.message_types_by_name['ServiceList'] = _SERVICELIST DESCRIPTOR.message_types_by_name['ServiceEvent'] = _SERVICEEVENT +DESCRIPTOR.message_types_by_name['SliceId'] = _SLICEID +DESCRIPTOR.message_types_by_name['Slice'] = _SLICE +DESCRIPTOR.message_types_by_name['SliceStatus'] = _SLICESTATUS +DESCRIPTOR.message_types_by_name['SliceIdList'] = _SLICEIDLIST +DESCRIPTOR.message_types_by_name['SliceList'] = _SLICELIST +DESCRIPTOR.message_types_by_name['SliceEvent'] = _SLICEEVENT DESCRIPTOR.message_types_by_name['ConnectionId'] = _CONNECTIONID DESCRIPTOR.message_types_by_name['Connection'] = _CONNECTION DESCRIPTOR.message_types_by_name['ConnectionIdList'] = _CONNECTIONIDLIST @@ -1985,6 +2291,7 @@ DESCRIPTOR.enum_types_by_name['DeviceDriverEnum'] = _DEVICEDRIVERENUM DESCRIPTOR.enum_types_by_name['DeviceOperationalStatusEnum'] = _DEVICEOPERATIONALSTATUSENUM DESCRIPTOR.enum_types_by_name['ServiceTypeEnum'] = _SERVICETYPEENUM DESCRIPTOR.enum_types_by_name['ServiceStatusEnum'] = _SERVICESTATUSENUM +DESCRIPTOR.enum_types_by_name['SliceStatusEnum'] = _SLICESTATUSENUM DESCRIPTOR.enum_types_by_name['ConfigActionEnum'] = _CONFIGACTIONENUM _sym_db.RegisterFileDescriptor(DESCRIPTOR) @@ -2205,6 +2512,48 @@ ServiceEvent = _reflection.GeneratedProtocolMessageType('ServiceEvent', (_messag }) _sym_db.RegisterMessage(ServiceEvent) +SliceId = _reflection.GeneratedProtocolMessageType('SliceId', (_message.Message,), { + 'DESCRIPTOR' : _SLICEID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceId) + }) +_sym_db.RegisterMessage(SliceId) + +Slice = _reflection.GeneratedProtocolMessageType('Slice', (_message.Message,), { + 'DESCRIPTOR' : _SLICE, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Slice) + }) +_sym_db.RegisterMessage(Slice) + +SliceStatus = _reflection.GeneratedProtocolMessageType('SliceStatus', (_message.Message,), { + 'DESCRIPTOR' : _SLICESTATUS, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceStatus) + }) +_sym_db.RegisterMessage(SliceStatus) + +SliceIdList = _reflection.GeneratedProtocolMessageType('SliceIdList', (_message.Message,), { + 'DESCRIPTOR' : _SLICEIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceIdList) + }) +_sym_db.RegisterMessage(SliceIdList) + +SliceList = _reflection.GeneratedProtocolMessageType('SliceList', (_message.Message,), { + 'DESCRIPTOR' : _SLICELIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceList) + }) +_sym_db.RegisterMessage(SliceList) + +SliceEvent = _reflection.GeneratedProtocolMessageType('SliceEvent', (_message.Message,), { + 'DESCRIPTOR' : _SLICEEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceEvent) + }) +_sym_db.RegisterMessage(SliceEvent) + ConnectionId = _reflection.GeneratedProtocolMessageType('ConnectionId', (_message.Message,), { 'DESCRIPTOR' : _CONNECTIONID, '__module__' : 'context_pb2' @@ -2291,8 +2640,8 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( index=0, serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_start=4524, - serialized_end=6617, + serialized_start=5273, + serialized_end=7688, methods=[ _descriptor.MethodDescriptor( name='ListContextIds', @@ -2594,10 +2943,70 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( serialized_options=None, create_key=_descriptor._internal_create_key, ), + _descriptor.MethodDescriptor( + name='ListSliceIds', + full_name='context.ContextService.ListSliceIds', + index=30, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SLICEIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListSlices', + full_name='context.ContextService.ListSlices', + index=31, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SLICELIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetSlice', + full_name='context.ContextService.GetSlice', + index=32, + containing_service=None, + input_type=_SLICEID, + output_type=_SLICE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetSlice', + full_name='context.ContextService.SetSlice', + index=33, + containing_service=None, + input_type=_SLICE, + output_type=_SLICEID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveSlice', + full_name='context.ContextService.RemoveSlice', + index=34, + containing_service=None, + input_type=_SLICEID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetSliceEvents', + full_name='context.ContextService.GetSliceEvents', + index=35, + containing_service=None, + input_type=_EMPTY, + output_type=_SLICEEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), _descriptor.MethodDescriptor( name='ListConnectionIds', full_name='context.ContextService.ListConnectionIds', - index=30, + index=36, containing_service=None, input_type=_SERVICEID, output_type=_CONNECTIONIDLIST, @@ -2607,7 +3016,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='ListConnections', full_name='context.ContextService.ListConnections', - index=31, + index=37, containing_service=None, input_type=_SERVICEID, output_type=_CONNECTIONLIST, @@ -2617,7 +3026,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='GetConnection', full_name='context.ContextService.GetConnection', - index=32, + index=38, containing_service=None, input_type=_CONNECTIONID, output_type=_CONNECTION, @@ -2627,7 +3036,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='SetConnection', full_name='context.ContextService.SetConnection', - index=33, + index=39, containing_service=None, input_type=_CONNECTION, output_type=_CONNECTIONID, @@ -2637,7 +3046,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='RemoveConnection', full_name='context.ContextService.RemoveConnection', - index=34, + index=40, containing_service=None, input_type=_CONNECTIONID, output_type=_EMPTY, @@ -2647,7 +3056,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='GetConnectionEvents', full_name='context.ContextService.GetConnectionEvents', - index=35, + index=41, containing_service=None, input_type=_EMPTY, output_type=_CONNECTIONEVENT, diff --git a/src/opticalcentralizedattackdetector/proto/service_pb2.py b/src/opticalcentralizedattackdetector/proto/service_pb2.py index 7a006915b8be39710a17faab075e382e322d918f..8e2806c7685e24ab90a3d59a19f1e4f99ebc9712 100644 --- a/src/opticalcentralizedattackdetector/proto/service_pb2.py +++ b/src/opticalcentralizedattackdetector/proto/service_pb2.py @@ -20,7 +20,7 @@ DESCRIPTOR = _descriptor.FileDescriptor( syntax='proto3', serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\rservice.proto\x12\x07service\x1a\rcontext.proto2\xfd\x01\n\x0eServiceService\x12\x37\n\rCreateService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x37\n\rUpdateService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rDeleteService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12\x42\n\x11GetConnectionList\x12\x12.context.ServiceId\x1a\x17.context.ConnectionList\"\x00\x62\x06proto3' + serialized_pb=b'\n\rservice.proto\x12\x07service\x1a\rcontext.proto2\xb9\x01\n\x0eServiceService\x12\x37\n\rCreateService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x37\n\rUpdateService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rDeleteService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x62\x06proto3' , dependencies=[context__pb2.DESCRIPTOR,]) @@ -38,7 +38,7 @@ _SERVICESERVICE = _descriptor.ServiceDescriptor( serialized_options=None, create_key=_descriptor._internal_create_key, serialized_start=42, - serialized_end=295, + serialized_end=227, methods=[ _descriptor.MethodDescriptor( name='CreateService', @@ -70,16 +70,6 @@ _SERVICESERVICE = _descriptor.ServiceDescriptor( serialized_options=None, create_key=_descriptor._internal_create_key, ), - _descriptor.MethodDescriptor( - name='GetConnectionList', - full_name='service.ServiceService.GetConnectionList', - index=3, - containing_service=None, - input_type=context__pb2._SERVICEID, - output_type=context__pb2._CONNECTIONLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), ]) _sym_db.RegisterServiceDescriptor(_SERVICESERVICE) diff --git a/src/opticalcentralizedattackdetector/service/OpticalCentralizedAttackDetectorServiceServicerImpl.py b/src/opticalcentralizedattackdetector/service/OpticalCentralizedAttackDetectorServiceServicerImpl.py index 9c77a959cbdc484af143015a2868121af3845b0a..d4c71476f016081f7d230a3cfe87e73b35654987 100644 --- a/src/opticalcentralizedattackdetector/service/OpticalCentralizedAttackDetectorServiceServicerImpl.py +++ b/src/opticalcentralizedattackdetector/service/OpticalCentralizedAttackDetectorServiceServicerImpl.py @@ -16,11 +16,8 @@ import os, grpc, logging, random from influxdb import InfluxDBClient from common.rpc_method_wrapper.Decorator import create_metrics, safe_and_metered_rpc_method from context.client.ContextClient import ContextClient -from context.Config import GRPC_SERVICE_PORT as CONTEXT_GRPC_SERVICE_PORT -from monitoring.client.monitoring_client import MonitoringClient -from monitoring.Config import GRPC_SERVICE_PORT as MONITORING_GRPC_SERVICE_PORT +from monitoring.client.MonitoringClient import MonitoringClient from service.client.ServiceClient import ServiceClient -from service.Config import GRPC_SERVICE_PORT as SERVICE_GRPC_SERVICE_PORT from dbscanserving.proto.dbscanserving_pb2 import DetectionRequest, DetectionResponse, Sample from dbscanserving.client.DbscanServingClient import DbscanServingClient from dbscanserving.Config import GRPC_SERVICE_PORT as DBSCANSERVING_GRPC_SERVICE_PORT @@ -35,8 +32,7 @@ from opticalcentralizedattackdetector.proto.monitoring_pb2 import KpiList from opticalcentralizedattackdetector.proto.optical_centralized_attack_detector_pb2_grpc import ( OpticalCentralizedAttackDetectorServiceServicer) from opticalcentralizedattackdetector.Config import ( - CONTEXT_SERVICE_ADDRESS, SERVICE_SERVICE_ADDRESS, INFERENCE_SERVICE_ADDRESS, MONITORING_SERVICE_ADDRESS, - ATTACK_MITIGATOR_SERVICE_ADDRESS) + INFERENCE_SERVICE_ADDRESS, MONITORING_SERVICE_ADDRESS, ATTACK_MITIGATOR_SERVICE_ADDRESS) LOGGER = logging.getLogger(__name__) @@ -49,12 +45,16 @@ INFLUXDB_HOSTNAME = os.environ.get("INFLUXDB_HOSTNAME") INFLUXDB_USER = os.environ.get("INFLUXDB_USER") INFLUXDB_PASSWORD = os.environ.get("INFLUXDB_PASSWORD") INFLUXDB_DATABASE = os.environ.get("INFLUXDB_DATABASE") -context_client: ContextClient = ContextClient(address=CONTEXT_SERVICE_ADDRESS, port=CONTEXT_GRPC_SERVICE_PORT) -influxdb_client: InfluxDBClient = InfluxDBClient(host=MONITORING_SERVICE_ADDRESS, port=8086, username=INFLUXDB_USER, password=INFLUXDB_PASSWORD, database=INFLUXDB_DATABASE) -monitoring_client: MonitoringClient = MonitoringClient(server=MONITORING_SERVICE_ADDRESS, port=MONITORING_GRPC_SERVICE_PORT) -dbscanserving_client: DbscanServingClient = DbscanServingClient(address=INFERENCE_SERVICE_ADDRESS, port=DBSCANSERVING_GRPC_SERVICE_PORT) -service_client: ServiceClient = ServiceClient(SERVICE_SERVICE_ADDRESS, SERVICE_GRPC_SERVICE_PORT) -attack_mitigator_client: OpticalAttackMitigatorClient = OpticalAttackMitigatorClient(address=ATTACK_MITIGATOR_SERVICE_ADDRESS, port=ATTACK_MITIGATOR_GRPC_SERVICE_PORT) +context_client: ContextClient = ContextClient() +influxdb_client: InfluxDBClient = InfluxDBClient( + host=MONITORING_SERVICE_ADDRESS, port=8086, username=INFLUXDB_USER, password=INFLUXDB_PASSWORD, + database=INFLUXDB_DATABASE) +monitoring_client: MonitoringClient = MonitoringClient() +dbscanserving_client: DbscanServingClient = DbscanServingClient( + address=INFERENCE_SERVICE_ADDRESS, port=DBSCANSERVING_GRPC_SERVICE_PORT) +service_client: ServiceClient = ServiceClient() +attack_mitigator_client: OpticalAttackMitigatorClient = OpticalAttackMitigatorClient( + address=ATTACK_MITIGATOR_SERVICE_ADDRESS, port=ATTACK_MITIGATOR_GRPC_SERVICE_PORT) class OpticalCentralizedAttackDetectorServiceServicerImpl(OpticalCentralizedAttackDetectorServiceServicer): diff --git a/src/policy/.gitlab-ci.yml b/src/policy/.gitlab-ci.yml index 1f855bb18188790697b1adcaa998fe9196d71055..164540a05172666375f503549f098ef3a90cdf06 100644 --- a/src/policy/.gitlab-ci.yml +++ b/src/policy/.gitlab-ci.yml @@ -12,45 +12,71 @@ # See the License for the specific language governing permissions and # limitations under the License. +variables: + IMAGE_NAME_POLICY: 'policy' + REPORTS_PATH_POLICY: "src/${IMAGE_NAME_POLICY}/reports" + BUILD_ENV_POLICY: build-policy.env + # Package application needed to run tests & build the image on next stage build policy: - variables: - IMAGE_NAME: 'policy' # name of the microservice - IMAGE_NAME_TEST: 'policy-test' # name of the microservice - IMAGE_TAG: '0.1.0' # tag of the container image (production, development, etc) stage: build script: - - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/src/main/docker/Dockerfile.multistage.jvm ./src/$IMAGE_NAME/ --target builder + - export IMAGE_TAG=$(grep -m1 '<version>' ./src/$IMAGE_NAME_POLICY/pom.xml | grep -oP '(?<=>).*(?=<)') + - echo "IMAGE_TAG=${IMAGE_TAG}" >> ${BUILD_ENV_POLICY} + - cat ${BUILD_ENV_POLICY} + - docker build -t "$IMAGE_NAME_POLICY:$IMAGE_TAG" -f ./src/$IMAGE_NAME_POLICY/src/main/docker/Dockerfile.multistage.jvm ./src/$IMAGE_NAME_POLICY/ --target builder + after_script: + - docker images --filter="dangling=true" --quiet | xargs -r docker rmi + artifacts: + reports: + dotenv: ${BUILD_ENV_POLICY} rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' - changes: - - src/$IMAGE_NAME/** - - manifests/${IMAGE_NAME}service.yaml + - src/$IMAGE_NAME_POLICY/** + - manifests/${IMAGE_NAME_POLICY}service.yaml - .gitlab-ci.yml # Run tests, build & push the image unit_test policy: variables: - IMAGE_NAME: 'policy' # name of the microservice - IMAGE_NAME_TEST: 'policy-test' # name of the microservice - IMAGE_TAG: '0.1.0' # tag of the container image (production, development, etc) + REPORTS_CONTAINER: "${IMAGE_NAME_POLICY}-reports" stage: unit_test needs: - build policy before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY + - docker rm ${REPORTS_CONTAINER} || true script: - - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/src/main/docker/Dockerfile.multistage.jvm ./src/$IMAGE_NAME/ --target unit-test - - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/src/main/docker/Dockerfile.multistage.jvm ./src/$IMAGE_NAME/ --target release - - docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" + - echo "Running tests for image ${IMAGE_TAG}" + - docker build -t "$IMAGE_NAME_POLICY:$IMAGE_TAG" -f ./src/$IMAGE_NAME_POLICY/src/main/docker/Dockerfile.multistage.jvm ./src/$IMAGE_NAME_POLICY/ --target unit-test + # Transfer JaCoCo and Surefire reports from within tests image + - docker create --name ${REPORTS_CONTAINER} "$IMAGE_NAME_POLICY:$IMAGE_TAG" + - mkdir -p ${REPORTS_PATH_POLICY} + - docker cp ${REPORTS_CONTAINER}:/app/target/site/jacoco/index.html ${REPORTS_PATH_POLICY}/coverage.html + - docker cp ${REPORTS_CONTAINER}:/app/target/site/jacoco/jacoco.xml ${REPORTS_PATH_POLICY}/jacoco.xml + - docker cp ${REPORTS_CONTAINER}:/app/target/surefire-reports/ ${REPORTS_PATH_POLICY}/ + - cat ${REPORTS_PATH_POLICY}/coverage.html | grep -o 'Total[^%]*%' | sed 's/<.*>/ /; s/Total/JaCoCo Coverage Total:/' + - docker run -v "$(pwd)/src/${IMAGE_NAME_POLICY}:/${IMAGE_NAME_POLICY}" --rm registry.gitlab.com/haynes/jacoco2cobertura:1.0.7 python /opt/cover2cover.py ${IMAGE_NAME_POLICY}/reports/jacoco.xml ${IMAGE_NAME_POLICY}/src/main/java > ${REPORTS_PATH_POLICY}/cobertura.xml + # Build final image + - docker build -t "$IMAGE_NAME_POLICY:$IMAGE_TAG" -f ./src/$IMAGE_NAME_POLICY/src/main/docker/Dockerfile.multistage.jvm ./src/$IMAGE_NAME_POLICY/ --target release + - docker tag "$IMAGE_NAME_POLICY:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME_POLICY:$IMAGE_TAG" + - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME_POLICY:$IMAGE_TAG" + after_script: + - docker rm ${REPORTS_CONTAINER} + - docker rm -f "$IMAGE_NAME_POLICY:$IMAGE_TAG" + coverage: '/JaCoCo Coverage Total: ([0-9]{1,3})%/' + artifacts: + reports: + junit: + - ${REPORTS_PATH_POLICY}/surefire-reports/TEST-*.xml rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' - changes: - - src/$IMAGE_NAME/** - - manifests/${IMAGE_NAME}service.yaml + - src/$IMAGE_NAME_POLICY/** + - manifests/${IMAGE_NAME_POLICY}service.yaml - .gitlab-ci.yml # Deployment of policy service in Kubernetes Cluster diff --git a/src/policy/pom.xml b/src/policy/pom.xml index 02077d79a1649b0531aa7dca09fa08fe806f82b5..6233d3edb8b1e66ef0e9dce27dfca0eb08359399 100644 --- a/src/policy/pom.xml +++ b/src/policy/pom.xml @@ -99,6 +99,12 @@ </dependencyManagement> <dependencies> + <dependency> + <groupId>io.github.project-openubl</groupId> + <artifactId>quarkus-bouncycastle</artifactId> + <version>1.2.2.Final</version> + </dependency> + <dependency> <groupId>io.quarkus</groupId> <artifactId>quarkus-grpc</artifactId> diff --git a/src/policy/src/main/docker/Dockerfile.multistage.jvm b/src/policy/src/main/docker/Dockerfile.multistage.jvm index 280e4142d00fa6acdf837e27def9881015484e3c..e153b7d84c21a89276d2d3622ead316508b22cef 100644 --- a/src/policy/src/main/docker/Dockerfile.multistage.jvm +++ b/src/policy/src/main/docker/Dockerfile.multistage.jvm @@ -29,7 +29,7 @@ RUN mvn --errors --batch-mode package -Dmaven.test.skip=true # Stage 2 FROM builder AS unit-test -RUN mvn --errors --batch-mode test +RUN mvn --errors --batch-mode -Pgenerate-consolidated-coverage verify # Stage 3 FROM registry.access.redhat.com/ubi8/ubi-minimal:8.4 AS release diff --git a/src/policy/src/main/java/eu/teraflow/policy/PolicyGateway.java b/src/policy/src/main/java/eu/teraflow/policy/PolicyGateway.java index b6d1de94a45b2ac5b09d28d6b749cbf1c02413ea..2e8f9bba41f20c03e1db624f711b824a5fe37c9b 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/PolicyGateway.java +++ b/src/policy/src/main/java/eu/teraflow/policy/PolicyGateway.java @@ -1,18 +1,18 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.policy; diff --git a/src/policy/src/main/java/eu/teraflow/policy/PolicyGatewayImpl.java b/src/policy/src/main/java/eu/teraflow/policy/PolicyGatewayImpl.java index 45eed4c910a95eee2851231be33e944a5b779668..642fabcba92c82cab8cc0c43dca805aa95231df6 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/PolicyGatewayImpl.java +++ b/src/policy/src/main/java/eu/teraflow/policy/PolicyGatewayImpl.java @@ -1,26 +1,33 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.policy; -import context.ContextOuterClass; +import context.ContextOuterClass.ServiceId; import io.quarkus.grpc.GrpcService; import io.smallrye.mutiny.Uni; import javax.inject.Inject; import policy.Policy; +import policy.Policy.PolicyRuleBasic; +import policy.Policy.PolicyRuleDevice; +import policy.Policy.PolicyRuleId; +import policy.Policy.PolicyRuleService; +import policy.Policy.PolicyRuleServiceList; +import policy.Policy.PolicyRuleState; +import policy.Policy.RuleState; @GrpcService public class PolicyGatewayImpl implements PolicyGateway { @@ -33,50 +40,77 @@ public class PolicyGatewayImpl implements PolicyGateway { } @Override - public Uni<Policy.PolicyRuleState> policyAdd(Policy.PolicyRule request) { + public Uni<PolicyRuleState> policyAddService(PolicyRuleService request) { return Uni.createFrom() .item( () -> Policy.PolicyRuleState.newBuilder() - .setPolicyRuleId(request.getPolicyRuleId().getUuid()) + .setPolicyRuleState( + request.getPolicyRuleBasic().getPolicyRuleState().getPolicyRuleState()) .build()); } @Override - public Uni<Policy.PolicyRuleState> policyUpdate(Policy.PolicyRule request) { + public Uni<PolicyRuleState> policyAddDevice(PolicyRuleDevice request) { return Uni.createFrom() .item( () -> Policy.PolicyRuleState.newBuilder() - .setPolicyRuleId(request.getPolicyRuleId().getUuid()) + .setPolicyRuleState( + request.getPolicyRuleBasic().getPolicyRuleState().getPolicyRuleState()) .build()); } @Override - public Uni<Policy.PolicyRuleState> policyDelete(Policy.PolicyRule request) { + public Uni<PolicyRuleState> policyUpdateService(PolicyRuleService request) { return Uni.createFrom() .item( () -> Policy.PolicyRuleState.newBuilder() - .setPolicyRuleId(request.getPolicyRuleId().getUuid()) + .setPolicyRuleState( + request.getPolicyRuleBasic().getPolicyRuleState().getPolicyRuleState()) .build()); } @Override - public Uni<Policy.PolicyRule> getPolicy(Policy.PolicyRuleId request) { + public Uni<PolicyRuleState> policyUpdateDevice(PolicyRuleDevice request) { return Uni.createFrom() - .item(() -> Policy.PolicyRule.newBuilder().setPolicyRuleId(request).build()); + .item( + () -> + Policy.PolicyRuleState.newBuilder() + .setPolicyRuleState( + request.getPolicyRuleBasic().getPolicyRuleState().getPolicyRuleState()) + .build()); } @Override - public Uni<Policy.PolicyRuleList> getPolicyByDeviceId(ContextOuterClass.DeviceId request) { + public Uni<PolicyRuleState> policyDelete(PolicyRuleId request) { + return Uni.createFrom() + .item( + () -> + Policy.PolicyRuleState.newBuilder() + .setPolicyRuleState(RuleState.POLICY_REMOVED) + .build()); + } + + @Override + public Uni<PolicyRuleService> getPolicyService(PolicyRuleId request) { + final var policyRuleBasic = PolicyRuleBasic.newBuilder().setPolicyRuleId(request).build(); - return Uni.createFrom().item(() -> Policy.PolicyRuleList.newBuilder().build()); + return Uni.createFrom() + .item(() -> PolicyRuleService.newBuilder().setPolicyRuleBasic(policyRuleBasic).build()); } @Override - public Uni<Policy.PolicyRuleList> getPolicyByServiceId(ContextOuterClass.ServiceId request) { + public Uni<PolicyRuleDevice> getPolicyDevice(PolicyRuleId request) { + final var policyRuleBasic = PolicyRuleBasic.newBuilder().setPolicyRuleId(request).build(); - return Uni.createFrom().item(() -> Policy.PolicyRuleList.newBuilder().build()); + return Uni.createFrom() + .item(() -> PolicyRuleDevice.newBuilder().setPolicyRuleBasic(policyRuleBasic).build()); + } + + @Override + public Uni<PolicyRuleServiceList> getPolicyByServiceId(ServiceId request) { + return Uni.createFrom().item(() -> Policy.PolicyRuleServiceList.newBuilder().build()); } } diff --git a/src/policy/src/main/java/eu/teraflow/policy/PolicyService.java b/src/policy/src/main/java/eu/teraflow/policy/PolicyService.java index 5659fd61bbb40ff0a8877bb66de734ad707f7da0..14ffbb41ef60a438990bfe59e1d9539b48b51d75 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/PolicyService.java +++ b/src/policy/src/main/java/eu/teraflow/policy/PolicyService.java @@ -1,26 +1,29 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.policy; -import eu.teraflow.policy.model.PolicyRule; import eu.teraflow.policy.model.PolicyRuleState; import io.smallrye.mutiny.Uni; +import policy.Policy.PolicyRuleDevice; +import policy.Policy.PolicyRuleService; public interface PolicyService { - Uni<PolicyRuleState> addPolicy(PolicyRule policyRule); + Uni<PolicyRuleState> addPolicyService(PolicyRuleService policyRuleService); + + Uni<PolicyRuleState> addPolicyDevice(PolicyRuleDevice policyRuleDevice); } diff --git a/src/policy/src/main/java/eu/teraflow/policy/PolicyServiceImpl.java b/src/policy/src/main/java/eu/teraflow/policy/PolicyServiceImpl.java index 4b8ceba90b3c969912ad813cc934a7bd4cde40fc..c9645c5e30b1b4380bb9c0004a8b66f734f279d1 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/PolicyServiceImpl.java +++ b/src/policy/src/main/java/eu/teraflow/policy/PolicyServiceImpl.java @@ -1,34 +1,40 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.policy; -import eu.teraflow.policy.model.PolicyRule; import eu.teraflow.policy.model.PolicyRuleState; import io.smallrye.mutiny.Uni; import javax.enterprise.context.ApplicationScoped; import org.jboss.logging.Logger; +import policy.Policy.PolicyRuleDevice; +import policy.Policy.PolicyRuleService; @ApplicationScoped public class PolicyServiceImpl implements PolicyService { private static final Logger LOGGER = Logger.getLogger(PolicyServiceImpl.class); - public Uni<PolicyRuleState> addPolicy(PolicyRule policyRule) { + @Override + public Uni<PolicyRuleState> addPolicyService(PolicyRuleService policyRuleService) { + return null; + } + @Override + public Uni<PolicyRuleState> addPolicyDevice(PolicyRuleDevice policyRuleDevice) { return null; } } diff --git a/src/policy/src/main/java/eu/teraflow/policy/SimpleLivenessCheck.java b/src/policy/src/main/java/eu/teraflow/policy/SimpleLivenessCheck.java index 3b60e1ad772d8356776d131e251b7d217bf92a24..bee4157d08ada23e738282e5f7732c1db99a9dee 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/SimpleLivenessCheck.java +++ b/src/policy/src/main/java/eu/teraflow/policy/SimpleLivenessCheck.java @@ -1,18 +1,18 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.policy; @@ -27,6 +27,6 @@ public class SimpleLivenessCheck implements HealthCheck { @Override public HealthCheckResponse call() { - return HealthCheckResponse.up("Policy Service"); + return HealthCheckResponse.up("Policy Service is live"); } } diff --git a/src/policy/src/main/java/eu/teraflow/policy/SimpleReadinessCheck.java b/src/policy/src/main/java/eu/teraflow/policy/SimpleReadinessCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..0fe0c43b0cf98fd6a9432ed26ff57f03e1816095 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/SimpleReadinessCheck.java @@ -0,0 +1,32 @@ +/* +* 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. +*/ + +package eu.teraflow.policy; + +import javax.enterprise.context.ApplicationScoped; +import org.eclipse.microprofile.health.HealthCheck; +import org.eclipse.microprofile.health.HealthCheckResponse; +import org.eclipse.microprofile.health.Readiness; + +@Readiness +@ApplicationScoped +public class SimpleReadinessCheck implements HealthCheck { + + @Override + public HealthCheckResponse call() { + return HealthCheckResponse.up("Policy Service is ready"); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/ContextService.java b/src/policy/src/main/java/eu/teraflow/policy/context/ContextService.java index f8803f5147155ac795a4b852ab424ef96c1cbef5..4d2b317cb3e76b043f919fa7112147a6bda8697e 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/ContextService.java +++ b/src/policy/src/main/java/eu/teraflow/policy/context/ContextService.java @@ -1,18 +1,18 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.policy.context; diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConfigActionEnum.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConfigActionEnum.java new file mode 100644 index 0000000000000000000000000000000000000000..6cc8e844182505ed104fae7766c1ea63474c7929 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConfigActionEnum.java @@ -0,0 +1,23 @@ +/* +* 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. +*/ + +package eu.teraflow.policy.context.model; + +public enum ConfigActionEnum { + UNDEFINED, + SET, + DELETE +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConfigRule.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConfigRule.java new file mode 100644 index 0000000000000000000000000000000000000000..906acf1a3ff121584321551de6baf260f0bb7cf3 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConfigRule.java @@ -0,0 +1,49 @@ +/* +* 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. +*/ + +package eu.teraflow.policy.context.model; + +public class ConfigRule { + + private final ConfigActionEnum action; + private final String resourceKey; + private final String resourceValue; + + public ConfigRule(ConfigActionEnum action, String resourceKey, String resourceValue) { + this.action = action; + this.resourceKey = resourceKey; + this.resourceValue = resourceValue; + } + + public ConfigActionEnum getAction() { + return action; + } + + public String getResourceKey() { + return resourceKey; + } + + public String getResourceValue() { + return resourceValue; + } + + @Override + public String toString() { + return String.format( + "%s:{action:\"%s\", resourceKey:\"%s\", resourceValue:\"%s\"}", + getClass().getSimpleName(), action.toString(), resourceKey, resourceValue); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/Constraint.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/Constraint.java new file mode 100644 index 0000000000000000000000000000000000000000..edc5c0df7b789f97475d934bacb87b47792d2b01 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/Constraint.java @@ -0,0 +1,43 @@ +/* +* 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. +*/ + +package eu.teraflow.policy.context.model; + +public class Constraint { + + private final String constraintType; + private final String constraintValue; + + public Constraint(String constraintType, String constraintValue) { + this.constraintType = constraintType; + this.constraintValue = constraintValue; + } + + public String getConstraintType() { + return constraintType; + } + + public String getConstraintValue() { + return constraintValue; + } + + @Override + public String toString() { + return String.format( + "%s:{constraintType:\"%s\", constraintValue:\"%s\"}", + getClass().getSimpleName(), constraintType, constraintValue); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ContextId.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/ContextId.java deleted file mode 100644 index c5c2229427358ac0a1d5495f0c21653026141c03..0000000000000000000000000000000000000000 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/ContextId.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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. - */ - -package eu.teraflow.policy.context.model; - -public class ContextId { - - private final Uuid contextId; - - public ContextId(Uuid contextId) { - this.contextId = contextId; - } - - public Uuid getContextId() { - return contextId; - } -} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/DeviceId.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/DeviceId.java deleted file mode 100644 index af82cd4d41c417e201d5d014527304842ca472bb..0000000000000000000000000000000000000000 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/DeviceId.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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. - */ - -package eu.teraflow.policy.context.model; - -public class DeviceId { - - private final Uuid deviceId; - - public DeviceId(Uuid deviceId) { - this.deviceId = deviceId; - } - - public Uuid getDeviceId() { - return deviceId; - } -} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/EndPointId.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/EndPointId.java new file mode 100644 index 0000000000000000000000000000000000000000..e9a3cbeb074eb166452b94c8b87db5edd17f346c --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/EndPointId.java @@ -0,0 +1,49 @@ +/* +* 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. +*/ + +package eu.teraflow.policy.context.model; + +public class EndPointId { + + private final TopologyId topologyId; + private final String deviceId; + private final String id; + + public EndPointId(TopologyId topologyId, String deviceId, String id) { + this.topologyId = topologyId; + this.deviceId = deviceId; + this.id = id; + } + + public TopologyId getTopologyId() { + return topologyId; + } + + public String getDeviceId() { + return deviceId; + } + + public String getId() { + return id; + } + + @Override + public String toString() { + return String.format( + "%s:{%s, deviceId:\"%s\", id:\"%s\"}", + getClass().getSimpleName(), topologyId, deviceId, id); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/Event.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/Event.java index 309f8e077b67409f92ab0b83f784b0a14b5583e8..67da36b5c075134051a56929a39d07579381551a 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/Event.java +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/Event.java @@ -1,18 +1,18 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.policy.context.model; @@ -33,4 +33,11 @@ public class Event { public EventTypeEnum getEventTypeEnum() { return eventType; } + + @Override + public String toString() { + return String.format( + "%s:{timestamp:\"%f\", eventType:\"%s\"}", + getClass().getSimpleName(), timestamp, eventType.toString()); + } } diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/EventTypeEnum.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/EventTypeEnum.java index 30b890e60e6fe1fd73521a7445e2143ef0805a0c..2a45a89a7b026ad17ff12c8a725ebab0ed0c0af5 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/EventTypeEnum.java +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/EventTypeEnum.java @@ -1,18 +1,18 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.policy.context.model; diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/Service.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/Service.java new file mode 100644 index 0000000000000000000000000000000000000000..5441a8cb0439ef6342cd805114ebb1aada27cd42 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/Service.java @@ -0,0 +1,86 @@ +/* +* 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. +*/ + +package eu.teraflow.policy.context.model; + +import java.util.List; +import java.util.stream.Collectors; + +public class Service { + + private final ServiceId serviceId; + private final ServiceTypeEnum serviceType; + private final List<EndPointId> serviceEndPointIds; + private final List<Constraint> serviceConstraints; + private final ServiceStatus serviceStatus; + private final ServiceConfig serviceConfig; + + public Service( + ServiceId serviceId, + ServiceTypeEnum serviceType, + List<EndPointId> serviceEndPointIds, + List<Constraint> serviceConstraints, + ServiceStatus serviceStatus, + ServiceConfig serviceConfig) { + this.serviceId = serviceId; + this.serviceType = serviceType; + this.serviceEndPointIds = serviceEndPointIds; + this.serviceConstraints = serviceConstraints; + this.serviceStatus = serviceStatus; + this.serviceConfig = serviceConfig; + } + + public ServiceId getServiceId() { + return serviceId; + } + + public ServiceTypeEnum getServiceType() { + return serviceType; + } + + public List<EndPointId> getServiceEndPointIds() { + return serviceEndPointIds; + } + + public List<Constraint> getServiceConstraints() { + return serviceConstraints; + } + + public ServiceStatus getServiceStatus() { + return serviceStatus; + } + + public ServiceConfig getServiceConfig() { + return serviceConfig; + } + + @Override + public String toString() { + return String.format( + "%s:{%s, serviceType:\"%s\", [%s], [%s], %s, %s}", + getClass().getSimpleName(), + serviceId, + serviceType.toString(), + toString(serviceEndPointIds), + toString(serviceConstraints), + serviceStatus, + serviceConfig); + } + + private <T> String toString(List<T> list) { + return list.stream().map(T::toString).collect(Collectors.joining(", ")); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceConfig.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceConfig.java new file mode 100644 index 0000000000000000000000000000000000000000..22c8b3cb6674d4fa7647babb5e2ef8256bd8bd6c --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceConfig.java @@ -0,0 +1,43 @@ +/* +* 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. +*/ + +package eu.teraflow.policy.context.model; + +import java.util.List; +import java.util.stream.Collectors; + +public class ServiceConfig { + + private final List<ConfigRule> configRules; + + public ServiceConfig(List<ConfigRule> configRules) { + this.configRules = configRules; + } + + public List<ConfigRule> getConfigRules() { + return configRules; + } + + @Override + public String toString() { + return String.format( + "%s:{configRules:[%s]}", getClass().getSimpleName(), toString(configRules)); + } + + private <T> String toString(List<T> list) { + return list.stream().map(T::toString).collect(Collectors.joining(", ")); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceId.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceId.java index 3680cb5ef385e4333f5e8e9707dca17d5351c9b7..6229c1de7541dc63e3d9f18706cf33c4b4df57e9 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceId.java +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceId.java @@ -1,37 +1,43 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.policy.context.model; public class ServiceId { - private final ContextId contextId; - private final Uuid serviceUuid; + private final String contextId; + private final String id; - public ServiceId(ContextId contextId, Uuid serviceUuid) { + public ServiceId(String contextId, String id) { this.contextId = contextId; - this.serviceUuid = serviceUuid; + this.id = id; } - public ContextId getContextId() { + public String getContextId() { return contextId; } - public Uuid getServiceUuid() { - return serviceUuid; + public String getId() { + return id; + } + + @Override + public String toString() { + return String.format( + "%s:{contextId:\"%s\", id:\"%s\"}", getClass().getSimpleName(), contextId, id); } } diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceStatus.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceStatus.java new file mode 100644 index 0000000000000000000000000000000000000000..b5466d1f3e3f645584df434d3076fe43f19ed823 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceStatus.java @@ -0,0 +1,35 @@ +/* +* 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. +*/ + +package eu.teraflow.policy.context.model; + +public class ServiceStatus { + + private final ServiceStatusEnum status; + + public ServiceStatus(ServiceStatusEnum status) { + this.status = status; + } + + public ServiceStatusEnum getServiceStatus() { + return status; + } + + @Override + public String toString() { + return String.format("%s:{serviceStatus:\"%s\"}", getClass().getSimpleName(), status); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceStatusEnum.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceStatusEnum.java new file mode 100644 index 0000000000000000000000000000000000000000..e39e2fa2c8b4e279a355221c0c246e142d38b51e --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceStatusEnum.java @@ -0,0 +1,24 @@ +/* +* 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. +*/ + +package eu.teraflow.policy.context.model; + +public enum ServiceStatusEnum { + UNDEFINED, + PLANNED, + ACTIVE, + PENDING_REMOVAL +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceTypeEnum.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceTypeEnum.java new file mode 100644 index 0000000000000000000000000000000000000000..f13a408f987f6e753e801e2ae804a8db8d951f4d --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceTypeEnum.java @@ -0,0 +1,24 @@ +/* +* 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. +*/ + +package eu.teraflow.policy.context.model; + +public enum ServiceTypeEnum { + UNKNOWN, + L3NM, + L2NM, + TAPI_CONNECTIVITY_SERVICE +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/TopologyId.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/TopologyId.java new file mode 100644 index 0000000000000000000000000000000000000000..95157ba8c6ec6ed3d91886282ef845f59e9f9d91 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/TopologyId.java @@ -0,0 +1,43 @@ +/* +* 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. +*/ + +package eu.teraflow.policy.context.model; + +public class TopologyId { + + private final String contextId; + private final String id; + + public TopologyId(String contextId, String id) { + + this.contextId = contextId; + this.id = id; + } + + public String getContextId() { + return contextId; + } + + public String getId() { + return id; + } + + @Override + public String toString() { + return String.format( + "%s:{contextId:\"%s\", id:\"%s\"}", getClass().getSimpleName(), contextId, id); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/Uuid.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/Uuid.java deleted file mode 100644 index 857f7a51a2a8fed2ee954da8a9f4244a57c237be..0000000000000000000000000000000000000000 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/Uuid.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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. - */ - -package eu.teraflow.policy.context.model; - -public class Uuid { - - private String id; - - public Uuid(String id) { - this.id = id; - } - - public String getId() { - return id; - } -} diff --git a/src/policy/src/main/java/eu/teraflow/policy/kpi_sample_types/model/KpiSampleType.java b/src/policy/src/main/java/eu/teraflow/policy/kpi_sample_types/model/KpiSampleType.java new file mode 100644 index 0000000000000000000000000000000000000000..1bedde35212383e42c7fabfe832d4bd4df34e99b --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/kpi_sample_types/model/KpiSampleType.java @@ -0,0 +1,25 @@ +/* +* 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. +*/ + +package eu.teraflow.policy.kpi_sample_types.model; + +public enum KpiSampleType { + UNKNOWN, + PACKETS_TRANSMITTED, + PACKETS_RECEIVED, + BYTES_TRANSMITTED, + BYTES_RECEIVED +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/BooleanOperator.java b/src/policy/src/main/java/eu/teraflow/policy/model/BooleanOperator.java new file mode 100644 index 0000000000000000000000000000000000000000..4de1743d0178d5f61737a2830b49370068156c8f --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/model/BooleanOperator.java @@ -0,0 +1,7 @@ +package eu.teraflow.policy.model; + +public enum BooleanOperator { + POLICYRULE_CONDITION_BOOLEAN_UNDEFINED, + POLICYRULE_CONDITION_BOOLEAN_AND, + POLICYRULE_CONDITION_BOOLEAN_OR +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/NumericalOperator.java b/src/policy/src/main/java/eu/teraflow/policy/model/NumericalOperator.java new file mode 100644 index 0000000000000000000000000000000000000000..ccd424a02ba771edc215ee92e7bfc0125a5b5c27 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/model/NumericalOperator.java @@ -0,0 +1,11 @@ +package eu.teraflow.policy.model; + +public enum NumericalOperator { + POLICY_RULE_CONDITION_NUMERICAL_UNDEFINED, + POLICY_RULE_CONDITION_NUMERICAL_EQUAL, + POLICY_RULE_CONDITION_NUMERICAL_NOT_EQUAL, + POLICY_RULE_CONDITION_NUMERICAL_LESS_THAN, + POLICY_RULE_CONDITION_NUMERICAL_LESS_THAN_EQUAL, + POLICY_RULE_CONDITION_NUMERICAL_GREATER_THAN, + POLICY_RULE_CONDITION_NUMERICAL_GREATER_THAN_EQUAL +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRule.java b/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRule.java deleted file mode 100644 index d9f597405300c941b3ab569fdf925fcc29b5e802..0000000000000000000000000000000000000000 --- a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRule.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 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. - */ - -package eu.teraflow.policy.model; - -import eu.teraflow.policy.context.model.ContextId; -import eu.teraflow.policy.context.model.ServiceId; - -public class PolicyRule { - - private final PolicyRuleId policyRuleId; - private final PolicyRuleType policyRuleType; - private final PolicyRulePriority policyRulePriority; - private final PolicyRuleEvent policyRuleEvent; - private final PolicyRuleCondition policyRuleCondition; - private final PolicyRuleAction policyRuleAction; - private final ServiceId serviceId; - private final ContextId contextId; - - public PolicyRule( - PolicyRuleId policyRuleId, - PolicyRuleType policyRuleType, - PolicyRulePriority policyRulePriority, - PolicyRuleEvent policyRuleEvent, - PolicyRuleCondition policyRuleCondition, - PolicyRuleAction policyRuleAction, - ServiceId serviceId, - ContextId contextId) { - this.policyRuleId = policyRuleId; - this.policyRuleType = policyRuleType; - this.policyRulePriority = policyRulePriority; - this.policyRuleEvent = policyRuleEvent; - this.policyRuleCondition = policyRuleCondition; - this.policyRuleAction = policyRuleAction; - this.serviceId = serviceId; - this.contextId = contextId; - } - - public PolicyRuleId getPolicyRuleId() { - return policyRuleId; - } - - public PolicyRuleType getPolicyRuleType() { - return policyRuleType; - } - - public PolicyRulePriority getPolicyRulePriority() { - return policyRulePriority; - } - - public PolicyRuleEvent getPolicyRuleEvent() { - return policyRuleEvent; - } - - public PolicyRuleCondition getPolicyRuleCondition() { - return policyRuleCondition; - } - - public PolicyRuleAction getPolicyRuleAction() { - return policyRuleAction; - } - - public ServiceId getServiceId() { - return serviceId; - } - - public ContextId getContextId() { - return contextId; - } -} diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleAction.java b/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleAction.java index d3a3fd036b0b257e5b230860a529c30ad858b8b1..baa19cb8d0016895de9d5eccf5bd0e36d9659b61 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleAction.java +++ b/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleAction.java @@ -1,37 +1,51 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.policy.model; +import java.util.List; +import java.util.stream.Collectors; + public class PolicyRuleAction { - private final PolicyRuleVariable policyRuleVariable; - private final PolicyRuleValue policyRuleValue; + private final PolicyRuleActionEnum policyRuleActionEnum; + private final List<String> parameters; + + public PolicyRuleAction(PolicyRuleActionEnum policyRuleActionEnum, List<String> parameters) { - public PolicyRuleAction(PolicyRuleVariable policyRuleVariable, PolicyRuleValue policyRuleValue) { + this.policyRuleActionEnum = policyRuleActionEnum; + this.parameters = parameters; + } + + public PolicyRuleActionEnum getPolicyRuleActionEnum() { + return policyRuleActionEnum; + } - this.policyRuleVariable = policyRuleVariable; - this.policyRuleValue = policyRuleValue; + public List<String> getPolicyRuleActionParameters() { + return parameters; } - public PolicyRuleVariable getPolicyRuleVariable() { - return policyRuleVariable; + @Override + public String toString() { + return String.format( + "%s:{policyRuleActionEnum:\"%s\", [%s]}", + getClass().getSimpleName(), policyRuleActionEnum.toString(), toString(parameters)); } - public PolicyRuleValue getPolicyRuleValue() { - return policyRuleValue; + private <T> String toString(List<T> list) { + return list.stream().map(T::toString).collect(Collectors.joining(", ")); } } diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleActionEnum.java b/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleActionEnum.java new file mode 100644 index 0000000000000000000000000000000000000000..317daa02939bfe21c267b758999bae9d20f294af --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleActionEnum.java @@ -0,0 +1,8 @@ +package eu.teraflow.policy.model; + +public enum PolicyRuleActionEnum { + POLICY_RULE_ACTION_NO_ACTION, + POLICY_RULE_ACTION_SET_DEVICE_STATUS, + POLICY_RULE_ACTION_ADD_SERVICE_CONFIGRULE, + POLICY_RULE_ACTION_ADD_SERVICE_CONSTRAINT +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleCondition.java b/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleCondition.java index 8f7b74e3f4de1d0019555dcc58de8958042ece13..714cc5582cce4ce3e606851acb2f2f2b62614e29 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleCondition.java +++ b/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleCondition.java @@ -1,38 +1,51 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.policy.model; +import eu.teraflow.policy.monitoring.model.KpiValue; + public class PolicyRuleCondition { - private final PolicyRuleVariable policyRuleVariable; - private final PolicyRuleValue policyRuleValue; + private final String kpiId; + private final NumericalOperator numericalOperator; + private final KpiValue<?> kpiValue; + + public PolicyRuleCondition(String kpiId, NumericalOperator numericalOperator, KpiValue kpiValue) { + this.kpiId = kpiId; + this.numericalOperator = numericalOperator; + this.kpiValue = kpiValue; + } - public PolicyRuleCondition( - PolicyRuleVariable policyRuleVariable, PolicyRuleValue policyRuleValue) { + public String getKpiId() { + return kpiId; + } - this.policyRuleVariable = policyRuleVariable; - this.policyRuleValue = policyRuleValue; + public NumericalOperator getNumericalOperator() { + return numericalOperator; } - public PolicyRuleVariable getPolicyRuleVariable() { - return policyRuleVariable; + public KpiValue getKpiValue() { + return kpiValue; } - public PolicyRuleValue getPolicyRuleValue() { - return policyRuleValue; + @Override + public String toString() { + return String.format( + "%s:{kpiId:\"%s\", numericalOperator:\"%s\", %s}", + getClass().getSimpleName(), kpiId, numericalOperator.toString(), kpiValue); } } diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleEvent.java b/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleEvent.java deleted file mode 100644 index c5660b95d456d6322eafacf5c32580778bb78c2f..0000000000000000000000000000000000000000 --- a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleEvent.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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. - */ - -package eu.teraflow.policy.model; - -import eu.teraflow.policy.context.model.Event; - -public class PolicyRuleEvent { - - private final Event event; - - public PolicyRuleEvent(Event event) { - this.event = event; - } - - public Event getEvent() { - return event; - } -} diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleId.java b/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleId.java deleted file mode 100644 index e3a25557a8ee7012196572a6db41e5095ccc4581..0000000000000000000000000000000000000000 --- a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleId.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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. - */ - -package eu.teraflow.policy.model; - -import eu.teraflow.policy.context.model.Uuid; - -public class PolicyRuleId { - - private final Uuid policyRuleId; - - public PolicyRuleId(Uuid policyRuleId) { - this.policyRuleId = policyRuleId; - } - - public Uuid getPolicyRuleId() { - return policyRuleId; - } -} diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRulePriority.java b/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRulePriority.java deleted file mode 100644 index 7113a20fa7756ecc707197232dcca6fe74d27898..0000000000000000000000000000000000000000 --- a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRulePriority.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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. - */ - -package eu.teraflow.policy.model; - -public class PolicyRulePriority { - - private final int policyRulePriority; - - public PolicyRulePriority(int policyRulePriority) { - this.policyRulePriority = policyRulePriority; - } - - public int getPolicyRulePriority() { - return policyRulePriority; - } -} diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleState.java b/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleState.java index 465187a5fd2a717e8b022fabd4f0062d4a454dda..38ee0a73b187420cfdd3f0bd7527d5196d7bad9f 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleState.java +++ b/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleState.java @@ -1,38 +1,43 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.policy.model; -import eu.teraflow.policy.context.model.Uuid; - public class PolicyRuleState { - private final Uuid policeRuleId; + private final String policeRuleId; private final RuleState ruleState; - public PolicyRuleState(Uuid policeRuleId, RuleState ruleState) { + public PolicyRuleState(String policeRuleId, RuleState ruleState) { this.policeRuleId = policeRuleId; this.ruleState = ruleState; } - public Uuid getPolicyRuleId() { + public String getPolicyRuleId() { return policeRuleId; } public RuleState getRuleState() { return ruleState; } + + @Override + public String toString() { + return String.format( + "%s:{policeRuleId:\"%s\", ruleState:\"%s\"}", + getClass().getSimpleName(), policeRuleId, ruleState); + } } diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleType.java b/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleType.java deleted file mode 100644 index 1b46b249e3ca5ac49f8d23c3210cf1bb08204237..0000000000000000000000000000000000000000 --- a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleType.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * 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. - */ - -package eu.teraflow.policy.model; - -public enum PolicyRuleType { - DEVICE, - NETWORK -} diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleValue.java b/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleValue.java deleted file mode 100644 index 2e6498f233d9a31a21d7349cd53a9f36874b7413..0000000000000000000000000000000000000000 --- a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleValue.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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. - */ - -package eu.teraflow.policy.model; - -public class PolicyRuleValue { - - private final String policyRuleValue; - - public PolicyRuleValue(String policyRuleValue) { - this.policyRuleValue = policyRuleValue; - } - - public String getPolicyRuleValue() { - return policyRuleValue; - } -} diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleVariable.java b/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleVariable.java deleted file mode 100644 index 10f86bbcadfcf936b2260fe81d0b6cfa4721752d..0000000000000000000000000000000000000000 --- a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleVariable.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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. - */ - -package eu.teraflow.policy.model; - -public class PolicyRuleVariable { - - private final String policyRuleVariable; - - public PolicyRuleVariable(String policyRuleVariable) { - this.policyRuleVariable = policyRuleVariable; - } - - public String getPolicyRuleVariable() { - return policyRuleVariable; - } -} diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/RuleState.java b/src/policy/src/main/java/eu/teraflow/policy/model/RuleState.java index 05e051348652256bb0707c686e9e201b565042d8..6c8aabdb04399176714f06e85b1a00d18e6e867d 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/model/RuleState.java +++ b/src/policy/src/main/java/eu/teraflow/policy/model/RuleState.java @@ -1,18 +1,18 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.policy.model; diff --git a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/BooleanKpiValue.java b/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/BooleanKpiValue.java new file mode 100644 index 0000000000000000000000000000000000000000..aa2fe96cd4fdd96ea854de03bf7aea794fe4de00 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/BooleanKpiValue.java @@ -0,0 +1,20 @@ +package eu.teraflow.policy.monitoring.model; + +public class BooleanKpiValue implements KpiValue<Boolean> { + + private final boolean value; + + public BooleanKpiValue(boolean value) { + this.value = value; + } + + @Override + public Boolean getValue() { + return this.value; + } + + @Override + public String toString() { + return String.format("%s:{value:\"%b\"}", getClass().getSimpleName(), value); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/FloatKpiValue.java b/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/FloatKpiValue.java new file mode 100644 index 0000000000000000000000000000000000000000..d183c9c756f678a08c12669b27e46797eb745b51 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/FloatKpiValue.java @@ -0,0 +1,20 @@ +package eu.teraflow.policy.monitoring.model; + +public class FloatKpiValue implements KpiValue<Float> { + + private final float value; + + public FloatKpiValue(float value) { + this.value = value; + } + + @Override + public Float getValue() { + return this.value; + } + + @Override + public String toString() { + return String.format("%s:{value:\"%f\"}", getClass().getSimpleName(), value); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/IntegerKpiValue.java b/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/IntegerKpiValue.java new file mode 100644 index 0000000000000000000000000000000000000000..b7048b188687657d3c6253d71cce32add4b80306 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/IntegerKpiValue.java @@ -0,0 +1,20 @@ +package eu.teraflow.policy.monitoring.model; + +public class IntegerKpiValue implements KpiValue<Integer> { + + private final int value; + + public IntegerKpiValue(int value) { + this.value = value; + } + + @Override + public Integer getValue() { + return this.value; + } + + @Override + public String toString() { + return String.format("%s:{value:\"%d\"}", getClass().getSimpleName(), value); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/Kpi.java b/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/Kpi.java new file mode 100644 index 0000000000000000000000000000000000000000..4d84c29d4f32cd2605cf2d20a67b0fa41f801ab1 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/Kpi.java @@ -0,0 +1,49 @@ +/* +* 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. +*/ + +package eu.teraflow.policy.monitoring.model; + +public class Kpi { + + private final String kpiId; + private final String timestamp; + private final String kpiValue; + + public Kpi(String kpiId, String timestamp, String kpiValue) { + this.kpiId = kpiId; + this.timestamp = timestamp; + this.kpiValue = kpiValue; + } + + public String getKpiId() { + return kpiId; + } + + public String getTimestamp() { + return timestamp; + } + + public String getKpiValue() { + return kpiValue; + } + + @Override + public String toString() { + return String.format( + "%s:{kpiId:\"%s\", timeStamp:\"%s\", kpiValue:\"%s\"}", + getClass().getSimpleName(), kpiId, timestamp, kpiValue); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/KpiDescriptor.java b/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/KpiDescriptor.java new file mode 100644 index 0000000000000000000000000000000000000000..85e09ce2e6f7ac297657e59c7868fbbd750675b8 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/KpiDescriptor.java @@ -0,0 +1,75 @@ +/* +* 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. +*/ + +package eu.teraflow.policy.monitoring.model; + +import eu.teraflow.policy.context.model.EndPointId; +import eu.teraflow.policy.context.model.ServiceId; +import eu.teraflow.policy.kpi_sample_types.model.KpiSampleType; + +public class KpiDescriptor { + + private final String kpiDescription; + private final KpiSampleType kpiSampleType; + private final String deviceId; + private final EndPointId endPointId; + private final ServiceId serviceId; + + public KpiDescriptor( + String kpiDescription, + KpiSampleType kpiSampleType, + String deviceId, + EndPointId endPointId, + ServiceId serviceId) { + this.kpiDescription = kpiDescription; + this.kpiSampleType = kpiSampleType; + this.deviceId = deviceId; + this.endPointId = endPointId; + this.serviceId = serviceId; + } + + public String getKpiDescription() { + return kpiDescription; + } + + public KpiSampleType getKpiSampleType() { + return kpiSampleType; + } + + public String getDeviceId() { + return deviceId; + } + + public EndPointId getEndPointId() { + return endPointId; + } + + public ServiceId getServiceId() { + return serviceId; + } + + @Override + public String toString() { + return String.format( + "%s:{kpiDescription:\"%s\", kpiSampleType:\"%s\", deviceId:\"%s\", %s, %s}", + getClass().getSimpleName(), + kpiDescription, + kpiSampleType.toString(), + deviceId, + endPointId, + serviceId); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/KpiValue.java b/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/KpiValue.java new file mode 100644 index 0000000000000000000000000000000000000000..4313c82698086dcf7b755ca522fbc6f952233423 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/KpiValue.java @@ -0,0 +1,6 @@ +package eu.teraflow.policy.monitoring.model; + +public interface KpiValue<T> { + + public T getValue(); +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/StringKpiValue.java b/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/StringKpiValue.java new file mode 100644 index 0000000000000000000000000000000000000000..fade272217208a44f70e0031fbf7c3bc54f1e196 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/StringKpiValue.java @@ -0,0 +1,20 @@ +package eu.teraflow.policy.monitoring.model; + +public class StringKpiValue implements KpiValue<String> { + + private final String value; + + public StringKpiValue(String value) { + this.value = value; + } + + @Override + public String getValue() { + return this.value; + } + + @Override + public String toString() { + return String.format("%s:{value:\"%s\"}", getClass().getSimpleName(), value); + } +} diff --git a/src/policy/src/main/proto/monitoring.proto b/src/policy/src/main/proto/monitoring.proto new file mode 120000 index 0000000000000000000000000000000000000000..aceaa7328099fe736163be048ee1ad21a61d79a2 --- /dev/null +++ b/src/policy/src/main/proto/monitoring.proto @@ -0,0 +1 @@ +../../../../../proto/monitoring.proto \ No newline at end of file diff --git a/src/policy/src/main/proto/policy-action.proto b/src/policy/src/main/proto/policy-action.proto new file mode 120000 index 0000000000000000000000000000000000000000..bb1531bd6607ff005fdaae9d0be27ee65e3515ca --- /dev/null +++ b/src/policy/src/main/proto/policy-action.proto @@ -0,0 +1 @@ +../../../../../proto/policy-action.proto \ No newline at end of file diff --git a/src/policy/src/main/proto/policy-condition.proto b/src/policy/src/main/proto/policy-condition.proto new file mode 120000 index 0000000000000000000000000000000000000000..f847d8b602252979135ead0876c50a161f049a72 --- /dev/null +++ b/src/policy/src/main/proto/policy-condition.proto @@ -0,0 +1 @@ +../../../../../proto/policy-condition.proto \ No newline at end of file diff --git a/src/policy/src/main/proto/service.proto b/src/policy/src/main/proto/service.proto new file mode 120000 index 0000000000000000000000000000000000000000..5ca543da01298ca25912a534f460d4a7183e3a60 --- /dev/null +++ b/src/policy/src/main/proto/service.proto @@ -0,0 +1 @@ +../../../../../proto/service.proto \ No newline at end of file diff --git a/src/policy/src/main/resources/application.yml b/src/policy/src/main/resources/application.yml index 2a5a96ccc973f519d7515f7f13e6d8b50048da2a..9ccfae3aaca5b52b51664aaa55a6e45a24def1ee 100644 --- a/src/policy/src/main/resources/application.yml +++ b/src/policy/src/main/resources/application.yml @@ -13,32 +13,53 @@ # limitations under the License. quarkus: + banner: + path: teraflow-policy-banner.txt grpc: server: - port: 9999 + port: 6060 enable-reflection-service: true + clients: + context: + host: ${quarkus.kubernetes.env.vars.context-service-host} + port: 1010 + monitoring: + host: ${quarkus.kubernetes.env.vars.monitoring-service-host} + port: 7070 + service: + host: ${quarkus.kubernetes.env.vars.service-service-host} + port: 3030 + http: port: 8080 + container-image: group: teraflow-h2020 name: controller/policy registry: registry.gitlab.com + kubernetes: name: policyservice image-pull-policy: Always - add-version-to-label-selectors: false labels: app: policyservice + add-version-to-label-selectors: false readiness-probe: - initial-delay: 5s - period: 45s + initial-delay: 2s + period: 10s liveness-probe: - initial-delay: 5s - period: 45s + initial-delay: 2s + period: 10s ports: http: host-port: 8080 container-port: 8080 grpc-server: - host-port: 9999 - container-port: 9999 + host-port: 6060 + container-port: 6060 + env: + vars: + context-service-host: "contextservice" + monitoring-service-host: "monitoringservice" + service-service-host: "serviceservice" + diff --git a/src/policy/src/main/resources/teraflow-policy-banner.txt b/src/policy/src/main/resources/teraflow-policy-banner.txt new file mode 100644 index 0000000000000000000000000000000000000000..d5effd98e7cf1fae8cd623674a3675181b00296f --- /dev/null +++ b/src/policy/src/main/resources/teraflow-policy-banner.txt @@ -0,0 +1,9 @@ + + _______ ______ _ _____ _ _ + |__ __| | ____| | | __ \ | (_) + | | ___ _ __ __ _| |__ | | _____ __ | |__) |__ | |_ ___ _ _ + | |/ _ \ '__/ _` | __| | |/ _ \ \ /\ / / | ___/ _ \| | |/ __| | | | + | | __/ | | (_| | | | | (_) \ V V / | | | (_) | | | (__| |_| | + |_|\___|_| \__,_|_| |_|\___/ \_/\_/ |_| \___/|_|_|\___|\__, | + __/ | + |___/ diff --git a/src/policy/src/test/java/eu/teraflow/policy/PolicyServiceTest.java b/src/policy/src/test/java/eu/teraflow/policy/PolicyServiceTest.java index abb9bdd369a7722b201e209ac27557e99e957d65..bf1af532f06accf9c0410548ad7f4aa85757dbb1 100644 --- a/src/policy/src/test/java/eu/teraflow/policy/PolicyServiceTest.java +++ b/src/policy/src/test/java/eu/teraflow/policy/PolicyServiceTest.java @@ -1,18 +1,18 @@ /* - * 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. - */ +* 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. +*/ package eu.teraflow.policy; @@ -29,6 +29,8 @@ import java.util.concurrent.TimeoutException; import org.jboss.logging.Logger; import org.junit.jupiter.api.Test; import policy.Policy; +import policy.Policy.PolicyRuleBasic; +import policy.Policy.RuleState; import policy.PolicyService; @QuarkusTest @@ -38,47 +40,89 @@ class PolicyServiceTest { @GrpcClient PolicyService client; @Test - void shouldAddPolicy() throws ExecutionException, InterruptedException, TimeoutException { + void shouldAddPolicyService() throws ExecutionException, InterruptedException, TimeoutException { CompletableFuture<String> message = new CompletableFuture<>(); - final var uuid = - ContextOuterClass.Uuid.newBuilder() - .setUuid(UUID.fromString("0f14d0ab-9608-7862-a9e4-5ed26688389b").toString()) - .build(); - final var policyRuleId = Policy.PolicyRuleId.newBuilder().setUuid(uuid).build(); - final var policyRule = Policy.PolicyRule.newBuilder().setPolicyRuleId(policyRuleId).build(); + final var expectedPolicyRuleState = + Policy.PolicyRuleState.newBuilder().setPolicyRuleState(RuleState.POLICY_ACTIVE).build(); + + final var policyRuleBasic = + PolicyRuleBasic.newBuilder().setPolicyRuleState(expectedPolicyRuleState).build(); + final var policyRuleService = + Policy.PolicyRuleService.newBuilder().setPolicyRuleBasic(policyRuleBasic).build(); client - .policyAdd(policyRule) + .policyAddService(policyRuleService) .subscribe() - .with( - policyRuleState -> { - LOGGER.infof("Adding policy: %s", policyRuleState.getPolicyRuleId().getUuid()); - message.complete(policyRuleState.getPolicyRuleId().getUuid()); - }); - assertThat(message.get(5, TimeUnit.SECONDS)).isEqualTo(policyRuleId.getUuid().getUuid()); + .with(policyRuleState -> message.complete(policyRuleState.getPolicyRuleState().toString())); + + assertThat(message.get(5, TimeUnit.SECONDS)) + .isEqualTo(expectedPolicyRuleState.getPolicyRuleState().toString()); } @Test - void shouldUpdatePolicy() throws ExecutionException, InterruptedException, TimeoutException { + void shouldAddPolicyDevice() throws ExecutionException, InterruptedException, TimeoutException { CompletableFuture<String> message = new CompletableFuture<>(); - final var uuid = - ContextOuterClass.Uuid.newBuilder() - .setUuid(UUID.fromString("0f14d0ab-9608-7862-a9e4-5ed26688389b").toString()) - .build(); - final var policyRuleId = Policy.PolicyRuleId.newBuilder().setUuid(uuid).build(); - final var policyRule = Policy.PolicyRule.newBuilder().setPolicyRuleId(policyRuleId).build(); + final var expectedPolicyRuleState = + Policy.PolicyRuleState.newBuilder().setPolicyRuleState(RuleState.POLICY_EFFECTIVE).build(); + + final var policyRuleBasic = + PolicyRuleBasic.newBuilder().setPolicyRuleState(expectedPolicyRuleState).build(); + final var policyRuleDevice = + Policy.PolicyRuleDevice.newBuilder().setPolicyRuleBasic(policyRuleBasic).build(); client - .policyUpdate(policyRule) + .policyAddDevice(policyRuleDevice) .subscribe() - .with( - policyRuleState -> { - LOGGER.infof("Updating policy: %s", policyRuleState.getPolicyRuleId().getUuid()); - message.complete(policyRuleState.getPolicyRuleId().getUuid()); - }); - assertThat(message.get(5, TimeUnit.SECONDS)).isEqualTo(policyRuleId.getUuid().getUuid()); + .with(policyRuleState -> message.complete(policyRuleState.getPolicyRuleState().toString())); + + assertThat(message.get(5, TimeUnit.SECONDS)) + .isEqualTo(expectedPolicyRuleState.getPolicyRuleState().toString()); + } + + @Test + void shouldUpdatePolicyService() + throws ExecutionException, InterruptedException, TimeoutException { + CompletableFuture<String> message = new CompletableFuture<>(); + + final var expectedPolicyRuleState = + Policy.PolicyRuleState.newBuilder().setPolicyRuleState(RuleState.POLICY_ENFORCED).build(); + + final var policyRuleBasic = + PolicyRuleBasic.newBuilder().setPolicyRuleState(expectedPolicyRuleState).build(); + final var policyRuleService = + Policy.PolicyRuleService.newBuilder().setPolicyRuleBasic(policyRuleBasic).build(); + + client + .policyUpdateService(policyRuleService) + .subscribe() + .with(policyRuleState -> message.complete(policyRuleState.getPolicyRuleState().toString())); + + assertThat(message.get(5, TimeUnit.SECONDS)) + .isEqualTo(expectedPolicyRuleState.getPolicyRuleState().toString()); + } + + @Test + void shouldUpdatePolicyDevice() + throws ExecutionException, InterruptedException, TimeoutException { + CompletableFuture<String> message = new CompletableFuture<>(); + + final var expectedPolicyRuleState = + Policy.PolicyRuleState.newBuilder().setPolicyRuleState(RuleState.POLICY_ENFORCED).build(); + + final var policyRuleBasic = + PolicyRuleBasic.newBuilder().setPolicyRuleState(expectedPolicyRuleState).build(); + final var policyRuleDevice = + Policy.PolicyRuleDevice.newBuilder().setPolicyRuleBasic(policyRuleBasic).build(); + + client + .policyUpdateDevice(policyRuleDevice) + .subscribe() + .with(policyRuleState -> message.complete(policyRuleState.getPolicyRuleState().toString())); + + assertThat(message.get(5, TimeUnit.SECONDS)) + .isEqualTo(expectedPolicyRuleState.getPolicyRuleState().toString()); } @Test @@ -90,21 +134,21 @@ class PolicyServiceTest { .setUuid(UUID.fromString("0f14d0ab-9608-7862-a9e4-5ed26688389b").toString()) .build(); final var policyRuleId = Policy.PolicyRuleId.newBuilder().setUuid(uuid).build(); - final var policyRule = Policy.PolicyRule.newBuilder().setPolicyRuleId(policyRuleId).build(); + + final var expectedPolicyRuleState = + Policy.PolicyRuleState.newBuilder().setPolicyRuleState(RuleState.POLICY_REMOVED).build(); client - .policyDelete(policyRule) + .policyDelete(policyRuleId) .subscribe() - .with( - policyRuleState -> { - LOGGER.infof("Deleting policy: %s", policyRuleState.getPolicyRuleId().getUuid()); - message.complete(policyRuleState.getPolicyRuleId().getUuid()); - }); - assertThat(message.get(5, TimeUnit.SECONDS)).isEqualTo(policyRuleId.getUuid().getUuid()); + .with(policyRuleState -> message.complete(policyRuleState.getPolicyRuleState().toString())); + + assertThat(message.get(5, TimeUnit.SECONDS)) + .isEqualTo(expectedPolicyRuleState.getPolicyRuleState().toString()); } @Test - void shouldGetPolicy() throws ExecutionException, InterruptedException, TimeoutException { + void shouldGetPolicyService() throws ExecutionException, InterruptedException, TimeoutException { CompletableFuture<String> message = new CompletableFuture<>(); final var uuid = @@ -114,40 +158,43 @@ class PolicyServiceTest { final var policyRuleId = Policy.PolicyRuleId.newBuilder().setUuid(uuid).build(); client - .getPolicy(policyRuleId) + .getPolicyService(policyRuleId) .subscribe() .with( - policyRuleState -> { + policyRuleService -> { LOGGER.infof( "Getting policy with ID: %s", - policyRuleState.getPolicyRuleId().getUuid().getUuid()); - message.complete(policyRuleState.getPolicyRuleId().getUuid().getUuid()); + policyRuleService.getPolicyRuleBasic().getPolicyRuleId().getUuid()); + message.complete( + policyRuleService.getPolicyRuleBasic().getPolicyRuleId().getUuid().getUuid()); }); + assertThat(message.get(5, TimeUnit.SECONDS)).isEqualTo(policyRuleId.getUuid().getUuid()); } @Test - void shouldGetPolicyByDeviceId() - throws ExecutionException, InterruptedException, TimeoutException { - + void shouldGetPolicyDevice() throws ExecutionException, InterruptedException, TimeoutException { CompletableFuture<String> message = new CompletableFuture<>(); final var uuid = ContextOuterClass.Uuid.newBuilder() .setUuid(UUID.fromString("0f14d0ab-9608-7862-a9e4-5ed26688389b").toString()) .build(); - final var deviceId = ContextOuterClass.DeviceId.newBuilder().setDeviceUuid(uuid).build(); + final var policyRuleId = Policy.PolicyRuleId.newBuilder().setUuid(uuid).build(); client - .getPolicyByDeviceId(deviceId) + .getPolicyDevice(policyRuleId) .subscribe() .with( - policyRuleList -> { - LOGGER.infof("Getting policyRuleList with ID: %s", policyRuleList); - message.complete(policyRuleList.toString()); + policyRuleService -> { + LOGGER.infof( + "Getting policy with ID: %s", + policyRuleService.getPolicyRuleBasic().getPolicyRuleId().getUuid()); + message.complete( + policyRuleService.getPolicyRuleBasic().getPolicyRuleId().getUuid().getUuid()); }); - assertThat(message.get(5, TimeUnit.SECONDS)).isEmpty(); + assertThat(message.get(5, TimeUnit.SECONDS)).isEqualTo(policyRuleId.getUuid().getUuid()); } @Test diff --git a/src/policy/target/generated-sources/grpc/context/ContextOuterClass.java b/src/policy/target/generated-sources/grpc/context/ContextOuterClass.java index 168ddf78b3a0233f3157e984fb7d925783bcd3b0..ee807d7a7c69256b7a4c99c5139fafe076898918 100644 --- a/src/policy/target/generated-sources/grpc/context/ContextOuterClass.java +++ b/src/policy/target/generated-sources/grpc/context/ContextOuterClass.java @@ -661,6 +661,141 @@ public final class ContextOuterClass { // @@protoc_insertion_point(enum_scope:context.ServiceStatusEnum) } + /** + * Protobuf enum {@code context.SliceStatusEnum} + */ + public enum SliceStatusEnum + implements com.google.protobuf.ProtocolMessageEnum { + /** + * <code>SLICESTATUS_UNDEFINED = 0;</code> + */ + SLICESTATUS_UNDEFINED(0), + /** + * <code>SLICESTATUS_PLANNED = 1;</code> + */ + SLICESTATUS_PLANNED(1), + /** + * <code>SLICESTATUS_INIT = 2;</code> + */ + SLICESTATUS_INIT(2), + /** + * <code>SLICESTATUS_ACTIVE = 3;</code> + */ + SLICESTATUS_ACTIVE(3), + /** + * <code>SLICESTATUS_DEINIT = 4;</code> + */ + SLICESTATUS_DEINIT(4), + UNRECOGNIZED(-1), + ; + + /** + * <code>SLICESTATUS_UNDEFINED = 0;</code> + */ + public static final int SLICESTATUS_UNDEFINED_VALUE = 0; + /** + * <code>SLICESTATUS_PLANNED = 1;</code> + */ + public static final int SLICESTATUS_PLANNED_VALUE = 1; + /** + * <code>SLICESTATUS_INIT = 2;</code> + */ + public static final int SLICESTATUS_INIT_VALUE = 2; + /** + * <code>SLICESTATUS_ACTIVE = 3;</code> + */ + public static final int SLICESTATUS_ACTIVE_VALUE = 3; + /** + * <code>SLICESTATUS_DEINIT = 4;</code> + */ + public static final int SLICESTATUS_DEINIT_VALUE = 4; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SliceStatusEnum valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static SliceStatusEnum forNumber(int value) { + switch (value) { + case 0: return SLICESTATUS_UNDEFINED; + case 1: return SLICESTATUS_PLANNED; + case 2: return SLICESTATUS_INIT; + case 3: return SLICESTATUS_ACTIVE; + case 4: return SLICESTATUS_DEINIT; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap<SliceStatusEnum> + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + SliceStatusEnum> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap<SliceStatusEnum>() { + public SliceStatusEnum findValueByNumber(int number) { + return SliceStatusEnum.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return context.ContextOuterClass.getDescriptor().getEnumTypes().get(5); + } + + private static final SliceStatusEnum[] VALUES = values(); + + public static SliceStatusEnum valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private SliceStatusEnum(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:context.SliceStatusEnum) + } + /** * <pre> * ----- Configuration ------------------------------------------------------------------------------------------------- @@ -756,7 +891,7 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return context.ContextOuterClass.getDescriptor().getEnumTypes().get(5); + return context.ContextOuterClass.getDescriptor().getEnumTypes().get(6); } private static final ConfigActionEnum[] VALUES = values(); @@ -27653,49 +27788,64 @@ public final class ContextOuterClass { } - public interface ConnectionIdOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.ConnectionId) + public interface SliceIdOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.SliceId) com.google.protobuf.MessageOrBuilder { /** - * <code>.context.Uuid connection_uuid = 1;</code> - * @return Whether the connectionUuid field is set. + * <code>.context.ContextId context_id = 1;</code> + * @return Whether the contextId field is set. */ - boolean hasConnectionUuid(); + boolean hasContextId(); /** - * <code>.context.Uuid connection_uuid = 1;</code> - * @return The connectionUuid. + * <code>.context.ContextId context_id = 1;</code> + * @return The contextId. */ - context.ContextOuterClass.Uuid getConnectionUuid(); + context.ContextOuterClass.ContextId getContextId(); /** - * <code>.context.Uuid connection_uuid = 1;</code> + * <code>.context.ContextId context_id = 1;</code> */ - context.ContextOuterClass.UuidOrBuilder getConnectionUuidOrBuilder(); + context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder(); + + /** + * <code>.context.Uuid slice_uuid = 2;</code> + * @return Whether the sliceUuid field is set. + */ + boolean hasSliceUuid(); + /** + * <code>.context.Uuid slice_uuid = 2;</code> + * @return The sliceUuid. + */ + context.ContextOuterClass.Uuid getSliceUuid(); + /** + * <code>.context.Uuid slice_uuid = 2;</code> + */ + context.ContextOuterClass.UuidOrBuilder getSliceUuidOrBuilder(); } /** * <pre> - * ----- Connection ---------------------------------------------------------------------------------------------------- + * ----- Slice --------------------------------------------------------------------------------------------------------- * </pre> * - * Protobuf type {@code context.ConnectionId} + * Protobuf type {@code context.SliceId} */ - public static final class ConnectionId extends + public static final class SliceId extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.ConnectionId) - ConnectionIdOrBuilder { + // @@protoc_insertion_point(message_implements:context.SliceId) + SliceIdOrBuilder { private static final long serialVersionUID = 0L; - // Use ConnectionId.newBuilder() to construct. - private ConnectionId(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + // Use SliceId.newBuilder() to construct. + private SliceId(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } - private ConnectionId() { + private SliceId() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new ConnectionId(); + return new SliceId(); } @java.lang.Override @@ -27703,7 +27853,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private ConnectionId( + private SliceId( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -27722,14 +27872,27 @@ public final class ContextOuterClass { done = true; break; case 10: { + context.ContextOuterClass.ContextId.Builder subBuilder = null; + if (contextId_ != null) { + subBuilder = contextId_.toBuilder(); + } + contextId_ = input.readMessage(context.ContextOuterClass.ContextId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(contextId_); + contextId_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { context.ContextOuterClass.Uuid.Builder subBuilder = null; - if (connectionUuid_ != null) { - subBuilder = connectionUuid_.toBuilder(); + if (sliceUuid_ != null) { + subBuilder = sliceUuid_.toBuilder(); } - connectionUuid_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); + sliceUuid_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); if (subBuilder != null) { - subBuilder.mergeFrom(connectionUuid_); - connectionUuid_ = subBuilder.buildPartial(); + subBuilder.mergeFrom(sliceUuid_); + sliceUuid_ = subBuilder.buildPartial(); } break; @@ -27755,41 +27918,67 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ConnectionId_descriptor; + return context.ContextOuterClass.internal_static_context_SliceId_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ConnectionId_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_SliceId_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ConnectionId.class, context.ContextOuterClass.ConnectionId.Builder.class); + context.ContextOuterClass.SliceId.class, context.ContextOuterClass.SliceId.Builder.class); } - public static final int CONNECTION_UUID_FIELD_NUMBER = 1; - private context.ContextOuterClass.Uuid connectionUuid_; + public static final int CONTEXT_ID_FIELD_NUMBER = 1; + private context.ContextOuterClass.ContextId contextId_; /** - * <code>.context.Uuid connection_uuid = 1;</code> - * @return Whether the connectionUuid field is set. + * <code>.context.ContextId context_id = 1;</code> + * @return Whether the contextId field is set. */ @java.lang.Override - public boolean hasConnectionUuid() { - return connectionUuid_ != null; + public boolean hasContextId() { + return contextId_ != null; } /** - * <code>.context.Uuid connection_uuid = 1;</code> - * @return The connectionUuid. + * <code>.context.ContextId context_id = 1;</code> + * @return The contextId. */ @java.lang.Override - public context.ContextOuterClass.Uuid getConnectionUuid() { - return connectionUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : connectionUuid_; + public context.ContextOuterClass.ContextId getContextId() { + return contextId_ == null ? context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; } /** - * <code>.context.Uuid connection_uuid = 1;</code> + * <code>.context.ContextId context_id = 1;</code> */ @java.lang.Override - public context.ContextOuterClass.UuidOrBuilder getConnectionUuidOrBuilder() { - return getConnectionUuid(); + public context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder() { + return getContextId(); + } + + public static final int SLICE_UUID_FIELD_NUMBER = 2; + private context.ContextOuterClass.Uuid sliceUuid_; + /** + * <code>.context.Uuid slice_uuid = 2;</code> + * @return Whether the sliceUuid field is set. + */ + @java.lang.Override + public boolean hasSliceUuid() { + return sliceUuid_ != null; + } + /** + * <code>.context.Uuid slice_uuid = 2;</code> + * @return The sliceUuid. + */ + @java.lang.Override + public context.ContextOuterClass.Uuid getSliceUuid() { + return sliceUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : sliceUuid_; + } + /** + * <code>.context.Uuid slice_uuid = 2;</code> + */ + @java.lang.Override + public context.ContextOuterClass.UuidOrBuilder getSliceUuidOrBuilder() { + return getSliceUuid(); } private byte memoizedIsInitialized = -1; @@ -27806,8 +27995,11 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (connectionUuid_ != null) { - output.writeMessage(1, getConnectionUuid()); + if (contextId_ != null) { + output.writeMessage(1, getContextId()); + } + if (sliceUuid_ != null) { + output.writeMessage(2, getSliceUuid()); } unknownFields.writeTo(output); } @@ -27818,9 +28010,13 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - if (connectionUuid_ != null) { + if (contextId_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getConnectionUuid()); + .computeMessageSize(1, getContextId()); + } + if (sliceUuid_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getSliceUuid()); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -27832,15 +28028,20 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.ConnectionId)) { + if (!(obj instanceof context.ContextOuterClass.SliceId)) { return super.equals(obj); } - context.ContextOuterClass.ConnectionId other = (context.ContextOuterClass.ConnectionId) obj; + context.ContextOuterClass.SliceId other = (context.ContextOuterClass.SliceId) obj; - if (hasConnectionUuid() != other.hasConnectionUuid()) return false; - if (hasConnectionUuid()) { - if (!getConnectionUuid() - .equals(other.getConnectionUuid())) return false; + if (hasContextId() != other.hasContextId()) return false; + if (hasContextId()) { + if (!getContextId() + .equals(other.getContextId())) return false; + } + if (hasSliceUuid() != other.hasSliceUuid()) return false; + if (hasSliceUuid()) { + if (!getSliceUuid() + .equals(other.getSliceUuid())) return false; } if (!unknownFields.equals(other.unknownFields)) return false; return true; @@ -27853,78 +28054,82 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasConnectionUuid()) { - hash = (37 * hash) + CONNECTION_UUID_FIELD_NUMBER; - hash = (53 * hash) + getConnectionUuid().hashCode(); + if (hasContextId()) { + hash = (37 * hash) + CONTEXT_ID_FIELD_NUMBER; + hash = (53 * hash) + getContextId().hashCode(); + } + if (hasSliceUuid()) { + hash = (37 * hash) + SLICE_UUID_FIELD_NUMBER; + hash = (53 * hash) + getSliceUuid().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.ConnectionId parseFrom( + public static context.ContextOuterClass.SliceId parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ConnectionId parseFrom( + public static context.ContextOuterClass.SliceId parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ConnectionId parseFrom( + public static context.ContextOuterClass.SliceId parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ConnectionId parseFrom( + public static context.ContextOuterClass.SliceId parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ConnectionId parseFrom(byte[] data) + public static context.ContextOuterClass.SliceId parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ConnectionId parseFrom( + public static context.ContextOuterClass.SliceId parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ConnectionId parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.SliceId parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ConnectionId parseFrom( + public static context.ContextOuterClass.SliceId parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } - public static context.ContextOuterClass.ConnectionId parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.SliceId parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.ConnectionId parseDelimitedFrom( + public static context.ContextOuterClass.SliceId parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static context.ContextOuterClass.ConnectionId parseFrom( + public static context.ContextOuterClass.SliceId parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ConnectionId parseFrom( + public static context.ContextOuterClass.SliceId parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -27937,7 +28142,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.ConnectionId prototype) { + public static Builder newBuilder(context.ContextOuterClass.SliceId prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -27954,29 +28159,29 @@ public final class ContextOuterClass { } /** * <pre> - * ----- Connection ---------------------------------------------------------------------------------------------------- + * ----- Slice --------------------------------------------------------------------------------------------------------- * </pre> * - * Protobuf type {@code context.ConnectionId} + * Protobuf type {@code context.SliceId} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements - // @@protoc_insertion_point(builder_implements:context.ConnectionId) - context.ContextOuterClass.ConnectionIdOrBuilder { + // @@protoc_insertion_point(builder_implements:context.SliceId) + context.ContextOuterClass.SliceIdOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ConnectionId_descriptor; + return context.ContextOuterClass.internal_static_context_SliceId_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ConnectionId_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_SliceId_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ConnectionId.class, context.ContextOuterClass.ConnectionId.Builder.class); + context.ContextOuterClass.SliceId.class, context.ContextOuterClass.SliceId.Builder.class); } - // Construct using context.ContextOuterClass.ConnectionId.newBuilder() + // Construct using context.ContextOuterClass.SliceId.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -27994,11 +28199,17 @@ public final class ContextOuterClass { @java.lang.Override public Builder clear() { super.clear(); - if (connectionUuidBuilder_ == null) { - connectionUuid_ = null; + if (contextIdBuilder_ == null) { + contextId_ = null; } else { - connectionUuid_ = null; - connectionUuidBuilder_ = null; + contextId_ = null; + contextIdBuilder_ = null; + } + if (sliceUuidBuilder_ == null) { + sliceUuid_ = null; + } else { + sliceUuid_ = null; + sliceUuidBuilder_ = null; } return this; } @@ -28006,17 +28217,17 @@ public final class ContextOuterClass { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_ConnectionId_descriptor; + return context.ContextOuterClass.internal_static_context_SliceId_descriptor; } @java.lang.Override - public context.ContextOuterClass.ConnectionId getDefaultInstanceForType() { - return context.ContextOuterClass.ConnectionId.getDefaultInstance(); + public context.ContextOuterClass.SliceId getDefaultInstanceForType() { + return context.ContextOuterClass.SliceId.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.ConnectionId build() { - context.ContextOuterClass.ConnectionId result = buildPartial(); + public context.ContextOuterClass.SliceId build() { + context.ContextOuterClass.SliceId result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -28024,12 +28235,6018 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.ConnectionId buildPartial() { - context.ContextOuterClass.ConnectionId result = new context.ContextOuterClass.ConnectionId(this); - if (connectionUuidBuilder_ == null) { - result.connectionUuid_ = connectionUuid_; + public context.ContextOuterClass.SliceId buildPartial() { + context.ContextOuterClass.SliceId result = new context.ContextOuterClass.SliceId(this); + if (contextIdBuilder_ == null) { + result.contextId_ = contextId_; } else { - result.connectionUuid_ = connectionUuidBuilder_.build(); + result.contextId_ = contextIdBuilder_.build(); + } + if (sliceUuidBuilder_ == null) { + result.sliceUuid_ = sliceUuid_; + } else { + result.sliceUuid_ = sliceUuidBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof context.ContextOuterClass.SliceId) { + return mergeFrom((context.ContextOuterClass.SliceId)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.SliceId other) { + if (other == context.ContextOuterClass.SliceId.getDefaultInstance()) return this; + if (other.hasContextId()) { + mergeContextId(other.getContextId()); + } + if (other.hasSliceUuid()) { + mergeSliceUuid(other.getSliceUuid()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + context.ContextOuterClass.SliceId parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.SliceId) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private context.ContextOuterClass.ContextId contextId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> contextIdBuilder_; + /** + * <code>.context.ContextId context_id = 1;</code> + * @return Whether the contextId field is set. + */ + public boolean hasContextId() { + return contextIdBuilder_ != null || contextId_ != null; + } + /** + * <code>.context.ContextId context_id = 1;</code> + * @return The contextId. + */ + public context.ContextOuterClass.ContextId getContextId() { + if (contextIdBuilder_ == null) { + return contextId_ == null ? context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + } else { + return contextIdBuilder_.getMessage(); + } + } + /** + * <code>.context.ContextId context_id = 1;</code> + */ + public Builder setContextId(context.ContextOuterClass.ContextId value) { + if (contextIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + contextId_ = value; + onChanged(); + } else { + contextIdBuilder_.setMessage(value); + } + + return this; + } + /** + * <code>.context.ContextId context_id = 1;</code> + */ + public Builder setContextId( + context.ContextOuterClass.ContextId.Builder builderForValue) { + if (contextIdBuilder_ == null) { + contextId_ = builderForValue.build(); + onChanged(); + } else { + contextIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * <code>.context.ContextId context_id = 1;</code> + */ + public Builder mergeContextId(context.ContextOuterClass.ContextId value) { + if (contextIdBuilder_ == null) { + if (contextId_ != null) { + contextId_ = + context.ContextOuterClass.ContextId.newBuilder(contextId_).mergeFrom(value).buildPartial(); + } else { + contextId_ = value; + } + onChanged(); + } else { + contextIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * <code>.context.ContextId context_id = 1;</code> + */ + public Builder clearContextId() { + if (contextIdBuilder_ == null) { + contextId_ = null; + onChanged(); + } else { + contextId_ = null; + contextIdBuilder_ = null; + } + + return this; + } + /** + * <code>.context.ContextId context_id = 1;</code> + */ + public context.ContextOuterClass.ContextId.Builder getContextIdBuilder() { + + onChanged(); + return getContextIdFieldBuilder().getBuilder(); + } + /** + * <code>.context.ContextId context_id = 1;</code> + */ + public context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder() { + if (contextIdBuilder_ != null) { + return contextIdBuilder_.getMessageOrBuilder(); + } else { + return contextId_ == null ? + context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + } + } + /** + * <code>.context.ContextId context_id = 1;</code> + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> + getContextIdFieldBuilder() { + if (contextIdBuilder_ == null) { + contextIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder>( + getContextId(), + getParentForChildren(), + isClean()); + contextId_ = null; + } + return contextIdBuilder_; + } + + private context.ContextOuterClass.Uuid sliceUuid_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> sliceUuidBuilder_; + /** + * <code>.context.Uuid slice_uuid = 2;</code> + * @return Whether the sliceUuid field is set. + */ + public boolean hasSliceUuid() { + return sliceUuidBuilder_ != null || sliceUuid_ != null; + } + /** + * <code>.context.Uuid slice_uuid = 2;</code> + * @return The sliceUuid. + */ + public context.ContextOuterClass.Uuid getSliceUuid() { + if (sliceUuidBuilder_ == null) { + return sliceUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : sliceUuid_; + } else { + return sliceUuidBuilder_.getMessage(); + } + } + /** + * <code>.context.Uuid slice_uuid = 2;</code> + */ + public Builder setSliceUuid(context.ContextOuterClass.Uuid value) { + if (sliceUuidBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sliceUuid_ = value; + onChanged(); + } else { + sliceUuidBuilder_.setMessage(value); + } + + return this; + } + /** + * <code>.context.Uuid slice_uuid = 2;</code> + */ + public Builder setSliceUuid( + context.ContextOuterClass.Uuid.Builder builderForValue) { + if (sliceUuidBuilder_ == null) { + sliceUuid_ = builderForValue.build(); + onChanged(); + } else { + sliceUuidBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * <code>.context.Uuid slice_uuid = 2;</code> + */ + public Builder mergeSliceUuid(context.ContextOuterClass.Uuid value) { + if (sliceUuidBuilder_ == null) { + if (sliceUuid_ != null) { + sliceUuid_ = + context.ContextOuterClass.Uuid.newBuilder(sliceUuid_).mergeFrom(value).buildPartial(); + } else { + sliceUuid_ = value; + } + onChanged(); + } else { + sliceUuidBuilder_.mergeFrom(value); + } + + return this; + } + /** + * <code>.context.Uuid slice_uuid = 2;</code> + */ + public Builder clearSliceUuid() { + if (sliceUuidBuilder_ == null) { + sliceUuid_ = null; + onChanged(); + } else { + sliceUuid_ = null; + sliceUuidBuilder_ = null; + } + + return this; + } + /** + * <code>.context.Uuid slice_uuid = 2;</code> + */ + public context.ContextOuterClass.Uuid.Builder getSliceUuidBuilder() { + + onChanged(); + return getSliceUuidFieldBuilder().getBuilder(); + } + /** + * <code>.context.Uuid slice_uuid = 2;</code> + */ + public context.ContextOuterClass.UuidOrBuilder getSliceUuidOrBuilder() { + if (sliceUuidBuilder_ != null) { + return sliceUuidBuilder_.getMessageOrBuilder(); + } else { + return sliceUuid_ == null ? + context.ContextOuterClass.Uuid.getDefaultInstance() : sliceUuid_; + } + } + /** + * <code>.context.Uuid slice_uuid = 2;</code> + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> + getSliceUuidFieldBuilder() { + if (sliceUuidBuilder_ == null) { + sliceUuidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( + getSliceUuid(), + getParentForChildren(), + isClean()); + sliceUuid_ = null; + } + return sliceUuidBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:context.SliceId) + } + + // @@protoc_insertion_point(class_scope:context.SliceId) + private static final context.ContextOuterClass.SliceId DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.SliceId(); + } + + public static context.ContextOuterClass.SliceId getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<SliceId> + PARSER = new com.google.protobuf.AbstractParser<SliceId>() { + @java.lang.Override + public SliceId parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SliceId(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<SliceId> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<SliceId> getParserForType() { + return PARSER; + } + + @java.lang.Override + public context.ContextOuterClass.SliceId getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SliceOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.Slice) + com.google.protobuf.MessageOrBuilder { + + /** + * <code>.context.SliceId slice_id = 1;</code> + * @return Whether the sliceId field is set. + */ + boolean hasSliceId(); + /** + * <code>.context.SliceId slice_id = 1;</code> + * @return The sliceId. + */ + context.ContextOuterClass.SliceId getSliceId(); + /** + * <code>.context.SliceId slice_id = 1;</code> + */ + context.ContextOuterClass.SliceIdOrBuilder getSliceIdOrBuilder(); + + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + java.util.List<context.ContextOuterClass.EndPointId> + getSliceEndpointIdsList(); + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + context.ContextOuterClass.EndPointId getSliceEndpointIds(int index); + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + int getSliceEndpointIdsCount(); + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + java.util.List<? extends context.ContextOuterClass.EndPointIdOrBuilder> + getSliceEndpointIdsOrBuilderList(); + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + context.ContextOuterClass.EndPointIdOrBuilder getSliceEndpointIdsOrBuilder( + int index); + + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + java.util.List<context.ContextOuterClass.Constraint> + getSliceConstraintsList(); + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + context.ContextOuterClass.Constraint getSliceConstraints(int index); + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + int getSliceConstraintsCount(); + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + java.util.List<? extends context.ContextOuterClass.ConstraintOrBuilder> + getSliceConstraintsOrBuilderList(); + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + context.ContextOuterClass.ConstraintOrBuilder getSliceConstraintsOrBuilder( + int index); + + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + java.util.List<context.ContextOuterClass.ServiceId> + getSliceServiceIdsList(); + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + context.ContextOuterClass.ServiceId getSliceServiceIds(int index); + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + int getSliceServiceIdsCount(); + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + java.util.List<? extends context.ContextOuterClass.ServiceIdOrBuilder> + getSliceServiceIdsOrBuilderList(); + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + context.ContextOuterClass.ServiceIdOrBuilder getSliceServiceIdsOrBuilder( + int index); + + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + java.util.List<context.ContextOuterClass.SliceId> + getSliceSubsliceIdsList(); + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + context.ContextOuterClass.SliceId getSliceSubsliceIds(int index); + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + int getSliceSubsliceIdsCount(); + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + java.util.List<? extends context.ContextOuterClass.SliceIdOrBuilder> + getSliceSubsliceIdsOrBuilderList(); + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + context.ContextOuterClass.SliceIdOrBuilder getSliceSubsliceIdsOrBuilder( + int index); + + /** + * <code>.context.SliceStatus slice_status = 6;</code> + * @return Whether the sliceStatus field is set. + */ + boolean hasSliceStatus(); + /** + * <code>.context.SliceStatus slice_status = 6;</code> + * @return The sliceStatus. + */ + context.ContextOuterClass.SliceStatus getSliceStatus(); + /** + * <code>.context.SliceStatus slice_status = 6;</code> + */ + context.ContextOuterClass.SliceStatusOrBuilder getSliceStatusOrBuilder(); + } + /** + * Protobuf type {@code context.Slice} + */ + public static final class Slice extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.Slice) + SliceOrBuilder { + private static final long serialVersionUID = 0L; + // Use Slice.newBuilder() to construct. + private Slice(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private Slice() { + sliceEndpointIds_ = java.util.Collections.emptyList(); + sliceConstraints_ = java.util.Collections.emptyList(); + sliceServiceIds_ = java.util.Collections.emptyList(); + sliceSubsliceIds_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Slice(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Slice( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + context.ContextOuterClass.SliceId.Builder subBuilder = null; + if (sliceId_ != null) { + subBuilder = sliceId_.toBuilder(); + } + sliceId_ = input.readMessage(context.ContextOuterClass.SliceId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(sliceId_); + sliceId_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + sliceEndpointIds_ = new java.util.ArrayList<context.ContextOuterClass.EndPointId>(); + mutable_bitField0_ |= 0x00000001; + } + sliceEndpointIds_.add( + input.readMessage(context.ContextOuterClass.EndPointId.parser(), extensionRegistry)); + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + sliceConstraints_ = new java.util.ArrayList<context.ContextOuterClass.Constraint>(); + mutable_bitField0_ |= 0x00000002; + } + sliceConstraints_.add( + input.readMessage(context.ContextOuterClass.Constraint.parser(), extensionRegistry)); + break; + } + case 34: { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + sliceServiceIds_ = new java.util.ArrayList<context.ContextOuterClass.ServiceId>(); + mutable_bitField0_ |= 0x00000004; + } + sliceServiceIds_.add( + input.readMessage(context.ContextOuterClass.ServiceId.parser(), extensionRegistry)); + break; + } + case 42: { + if (!((mutable_bitField0_ & 0x00000008) != 0)) { + sliceSubsliceIds_ = new java.util.ArrayList<context.ContextOuterClass.SliceId>(); + mutable_bitField0_ |= 0x00000008; + } + sliceSubsliceIds_.add( + input.readMessage(context.ContextOuterClass.SliceId.parser(), extensionRegistry)); + break; + } + case 50: { + context.ContextOuterClass.SliceStatus.Builder subBuilder = null; + if (sliceStatus_ != null) { + subBuilder = sliceStatus_.toBuilder(); + } + sliceStatus_ = input.readMessage(context.ContextOuterClass.SliceStatus.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(sliceStatus_); + sliceStatus_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + sliceEndpointIds_ = java.util.Collections.unmodifiableList(sliceEndpointIds_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + sliceConstraints_ = java.util.Collections.unmodifiableList(sliceConstraints_); + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + sliceServiceIds_ = java.util.Collections.unmodifiableList(sliceServiceIds_); + } + if (((mutable_bitField0_ & 0x00000008) != 0)) { + sliceSubsliceIds_ = java.util.Collections.unmodifiableList(sliceSubsliceIds_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_Slice_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_Slice_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.Slice.class, context.ContextOuterClass.Slice.Builder.class); + } + + public static final int SLICE_ID_FIELD_NUMBER = 1; + private context.ContextOuterClass.SliceId sliceId_; + /** + * <code>.context.SliceId slice_id = 1;</code> + * @return Whether the sliceId field is set. + */ + @java.lang.Override + public boolean hasSliceId() { + return sliceId_ != null; + } + /** + * <code>.context.SliceId slice_id = 1;</code> + * @return The sliceId. + */ + @java.lang.Override + public context.ContextOuterClass.SliceId getSliceId() { + return sliceId_ == null ? context.ContextOuterClass.SliceId.getDefaultInstance() : sliceId_; + } + /** + * <code>.context.SliceId slice_id = 1;</code> + */ + @java.lang.Override + public context.ContextOuterClass.SliceIdOrBuilder getSliceIdOrBuilder() { + return getSliceId(); + } + + public static final int SLICE_ENDPOINT_IDS_FIELD_NUMBER = 2; + private java.util.List<context.ContextOuterClass.EndPointId> sliceEndpointIds_; + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + @java.lang.Override + public java.util.List<context.ContextOuterClass.EndPointId> getSliceEndpointIdsList() { + return sliceEndpointIds_; + } + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + @java.lang.Override + public java.util.List<? extends context.ContextOuterClass.EndPointIdOrBuilder> + getSliceEndpointIdsOrBuilderList() { + return sliceEndpointIds_; + } + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + @java.lang.Override + public int getSliceEndpointIdsCount() { + return sliceEndpointIds_.size(); + } + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + @java.lang.Override + public context.ContextOuterClass.EndPointId getSliceEndpointIds(int index) { + return sliceEndpointIds_.get(index); + } + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + @java.lang.Override + public context.ContextOuterClass.EndPointIdOrBuilder getSliceEndpointIdsOrBuilder( + int index) { + return sliceEndpointIds_.get(index); + } + + public static final int SLICE_CONSTRAINTS_FIELD_NUMBER = 3; + private java.util.List<context.ContextOuterClass.Constraint> sliceConstraints_; + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + @java.lang.Override + public java.util.List<context.ContextOuterClass.Constraint> getSliceConstraintsList() { + return sliceConstraints_; + } + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + @java.lang.Override + public java.util.List<? extends context.ContextOuterClass.ConstraintOrBuilder> + getSliceConstraintsOrBuilderList() { + return sliceConstraints_; + } + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + @java.lang.Override + public int getSliceConstraintsCount() { + return sliceConstraints_.size(); + } + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + @java.lang.Override + public context.ContextOuterClass.Constraint getSliceConstraints(int index) { + return sliceConstraints_.get(index); + } + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + @java.lang.Override + public context.ContextOuterClass.ConstraintOrBuilder getSliceConstraintsOrBuilder( + int index) { + return sliceConstraints_.get(index); + } + + public static final int SLICE_SERVICE_IDS_FIELD_NUMBER = 4; + private java.util.List<context.ContextOuterClass.ServiceId> sliceServiceIds_; + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + @java.lang.Override + public java.util.List<context.ContextOuterClass.ServiceId> getSliceServiceIdsList() { + return sliceServiceIds_; + } + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + @java.lang.Override + public java.util.List<? extends context.ContextOuterClass.ServiceIdOrBuilder> + getSliceServiceIdsOrBuilderList() { + return sliceServiceIds_; + } + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + @java.lang.Override + public int getSliceServiceIdsCount() { + return sliceServiceIds_.size(); + } + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + @java.lang.Override + public context.ContextOuterClass.ServiceId getSliceServiceIds(int index) { + return sliceServiceIds_.get(index); + } + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + @java.lang.Override + public context.ContextOuterClass.ServiceIdOrBuilder getSliceServiceIdsOrBuilder( + int index) { + return sliceServiceIds_.get(index); + } + + public static final int SLICE_SUBSLICE_IDS_FIELD_NUMBER = 5; + private java.util.List<context.ContextOuterClass.SliceId> sliceSubsliceIds_; + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + @java.lang.Override + public java.util.List<context.ContextOuterClass.SliceId> getSliceSubsliceIdsList() { + return sliceSubsliceIds_; + } + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + @java.lang.Override + public java.util.List<? extends context.ContextOuterClass.SliceIdOrBuilder> + getSliceSubsliceIdsOrBuilderList() { + return sliceSubsliceIds_; + } + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + @java.lang.Override + public int getSliceSubsliceIdsCount() { + return sliceSubsliceIds_.size(); + } + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + @java.lang.Override + public context.ContextOuterClass.SliceId getSliceSubsliceIds(int index) { + return sliceSubsliceIds_.get(index); + } + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + @java.lang.Override + public context.ContextOuterClass.SliceIdOrBuilder getSliceSubsliceIdsOrBuilder( + int index) { + return sliceSubsliceIds_.get(index); + } + + public static final int SLICE_STATUS_FIELD_NUMBER = 6; + private context.ContextOuterClass.SliceStatus sliceStatus_; + /** + * <code>.context.SliceStatus slice_status = 6;</code> + * @return Whether the sliceStatus field is set. + */ + @java.lang.Override + public boolean hasSliceStatus() { + return sliceStatus_ != null; + } + /** + * <code>.context.SliceStatus slice_status = 6;</code> + * @return The sliceStatus. + */ + @java.lang.Override + public context.ContextOuterClass.SliceStatus getSliceStatus() { + return sliceStatus_ == null ? context.ContextOuterClass.SliceStatus.getDefaultInstance() : sliceStatus_; + } + /** + * <code>.context.SliceStatus slice_status = 6;</code> + */ + @java.lang.Override + public context.ContextOuterClass.SliceStatusOrBuilder getSliceStatusOrBuilder() { + return getSliceStatus(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (sliceId_ != null) { + output.writeMessage(1, getSliceId()); + } + for (int i = 0; i < sliceEndpointIds_.size(); i++) { + output.writeMessage(2, sliceEndpointIds_.get(i)); + } + for (int i = 0; i < sliceConstraints_.size(); i++) { + output.writeMessage(3, sliceConstraints_.get(i)); + } + for (int i = 0; i < sliceServiceIds_.size(); i++) { + output.writeMessage(4, sliceServiceIds_.get(i)); + } + for (int i = 0; i < sliceSubsliceIds_.size(); i++) { + output.writeMessage(5, sliceSubsliceIds_.get(i)); + } + if (sliceStatus_ != null) { + output.writeMessage(6, getSliceStatus()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (sliceId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getSliceId()); + } + for (int i = 0; i < sliceEndpointIds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, sliceEndpointIds_.get(i)); + } + for (int i = 0; i < sliceConstraints_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, sliceConstraints_.get(i)); + } + for (int i = 0; i < sliceServiceIds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, sliceServiceIds_.get(i)); + } + for (int i = 0; i < sliceSubsliceIds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, sliceSubsliceIds_.get(i)); + } + if (sliceStatus_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getSliceStatus()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof context.ContextOuterClass.Slice)) { + return super.equals(obj); + } + context.ContextOuterClass.Slice other = (context.ContextOuterClass.Slice) obj; + + if (hasSliceId() != other.hasSliceId()) return false; + if (hasSliceId()) { + if (!getSliceId() + .equals(other.getSliceId())) return false; + } + if (!getSliceEndpointIdsList() + .equals(other.getSliceEndpointIdsList())) return false; + if (!getSliceConstraintsList() + .equals(other.getSliceConstraintsList())) return false; + if (!getSliceServiceIdsList() + .equals(other.getSliceServiceIdsList())) return false; + if (!getSliceSubsliceIdsList() + .equals(other.getSliceSubsliceIdsList())) return false; + if (hasSliceStatus() != other.hasSliceStatus()) return false; + if (hasSliceStatus()) { + if (!getSliceStatus() + .equals(other.getSliceStatus())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasSliceId()) { + hash = (37 * hash) + SLICE_ID_FIELD_NUMBER; + hash = (53 * hash) + getSliceId().hashCode(); + } + if (getSliceEndpointIdsCount() > 0) { + hash = (37 * hash) + SLICE_ENDPOINT_IDS_FIELD_NUMBER; + hash = (53 * hash) + getSliceEndpointIdsList().hashCode(); + } + if (getSliceConstraintsCount() > 0) { + hash = (37 * hash) + SLICE_CONSTRAINTS_FIELD_NUMBER; + hash = (53 * hash) + getSliceConstraintsList().hashCode(); + } + if (getSliceServiceIdsCount() > 0) { + hash = (37 * hash) + SLICE_SERVICE_IDS_FIELD_NUMBER; + hash = (53 * hash) + getSliceServiceIdsList().hashCode(); + } + if (getSliceSubsliceIdsCount() > 0) { + hash = (37 * hash) + SLICE_SUBSLICE_IDS_FIELD_NUMBER; + hash = (53 * hash) + getSliceSubsliceIdsList().hashCode(); + } + if (hasSliceStatus()) { + hash = (37 * hash) + SLICE_STATUS_FIELD_NUMBER; + hash = (53 * hash) + getSliceStatus().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.Slice parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.Slice parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.Slice parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.Slice parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.Slice parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.Slice parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.Slice parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.Slice parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static context.ContextOuterClass.Slice parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.Slice parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static context.ContextOuterClass.Slice parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.Slice parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(context.ContextOuterClass.Slice prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code context.Slice} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:context.Slice) + context.ContextOuterClass.SliceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_Slice_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_Slice_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.Slice.class, context.ContextOuterClass.Slice.Builder.class); + } + + // Construct using context.ContextOuterClass.Slice.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getSliceEndpointIdsFieldBuilder(); + getSliceConstraintsFieldBuilder(); + getSliceServiceIdsFieldBuilder(); + getSliceSubsliceIdsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (sliceIdBuilder_ == null) { + sliceId_ = null; + } else { + sliceId_ = null; + sliceIdBuilder_ = null; + } + if (sliceEndpointIdsBuilder_ == null) { + sliceEndpointIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + sliceEndpointIdsBuilder_.clear(); + } + if (sliceConstraintsBuilder_ == null) { + sliceConstraints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + sliceConstraintsBuilder_.clear(); + } + if (sliceServiceIdsBuilder_ == null) { + sliceServiceIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + sliceServiceIdsBuilder_.clear(); + } + if (sliceSubsliceIdsBuilder_ == null) { + sliceSubsliceIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + } else { + sliceSubsliceIdsBuilder_.clear(); + } + if (sliceStatusBuilder_ == null) { + sliceStatus_ = null; + } else { + sliceStatus_ = null; + sliceStatusBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_Slice_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.Slice getDefaultInstanceForType() { + return context.ContextOuterClass.Slice.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.Slice build() { + context.ContextOuterClass.Slice result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.Slice buildPartial() { + context.ContextOuterClass.Slice result = new context.ContextOuterClass.Slice(this); + int from_bitField0_ = bitField0_; + if (sliceIdBuilder_ == null) { + result.sliceId_ = sliceId_; + } else { + result.sliceId_ = sliceIdBuilder_.build(); + } + if (sliceEndpointIdsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + sliceEndpointIds_ = java.util.Collections.unmodifiableList(sliceEndpointIds_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.sliceEndpointIds_ = sliceEndpointIds_; + } else { + result.sliceEndpointIds_ = sliceEndpointIdsBuilder_.build(); + } + if (sliceConstraintsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + sliceConstraints_ = java.util.Collections.unmodifiableList(sliceConstraints_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.sliceConstraints_ = sliceConstraints_; + } else { + result.sliceConstraints_ = sliceConstraintsBuilder_.build(); + } + if (sliceServiceIdsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + sliceServiceIds_ = java.util.Collections.unmodifiableList(sliceServiceIds_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.sliceServiceIds_ = sliceServiceIds_; + } else { + result.sliceServiceIds_ = sliceServiceIdsBuilder_.build(); + } + if (sliceSubsliceIdsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + sliceSubsliceIds_ = java.util.Collections.unmodifiableList(sliceSubsliceIds_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.sliceSubsliceIds_ = sliceSubsliceIds_; + } else { + result.sliceSubsliceIds_ = sliceSubsliceIdsBuilder_.build(); + } + if (sliceStatusBuilder_ == null) { + result.sliceStatus_ = sliceStatus_; + } else { + result.sliceStatus_ = sliceStatusBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof context.ContextOuterClass.Slice) { + return mergeFrom((context.ContextOuterClass.Slice)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.Slice other) { + if (other == context.ContextOuterClass.Slice.getDefaultInstance()) return this; + if (other.hasSliceId()) { + mergeSliceId(other.getSliceId()); + } + if (sliceEndpointIdsBuilder_ == null) { + if (!other.sliceEndpointIds_.isEmpty()) { + if (sliceEndpointIds_.isEmpty()) { + sliceEndpointIds_ = other.sliceEndpointIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSliceEndpointIdsIsMutable(); + sliceEndpointIds_.addAll(other.sliceEndpointIds_); + } + onChanged(); + } + } else { + if (!other.sliceEndpointIds_.isEmpty()) { + if (sliceEndpointIdsBuilder_.isEmpty()) { + sliceEndpointIdsBuilder_.dispose(); + sliceEndpointIdsBuilder_ = null; + sliceEndpointIds_ = other.sliceEndpointIds_; + bitField0_ = (bitField0_ & ~0x00000001); + sliceEndpointIdsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSliceEndpointIdsFieldBuilder() : null; + } else { + sliceEndpointIdsBuilder_.addAllMessages(other.sliceEndpointIds_); + } + } + } + if (sliceConstraintsBuilder_ == null) { + if (!other.sliceConstraints_.isEmpty()) { + if (sliceConstraints_.isEmpty()) { + sliceConstraints_ = other.sliceConstraints_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureSliceConstraintsIsMutable(); + sliceConstraints_.addAll(other.sliceConstraints_); + } + onChanged(); + } + } else { + if (!other.sliceConstraints_.isEmpty()) { + if (sliceConstraintsBuilder_.isEmpty()) { + sliceConstraintsBuilder_.dispose(); + sliceConstraintsBuilder_ = null; + sliceConstraints_ = other.sliceConstraints_; + bitField0_ = (bitField0_ & ~0x00000002); + sliceConstraintsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSliceConstraintsFieldBuilder() : null; + } else { + sliceConstraintsBuilder_.addAllMessages(other.sliceConstraints_); + } + } + } + if (sliceServiceIdsBuilder_ == null) { + if (!other.sliceServiceIds_.isEmpty()) { + if (sliceServiceIds_.isEmpty()) { + sliceServiceIds_ = other.sliceServiceIds_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureSliceServiceIdsIsMutable(); + sliceServiceIds_.addAll(other.sliceServiceIds_); + } + onChanged(); + } + } else { + if (!other.sliceServiceIds_.isEmpty()) { + if (sliceServiceIdsBuilder_.isEmpty()) { + sliceServiceIdsBuilder_.dispose(); + sliceServiceIdsBuilder_ = null; + sliceServiceIds_ = other.sliceServiceIds_; + bitField0_ = (bitField0_ & ~0x00000004); + sliceServiceIdsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSliceServiceIdsFieldBuilder() : null; + } else { + sliceServiceIdsBuilder_.addAllMessages(other.sliceServiceIds_); + } + } + } + if (sliceSubsliceIdsBuilder_ == null) { + if (!other.sliceSubsliceIds_.isEmpty()) { + if (sliceSubsliceIds_.isEmpty()) { + sliceSubsliceIds_ = other.sliceSubsliceIds_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureSliceSubsliceIdsIsMutable(); + sliceSubsliceIds_.addAll(other.sliceSubsliceIds_); + } + onChanged(); + } + } else { + if (!other.sliceSubsliceIds_.isEmpty()) { + if (sliceSubsliceIdsBuilder_.isEmpty()) { + sliceSubsliceIdsBuilder_.dispose(); + sliceSubsliceIdsBuilder_ = null; + sliceSubsliceIds_ = other.sliceSubsliceIds_; + bitField0_ = (bitField0_ & ~0x00000008); + sliceSubsliceIdsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSliceSubsliceIdsFieldBuilder() : null; + } else { + sliceSubsliceIdsBuilder_.addAllMessages(other.sliceSubsliceIds_); + } + } + } + if (other.hasSliceStatus()) { + mergeSliceStatus(other.getSliceStatus()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + context.ContextOuterClass.Slice parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.Slice) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private context.ContextOuterClass.SliceId sliceId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> sliceIdBuilder_; + /** + * <code>.context.SliceId slice_id = 1;</code> + * @return Whether the sliceId field is set. + */ + public boolean hasSliceId() { + return sliceIdBuilder_ != null || sliceId_ != null; + } + /** + * <code>.context.SliceId slice_id = 1;</code> + * @return The sliceId. + */ + public context.ContextOuterClass.SliceId getSliceId() { + if (sliceIdBuilder_ == null) { + return sliceId_ == null ? context.ContextOuterClass.SliceId.getDefaultInstance() : sliceId_; + } else { + return sliceIdBuilder_.getMessage(); + } + } + /** + * <code>.context.SliceId slice_id = 1;</code> + */ + public Builder setSliceId(context.ContextOuterClass.SliceId value) { + if (sliceIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sliceId_ = value; + onChanged(); + } else { + sliceIdBuilder_.setMessage(value); + } + + return this; + } + /** + * <code>.context.SliceId slice_id = 1;</code> + */ + public Builder setSliceId( + context.ContextOuterClass.SliceId.Builder builderForValue) { + if (sliceIdBuilder_ == null) { + sliceId_ = builderForValue.build(); + onChanged(); + } else { + sliceIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * <code>.context.SliceId slice_id = 1;</code> + */ + public Builder mergeSliceId(context.ContextOuterClass.SliceId value) { + if (sliceIdBuilder_ == null) { + if (sliceId_ != null) { + sliceId_ = + context.ContextOuterClass.SliceId.newBuilder(sliceId_).mergeFrom(value).buildPartial(); + } else { + sliceId_ = value; + } + onChanged(); + } else { + sliceIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * <code>.context.SliceId slice_id = 1;</code> + */ + public Builder clearSliceId() { + if (sliceIdBuilder_ == null) { + sliceId_ = null; + onChanged(); + } else { + sliceId_ = null; + sliceIdBuilder_ = null; + } + + return this; + } + /** + * <code>.context.SliceId slice_id = 1;</code> + */ + public context.ContextOuterClass.SliceId.Builder getSliceIdBuilder() { + + onChanged(); + return getSliceIdFieldBuilder().getBuilder(); + } + /** + * <code>.context.SliceId slice_id = 1;</code> + */ + public context.ContextOuterClass.SliceIdOrBuilder getSliceIdOrBuilder() { + if (sliceIdBuilder_ != null) { + return sliceIdBuilder_.getMessageOrBuilder(); + } else { + return sliceId_ == null ? + context.ContextOuterClass.SliceId.getDefaultInstance() : sliceId_; + } + } + /** + * <code>.context.SliceId slice_id = 1;</code> + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> + getSliceIdFieldBuilder() { + if (sliceIdBuilder_ == null) { + sliceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder>( + getSliceId(), + getParentForChildren(), + isClean()); + sliceId_ = null; + } + return sliceIdBuilder_; + } + + private java.util.List<context.ContextOuterClass.EndPointId> sliceEndpointIds_ = + java.util.Collections.emptyList(); + private void ensureSliceEndpointIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + sliceEndpointIds_ = new java.util.ArrayList<context.ContextOuterClass.EndPointId>(sliceEndpointIds_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> sliceEndpointIdsBuilder_; + + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + public java.util.List<context.ContextOuterClass.EndPointId> getSliceEndpointIdsList() { + if (sliceEndpointIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(sliceEndpointIds_); + } else { + return sliceEndpointIdsBuilder_.getMessageList(); + } + } + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + public int getSliceEndpointIdsCount() { + if (sliceEndpointIdsBuilder_ == null) { + return sliceEndpointIds_.size(); + } else { + return sliceEndpointIdsBuilder_.getCount(); + } + } + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + public context.ContextOuterClass.EndPointId getSliceEndpointIds(int index) { + if (sliceEndpointIdsBuilder_ == null) { + return sliceEndpointIds_.get(index); + } else { + return sliceEndpointIdsBuilder_.getMessage(index); + } + } + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + public Builder setSliceEndpointIds( + int index, context.ContextOuterClass.EndPointId value) { + if (sliceEndpointIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceEndpointIdsIsMutable(); + sliceEndpointIds_.set(index, value); + onChanged(); + } else { + sliceEndpointIdsBuilder_.setMessage(index, value); + } + return this; + } + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + public Builder setSliceEndpointIds( + int index, context.ContextOuterClass.EndPointId.Builder builderForValue) { + if (sliceEndpointIdsBuilder_ == null) { + ensureSliceEndpointIdsIsMutable(); + sliceEndpointIds_.set(index, builderForValue.build()); + onChanged(); + } else { + sliceEndpointIdsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + public Builder addSliceEndpointIds(context.ContextOuterClass.EndPointId value) { + if (sliceEndpointIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceEndpointIdsIsMutable(); + sliceEndpointIds_.add(value); + onChanged(); + } else { + sliceEndpointIdsBuilder_.addMessage(value); + } + return this; + } + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + public Builder addSliceEndpointIds( + int index, context.ContextOuterClass.EndPointId value) { + if (sliceEndpointIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceEndpointIdsIsMutable(); + sliceEndpointIds_.add(index, value); + onChanged(); + } else { + sliceEndpointIdsBuilder_.addMessage(index, value); + } + return this; + } + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + public Builder addSliceEndpointIds( + context.ContextOuterClass.EndPointId.Builder builderForValue) { + if (sliceEndpointIdsBuilder_ == null) { + ensureSliceEndpointIdsIsMutable(); + sliceEndpointIds_.add(builderForValue.build()); + onChanged(); + } else { + sliceEndpointIdsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + public Builder addSliceEndpointIds( + int index, context.ContextOuterClass.EndPointId.Builder builderForValue) { + if (sliceEndpointIdsBuilder_ == null) { + ensureSliceEndpointIdsIsMutable(); + sliceEndpointIds_.add(index, builderForValue.build()); + onChanged(); + } else { + sliceEndpointIdsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + public Builder addAllSliceEndpointIds( + java.lang.Iterable<? extends context.ContextOuterClass.EndPointId> values) { + if (sliceEndpointIdsBuilder_ == null) { + ensureSliceEndpointIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, sliceEndpointIds_); + onChanged(); + } else { + sliceEndpointIdsBuilder_.addAllMessages(values); + } + return this; + } + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + public Builder clearSliceEndpointIds() { + if (sliceEndpointIdsBuilder_ == null) { + sliceEndpointIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + sliceEndpointIdsBuilder_.clear(); + } + return this; + } + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + public Builder removeSliceEndpointIds(int index) { + if (sliceEndpointIdsBuilder_ == null) { + ensureSliceEndpointIdsIsMutable(); + sliceEndpointIds_.remove(index); + onChanged(); + } else { + sliceEndpointIdsBuilder_.remove(index); + } + return this; + } + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + public context.ContextOuterClass.EndPointId.Builder getSliceEndpointIdsBuilder( + int index) { + return getSliceEndpointIdsFieldBuilder().getBuilder(index); + } + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + public context.ContextOuterClass.EndPointIdOrBuilder getSliceEndpointIdsOrBuilder( + int index) { + if (sliceEndpointIdsBuilder_ == null) { + return sliceEndpointIds_.get(index); } else { + return sliceEndpointIdsBuilder_.getMessageOrBuilder(index); + } + } + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + public java.util.List<? extends context.ContextOuterClass.EndPointIdOrBuilder> + getSliceEndpointIdsOrBuilderList() { + if (sliceEndpointIdsBuilder_ != null) { + return sliceEndpointIdsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(sliceEndpointIds_); + } + } + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + public context.ContextOuterClass.EndPointId.Builder addSliceEndpointIdsBuilder() { + return getSliceEndpointIdsFieldBuilder().addBuilder( + context.ContextOuterClass.EndPointId.getDefaultInstance()); + } + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + public context.ContextOuterClass.EndPointId.Builder addSliceEndpointIdsBuilder( + int index) { + return getSliceEndpointIdsFieldBuilder().addBuilder( + index, context.ContextOuterClass.EndPointId.getDefaultInstance()); + } + /** + * <code>repeated .context.EndPointId slice_endpoint_ids = 2;</code> + */ + public java.util.List<context.ContextOuterClass.EndPointId.Builder> + getSliceEndpointIdsBuilderList() { + return getSliceEndpointIdsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> + getSliceEndpointIdsFieldBuilder() { + if (sliceEndpointIdsBuilder_ == null) { + sliceEndpointIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder>( + sliceEndpointIds_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + sliceEndpointIds_ = null; + } + return sliceEndpointIdsBuilder_; + } + + private java.util.List<context.ContextOuterClass.Constraint> sliceConstraints_ = + java.util.Collections.emptyList(); + private void ensureSliceConstraintsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + sliceConstraints_ = new java.util.ArrayList<context.ContextOuterClass.Constraint>(sliceConstraints_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Constraint, context.ContextOuterClass.Constraint.Builder, context.ContextOuterClass.ConstraintOrBuilder> sliceConstraintsBuilder_; + + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + public java.util.List<context.ContextOuterClass.Constraint> getSliceConstraintsList() { + if (sliceConstraintsBuilder_ == null) { + return java.util.Collections.unmodifiableList(sliceConstraints_); + } else { + return sliceConstraintsBuilder_.getMessageList(); + } + } + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + public int getSliceConstraintsCount() { + if (sliceConstraintsBuilder_ == null) { + return sliceConstraints_.size(); + } else { + return sliceConstraintsBuilder_.getCount(); + } + } + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + public context.ContextOuterClass.Constraint getSliceConstraints(int index) { + if (sliceConstraintsBuilder_ == null) { + return sliceConstraints_.get(index); + } else { + return sliceConstraintsBuilder_.getMessage(index); + } + } + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + public Builder setSliceConstraints( + int index, context.ContextOuterClass.Constraint value) { + if (sliceConstraintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceConstraintsIsMutable(); + sliceConstraints_.set(index, value); + onChanged(); + } else { + sliceConstraintsBuilder_.setMessage(index, value); + } + return this; + } + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + public Builder setSliceConstraints( + int index, context.ContextOuterClass.Constraint.Builder builderForValue) { + if (sliceConstraintsBuilder_ == null) { + ensureSliceConstraintsIsMutable(); + sliceConstraints_.set(index, builderForValue.build()); + onChanged(); + } else { + sliceConstraintsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + public Builder addSliceConstraints(context.ContextOuterClass.Constraint value) { + if (sliceConstraintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceConstraintsIsMutable(); + sliceConstraints_.add(value); + onChanged(); + } else { + sliceConstraintsBuilder_.addMessage(value); + } + return this; + } + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + public Builder addSliceConstraints( + int index, context.ContextOuterClass.Constraint value) { + if (sliceConstraintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceConstraintsIsMutable(); + sliceConstraints_.add(index, value); + onChanged(); + } else { + sliceConstraintsBuilder_.addMessage(index, value); + } + return this; + } + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + public Builder addSliceConstraints( + context.ContextOuterClass.Constraint.Builder builderForValue) { + if (sliceConstraintsBuilder_ == null) { + ensureSliceConstraintsIsMutable(); + sliceConstraints_.add(builderForValue.build()); + onChanged(); + } else { + sliceConstraintsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + public Builder addSliceConstraints( + int index, context.ContextOuterClass.Constraint.Builder builderForValue) { + if (sliceConstraintsBuilder_ == null) { + ensureSliceConstraintsIsMutable(); + sliceConstraints_.add(index, builderForValue.build()); + onChanged(); + } else { + sliceConstraintsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + public Builder addAllSliceConstraints( + java.lang.Iterable<? extends context.ContextOuterClass.Constraint> values) { + if (sliceConstraintsBuilder_ == null) { + ensureSliceConstraintsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, sliceConstraints_); + onChanged(); + } else { + sliceConstraintsBuilder_.addAllMessages(values); + } + return this; + } + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + public Builder clearSliceConstraints() { + if (sliceConstraintsBuilder_ == null) { + sliceConstraints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + sliceConstraintsBuilder_.clear(); + } + return this; + } + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + public Builder removeSliceConstraints(int index) { + if (sliceConstraintsBuilder_ == null) { + ensureSliceConstraintsIsMutable(); + sliceConstraints_.remove(index); + onChanged(); + } else { + sliceConstraintsBuilder_.remove(index); + } + return this; + } + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + public context.ContextOuterClass.Constraint.Builder getSliceConstraintsBuilder( + int index) { + return getSliceConstraintsFieldBuilder().getBuilder(index); + } + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + public context.ContextOuterClass.ConstraintOrBuilder getSliceConstraintsOrBuilder( + int index) { + if (sliceConstraintsBuilder_ == null) { + return sliceConstraints_.get(index); } else { + return sliceConstraintsBuilder_.getMessageOrBuilder(index); + } + } + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + public java.util.List<? extends context.ContextOuterClass.ConstraintOrBuilder> + getSliceConstraintsOrBuilderList() { + if (sliceConstraintsBuilder_ != null) { + return sliceConstraintsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(sliceConstraints_); + } + } + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + public context.ContextOuterClass.Constraint.Builder addSliceConstraintsBuilder() { + return getSliceConstraintsFieldBuilder().addBuilder( + context.ContextOuterClass.Constraint.getDefaultInstance()); + } + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + public context.ContextOuterClass.Constraint.Builder addSliceConstraintsBuilder( + int index) { + return getSliceConstraintsFieldBuilder().addBuilder( + index, context.ContextOuterClass.Constraint.getDefaultInstance()); + } + /** + * <code>repeated .context.Constraint slice_constraints = 3;</code> + */ + public java.util.List<context.ContextOuterClass.Constraint.Builder> + getSliceConstraintsBuilderList() { + return getSliceConstraintsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Constraint, context.ContextOuterClass.Constraint.Builder, context.ContextOuterClass.ConstraintOrBuilder> + getSliceConstraintsFieldBuilder() { + if (sliceConstraintsBuilder_ == null) { + sliceConstraintsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Constraint, context.ContextOuterClass.Constraint.Builder, context.ContextOuterClass.ConstraintOrBuilder>( + sliceConstraints_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + sliceConstraints_ = null; + } + return sliceConstraintsBuilder_; + } + + private java.util.List<context.ContextOuterClass.ServiceId> sliceServiceIds_ = + java.util.Collections.emptyList(); + private void ensureSliceServiceIdsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + sliceServiceIds_ = new java.util.ArrayList<context.ContextOuterClass.ServiceId>(sliceServiceIds_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> sliceServiceIdsBuilder_; + + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + public java.util.List<context.ContextOuterClass.ServiceId> getSliceServiceIdsList() { + if (sliceServiceIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(sliceServiceIds_); + } else { + return sliceServiceIdsBuilder_.getMessageList(); + } + } + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + public int getSliceServiceIdsCount() { + if (sliceServiceIdsBuilder_ == null) { + return sliceServiceIds_.size(); + } else { + return sliceServiceIdsBuilder_.getCount(); + } + } + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + public context.ContextOuterClass.ServiceId getSliceServiceIds(int index) { + if (sliceServiceIdsBuilder_ == null) { + return sliceServiceIds_.get(index); + } else { + return sliceServiceIdsBuilder_.getMessage(index); + } + } + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + public Builder setSliceServiceIds( + int index, context.ContextOuterClass.ServiceId value) { + if (sliceServiceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceServiceIdsIsMutable(); + sliceServiceIds_.set(index, value); + onChanged(); + } else { + sliceServiceIdsBuilder_.setMessage(index, value); + } + return this; + } + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + public Builder setSliceServiceIds( + int index, context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (sliceServiceIdsBuilder_ == null) { + ensureSliceServiceIdsIsMutable(); + sliceServiceIds_.set(index, builderForValue.build()); + onChanged(); + } else { + sliceServiceIdsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + public Builder addSliceServiceIds(context.ContextOuterClass.ServiceId value) { + if (sliceServiceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceServiceIdsIsMutable(); + sliceServiceIds_.add(value); + onChanged(); + } else { + sliceServiceIdsBuilder_.addMessage(value); + } + return this; + } + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + public Builder addSliceServiceIds( + int index, context.ContextOuterClass.ServiceId value) { + if (sliceServiceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceServiceIdsIsMutable(); + sliceServiceIds_.add(index, value); + onChanged(); + } else { + sliceServiceIdsBuilder_.addMessage(index, value); + } + return this; + } + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + public Builder addSliceServiceIds( + context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (sliceServiceIdsBuilder_ == null) { + ensureSliceServiceIdsIsMutable(); + sliceServiceIds_.add(builderForValue.build()); + onChanged(); + } else { + sliceServiceIdsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + public Builder addSliceServiceIds( + int index, context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (sliceServiceIdsBuilder_ == null) { + ensureSliceServiceIdsIsMutable(); + sliceServiceIds_.add(index, builderForValue.build()); + onChanged(); + } else { + sliceServiceIdsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + public Builder addAllSliceServiceIds( + java.lang.Iterable<? extends context.ContextOuterClass.ServiceId> values) { + if (sliceServiceIdsBuilder_ == null) { + ensureSliceServiceIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, sliceServiceIds_); + onChanged(); + } else { + sliceServiceIdsBuilder_.addAllMessages(values); + } + return this; + } + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + public Builder clearSliceServiceIds() { + if (sliceServiceIdsBuilder_ == null) { + sliceServiceIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + sliceServiceIdsBuilder_.clear(); + } + return this; + } + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + public Builder removeSliceServiceIds(int index) { + if (sliceServiceIdsBuilder_ == null) { + ensureSliceServiceIdsIsMutable(); + sliceServiceIds_.remove(index); + onChanged(); + } else { + sliceServiceIdsBuilder_.remove(index); + } + return this; + } + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + public context.ContextOuterClass.ServiceId.Builder getSliceServiceIdsBuilder( + int index) { + return getSliceServiceIdsFieldBuilder().getBuilder(index); + } + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + public context.ContextOuterClass.ServiceIdOrBuilder getSliceServiceIdsOrBuilder( + int index) { + if (sliceServiceIdsBuilder_ == null) { + return sliceServiceIds_.get(index); } else { + return sliceServiceIdsBuilder_.getMessageOrBuilder(index); + } + } + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + public java.util.List<? extends context.ContextOuterClass.ServiceIdOrBuilder> + getSliceServiceIdsOrBuilderList() { + if (sliceServiceIdsBuilder_ != null) { + return sliceServiceIdsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(sliceServiceIds_); + } + } + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + public context.ContextOuterClass.ServiceId.Builder addSliceServiceIdsBuilder() { + return getSliceServiceIdsFieldBuilder().addBuilder( + context.ContextOuterClass.ServiceId.getDefaultInstance()); + } + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + public context.ContextOuterClass.ServiceId.Builder addSliceServiceIdsBuilder( + int index) { + return getSliceServiceIdsFieldBuilder().addBuilder( + index, context.ContextOuterClass.ServiceId.getDefaultInstance()); + } + /** + * <code>repeated .context.ServiceId slice_service_ids = 4;</code> + */ + public java.util.List<context.ContextOuterClass.ServiceId.Builder> + getSliceServiceIdsBuilderList() { + return getSliceServiceIdsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> + getSliceServiceIdsFieldBuilder() { + if (sliceServiceIdsBuilder_ == null) { + sliceServiceIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder>( + sliceServiceIds_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + sliceServiceIds_ = null; + } + return sliceServiceIdsBuilder_; + } + + private java.util.List<context.ContextOuterClass.SliceId> sliceSubsliceIds_ = + java.util.Collections.emptyList(); + private void ensureSliceSubsliceIdsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + sliceSubsliceIds_ = new java.util.ArrayList<context.ContextOuterClass.SliceId>(sliceSubsliceIds_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> sliceSubsliceIdsBuilder_; + + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + public java.util.List<context.ContextOuterClass.SliceId> getSliceSubsliceIdsList() { + if (sliceSubsliceIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(sliceSubsliceIds_); + } else { + return sliceSubsliceIdsBuilder_.getMessageList(); + } + } + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + public int getSliceSubsliceIdsCount() { + if (sliceSubsliceIdsBuilder_ == null) { + return sliceSubsliceIds_.size(); + } else { + return sliceSubsliceIdsBuilder_.getCount(); + } + } + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + public context.ContextOuterClass.SliceId getSliceSubsliceIds(int index) { + if (sliceSubsliceIdsBuilder_ == null) { + return sliceSubsliceIds_.get(index); + } else { + return sliceSubsliceIdsBuilder_.getMessage(index); + } + } + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + public Builder setSliceSubsliceIds( + int index, context.ContextOuterClass.SliceId value) { + if (sliceSubsliceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceSubsliceIdsIsMutable(); + sliceSubsliceIds_.set(index, value); + onChanged(); + } else { + sliceSubsliceIdsBuilder_.setMessage(index, value); + } + return this; + } + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + public Builder setSliceSubsliceIds( + int index, context.ContextOuterClass.SliceId.Builder builderForValue) { + if (sliceSubsliceIdsBuilder_ == null) { + ensureSliceSubsliceIdsIsMutable(); + sliceSubsliceIds_.set(index, builderForValue.build()); + onChanged(); + } else { + sliceSubsliceIdsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + public Builder addSliceSubsliceIds(context.ContextOuterClass.SliceId value) { + if (sliceSubsliceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceSubsliceIdsIsMutable(); + sliceSubsliceIds_.add(value); + onChanged(); + } else { + sliceSubsliceIdsBuilder_.addMessage(value); + } + return this; + } + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + public Builder addSliceSubsliceIds( + int index, context.ContextOuterClass.SliceId value) { + if (sliceSubsliceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceSubsliceIdsIsMutable(); + sliceSubsliceIds_.add(index, value); + onChanged(); + } else { + sliceSubsliceIdsBuilder_.addMessage(index, value); + } + return this; + } + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + public Builder addSliceSubsliceIds( + context.ContextOuterClass.SliceId.Builder builderForValue) { + if (sliceSubsliceIdsBuilder_ == null) { + ensureSliceSubsliceIdsIsMutable(); + sliceSubsliceIds_.add(builderForValue.build()); + onChanged(); + } else { + sliceSubsliceIdsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + public Builder addSliceSubsliceIds( + int index, context.ContextOuterClass.SliceId.Builder builderForValue) { + if (sliceSubsliceIdsBuilder_ == null) { + ensureSliceSubsliceIdsIsMutable(); + sliceSubsliceIds_.add(index, builderForValue.build()); + onChanged(); + } else { + sliceSubsliceIdsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + public Builder addAllSliceSubsliceIds( + java.lang.Iterable<? extends context.ContextOuterClass.SliceId> values) { + if (sliceSubsliceIdsBuilder_ == null) { + ensureSliceSubsliceIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, sliceSubsliceIds_); + onChanged(); + } else { + sliceSubsliceIdsBuilder_.addAllMessages(values); + } + return this; + } + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + public Builder clearSliceSubsliceIds() { + if (sliceSubsliceIdsBuilder_ == null) { + sliceSubsliceIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + sliceSubsliceIdsBuilder_.clear(); + } + return this; + } + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + public Builder removeSliceSubsliceIds(int index) { + if (sliceSubsliceIdsBuilder_ == null) { + ensureSliceSubsliceIdsIsMutable(); + sliceSubsliceIds_.remove(index); + onChanged(); + } else { + sliceSubsliceIdsBuilder_.remove(index); + } + return this; + } + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + public context.ContextOuterClass.SliceId.Builder getSliceSubsliceIdsBuilder( + int index) { + return getSliceSubsliceIdsFieldBuilder().getBuilder(index); + } + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + public context.ContextOuterClass.SliceIdOrBuilder getSliceSubsliceIdsOrBuilder( + int index) { + if (sliceSubsliceIdsBuilder_ == null) { + return sliceSubsliceIds_.get(index); } else { + return sliceSubsliceIdsBuilder_.getMessageOrBuilder(index); + } + } + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + public java.util.List<? extends context.ContextOuterClass.SliceIdOrBuilder> + getSliceSubsliceIdsOrBuilderList() { + if (sliceSubsliceIdsBuilder_ != null) { + return sliceSubsliceIdsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(sliceSubsliceIds_); + } + } + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + public context.ContextOuterClass.SliceId.Builder addSliceSubsliceIdsBuilder() { + return getSliceSubsliceIdsFieldBuilder().addBuilder( + context.ContextOuterClass.SliceId.getDefaultInstance()); + } + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + public context.ContextOuterClass.SliceId.Builder addSliceSubsliceIdsBuilder( + int index) { + return getSliceSubsliceIdsFieldBuilder().addBuilder( + index, context.ContextOuterClass.SliceId.getDefaultInstance()); + } + /** + * <code>repeated .context.SliceId slice_subslice_ids = 5;</code> + */ + public java.util.List<context.ContextOuterClass.SliceId.Builder> + getSliceSubsliceIdsBuilderList() { + return getSliceSubsliceIdsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> + getSliceSubsliceIdsFieldBuilder() { + if (sliceSubsliceIdsBuilder_ == null) { + sliceSubsliceIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder>( + sliceSubsliceIds_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + sliceSubsliceIds_ = null; + } + return sliceSubsliceIdsBuilder_; + } + + private context.ContextOuterClass.SliceStatus sliceStatus_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceStatus, context.ContextOuterClass.SliceStatus.Builder, context.ContextOuterClass.SliceStatusOrBuilder> sliceStatusBuilder_; + /** + * <code>.context.SliceStatus slice_status = 6;</code> + * @return Whether the sliceStatus field is set. + */ + public boolean hasSliceStatus() { + return sliceStatusBuilder_ != null || sliceStatus_ != null; + } + /** + * <code>.context.SliceStatus slice_status = 6;</code> + * @return The sliceStatus. + */ + public context.ContextOuterClass.SliceStatus getSliceStatus() { + if (sliceStatusBuilder_ == null) { + return sliceStatus_ == null ? context.ContextOuterClass.SliceStatus.getDefaultInstance() : sliceStatus_; + } else { + return sliceStatusBuilder_.getMessage(); + } + } + /** + * <code>.context.SliceStatus slice_status = 6;</code> + */ + public Builder setSliceStatus(context.ContextOuterClass.SliceStatus value) { + if (sliceStatusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sliceStatus_ = value; + onChanged(); + } else { + sliceStatusBuilder_.setMessage(value); + } + + return this; + } + /** + * <code>.context.SliceStatus slice_status = 6;</code> + */ + public Builder setSliceStatus( + context.ContextOuterClass.SliceStatus.Builder builderForValue) { + if (sliceStatusBuilder_ == null) { + sliceStatus_ = builderForValue.build(); + onChanged(); + } else { + sliceStatusBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * <code>.context.SliceStatus slice_status = 6;</code> + */ + public Builder mergeSliceStatus(context.ContextOuterClass.SliceStatus value) { + if (sliceStatusBuilder_ == null) { + if (sliceStatus_ != null) { + sliceStatus_ = + context.ContextOuterClass.SliceStatus.newBuilder(sliceStatus_).mergeFrom(value).buildPartial(); + } else { + sliceStatus_ = value; + } + onChanged(); + } else { + sliceStatusBuilder_.mergeFrom(value); + } + + return this; + } + /** + * <code>.context.SliceStatus slice_status = 6;</code> + */ + public Builder clearSliceStatus() { + if (sliceStatusBuilder_ == null) { + sliceStatus_ = null; + onChanged(); + } else { + sliceStatus_ = null; + sliceStatusBuilder_ = null; + } + + return this; + } + /** + * <code>.context.SliceStatus slice_status = 6;</code> + */ + public context.ContextOuterClass.SliceStatus.Builder getSliceStatusBuilder() { + + onChanged(); + return getSliceStatusFieldBuilder().getBuilder(); + } + /** + * <code>.context.SliceStatus slice_status = 6;</code> + */ + public context.ContextOuterClass.SliceStatusOrBuilder getSliceStatusOrBuilder() { + if (sliceStatusBuilder_ != null) { + return sliceStatusBuilder_.getMessageOrBuilder(); + } else { + return sliceStatus_ == null ? + context.ContextOuterClass.SliceStatus.getDefaultInstance() : sliceStatus_; + } + } + /** + * <code>.context.SliceStatus slice_status = 6;</code> + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceStatus, context.ContextOuterClass.SliceStatus.Builder, context.ContextOuterClass.SliceStatusOrBuilder> + getSliceStatusFieldBuilder() { + if (sliceStatusBuilder_ == null) { + sliceStatusBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceStatus, context.ContextOuterClass.SliceStatus.Builder, context.ContextOuterClass.SliceStatusOrBuilder>( + getSliceStatus(), + getParentForChildren(), + isClean()); + sliceStatus_ = null; + } + return sliceStatusBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:context.Slice) + } + + // @@protoc_insertion_point(class_scope:context.Slice) + private static final context.ContextOuterClass.Slice DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.Slice(); + } + + public static context.ContextOuterClass.Slice getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<Slice> + PARSER = new com.google.protobuf.AbstractParser<Slice>() { + @java.lang.Override + public Slice parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Slice(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<Slice> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<Slice> getParserForType() { + return PARSER; + } + + @java.lang.Override + public context.ContextOuterClass.Slice getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SliceStatusOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.SliceStatus) + com.google.protobuf.MessageOrBuilder { + + /** + * <code>.context.SliceStatusEnum slice_status = 1;</code> + * @return The enum numeric value on the wire for sliceStatus. + */ + int getSliceStatusValue(); + /** + * <code>.context.SliceStatusEnum slice_status = 1;</code> + * @return The sliceStatus. + */ + context.ContextOuterClass.SliceStatusEnum getSliceStatus(); + } + /** + * Protobuf type {@code context.SliceStatus} + */ + public static final class SliceStatus extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.SliceStatus) + SliceStatusOrBuilder { + private static final long serialVersionUID = 0L; + // Use SliceStatus.newBuilder() to construct. + private SliceStatus(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private SliceStatus() { + sliceStatus_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SliceStatus(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SliceStatus( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + int rawValue = input.readEnum(); + + sliceStatus_ = rawValue; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_SliceStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_SliceStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.SliceStatus.class, context.ContextOuterClass.SliceStatus.Builder.class); + } + + public static final int SLICE_STATUS_FIELD_NUMBER = 1; + private int sliceStatus_; + /** + * <code>.context.SliceStatusEnum slice_status = 1;</code> + * @return The enum numeric value on the wire for sliceStatus. + */ + @java.lang.Override public int getSliceStatusValue() { + return sliceStatus_; + } + /** + * <code>.context.SliceStatusEnum slice_status = 1;</code> + * @return The sliceStatus. + */ + @java.lang.Override public context.ContextOuterClass.SliceStatusEnum getSliceStatus() { + @SuppressWarnings("deprecation") + context.ContextOuterClass.SliceStatusEnum result = context.ContextOuterClass.SliceStatusEnum.valueOf(sliceStatus_); + return result == null ? context.ContextOuterClass.SliceStatusEnum.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (sliceStatus_ != context.ContextOuterClass.SliceStatusEnum.SLICESTATUS_UNDEFINED.getNumber()) { + output.writeEnum(1, sliceStatus_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (sliceStatus_ != context.ContextOuterClass.SliceStatusEnum.SLICESTATUS_UNDEFINED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, sliceStatus_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof context.ContextOuterClass.SliceStatus)) { + return super.equals(obj); + } + context.ContextOuterClass.SliceStatus other = (context.ContextOuterClass.SliceStatus) obj; + + if (sliceStatus_ != other.sliceStatus_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SLICE_STATUS_FIELD_NUMBER; + hash = (53 * hash) + sliceStatus_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.SliceStatus parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.SliceStatus parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.SliceStatus parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.SliceStatus parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.SliceStatus parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.SliceStatus parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.SliceStatus parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.SliceStatus parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static context.ContextOuterClass.SliceStatus parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.SliceStatus parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static context.ContextOuterClass.SliceStatus parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.SliceStatus parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(context.ContextOuterClass.SliceStatus prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code context.SliceStatus} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:context.SliceStatus) + context.ContextOuterClass.SliceStatusOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_SliceStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_SliceStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.SliceStatus.class, context.ContextOuterClass.SliceStatus.Builder.class); + } + + // Construct using context.ContextOuterClass.SliceStatus.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + sliceStatus_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_SliceStatus_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.SliceStatus getDefaultInstanceForType() { + return context.ContextOuterClass.SliceStatus.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.SliceStatus build() { + context.ContextOuterClass.SliceStatus result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.SliceStatus buildPartial() { + context.ContextOuterClass.SliceStatus result = new context.ContextOuterClass.SliceStatus(this); + result.sliceStatus_ = sliceStatus_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof context.ContextOuterClass.SliceStatus) { + return mergeFrom((context.ContextOuterClass.SliceStatus)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.SliceStatus other) { + if (other == context.ContextOuterClass.SliceStatus.getDefaultInstance()) return this; + if (other.sliceStatus_ != 0) { + setSliceStatusValue(other.getSliceStatusValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + context.ContextOuterClass.SliceStatus parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.SliceStatus) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int sliceStatus_ = 0; + /** + * <code>.context.SliceStatusEnum slice_status = 1;</code> + * @return The enum numeric value on the wire for sliceStatus. + */ + @java.lang.Override public int getSliceStatusValue() { + return sliceStatus_; + } + /** + * <code>.context.SliceStatusEnum slice_status = 1;</code> + * @param value The enum numeric value on the wire for sliceStatus to set. + * @return This builder for chaining. + */ + public Builder setSliceStatusValue(int value) { + + sliceStatus_ = value; + onChanged(); + return this; + } + /** + * <code>.context.SliceStatusEnum slice_status = 1;</code> + * @return The sliceStatus. + */ + @java.lang.Override + public context.ContextOuterClass.SliceStatusEnum getSliceStatus() { + @SuppressWarnings("deprecation") + context.ContextOuterClass.SliceStatusEnum result = context.ContextOuterClass.SliceStatusEnum.valueOf(sliceStatus_); + return result == null ? context.ContextOuterClass.SliceStatusEnum.UNRECOGNIZED : result; + } + /** + * <code>.context.SliceStatusEnum slice_status = 1;</code> + * @param value The sliceStatus to set. + * @return This builder for chaining. + */ + public Builder setSliceStatus(context.ContextOuterClass.SliceStatusEnum value) { + if (value == null) { + throw new NullPointerException(); + } + + sliceStatus_ = value.getNumber(); + onChanged(); + return this; + } + /** + * <code>.context.SliceStatusEnum slice_status = 1;</code> + * @return This builder for chaining. + */ + public Builder clearSliceStatus() { + + sliceStatus_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:context.SliceStatus) + } + + // @@protoc_insertion_point(class_scope:context.SliceStatus) + private static final context.ContextOuterClass.SliceStatus DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.SliceStatus(); + } + + public static context.ContextOuterClass.SliceStatus getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<SliceStatus> + PARSER = new com.google.protobuf.AbstractParser<SliceStatus>() { + @java.lang.Override + public SliceStatus parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SliceStatus(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<SliceStatus> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<SliceStatus> getParserForType() { + return PARSER; + } + + @java.lang.Override + public context.ContextOuterClass.SliceStatus getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SliceIdListOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.SliceIdList) + com.google.protobuf.MessageOrBuilder { + + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + java.util.List<context.ContextOuterClass.SliceId> + getSliceIdsList(); + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + context.ContextOuterClass.SliceId getSliceIds(int index); + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + int getSliceIdsCount(); + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + java.util.List<? extends context.ContextOuterClass.SliceIdOrBuilder> + getSliceIdsOrBuilderList(); + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + context.ContextOuterClass.SliceIdOrBuilder getSliceIdsOrBuilder( + int index); + } + /** + * Protobuf type {@code context.SliceIdList} + */ + public static final class SliceIdList extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.SliceIdList) + SliceIdListOrBuilder { + private static final long serialVersionUID = 0L; + // Use SliceIdList.newBuilder() to construct. + private SliceIdList(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private SliceIdList() { + sliceIds_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SliceIdList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SliceIdList( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + sliceIds_ = new java.util.ArrayList<context.ContextOuterClass.SliceId>(); + mutable_bitField0_ |= 0x00000001; + } + sliceIds_.add( + input.readMessage(context.ContextOuterClass.SliceId.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + sliceIds_ = java.util.Collections.unmodifiableList(sliceIds_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_SliceIdList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_SliceIdList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.SliceIdList.class, context.ContextOuterClass.SliceIdList.Builder.class); + } + + public static final int SLICE_IDS_FIELD_NUMBER = 1; + private java.util.List<context.ContextOuterClass.SliceId> sliceIds_; + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + @java.lang.Override + public java.util.List<context.ContextOuterClass.SliceId> getSliceIdsList() { + return sliceIds_; + } + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + @java.lang.Override + public java.util.List<? extends context.ContextOuterClass.SliceIdOrBuilder> + getSliceIdsOrBuilderList() { + return sliceIds_; + } + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + @java.lang.Override + public int getSliceIdsCount() { + return sliceIds_.size(); + } + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + @java.lang.Override + public context.ContextOuterClass.SliceId getSliceIds(int index) { + return sliceIds_.get(index); + } + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + @java.lang.Override + public context.ContextOuterClass.SliceIdOrBuilder getSliceIdsOrBuilder( + int index) { + return sliceIds_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < sliceIds_.size(); i++) { + output.writeMessage(1, sliceIds_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < sliceIds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, sliceIds_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof context.ContextOuterClass.SliceIdList)) { + return super.equals(obj); + } + context.ContextOuterClass.SliceIdList other = (context.ContextOuterClass.SliceIdList) obj; + + if (!getSliceIdsList() + .equals(other.getSliceIdsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getSliceIdsCount() > 0) { + hash = (37 * hash) + SLICE_IDS_FIELD_NUMBER; + hash = (53 * hash) + getSliceIdsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.SliceIdList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.SliceIdList parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.SliceIdList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.SliceIdList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.SliceIdList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.SliceIdList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.SliceIdList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.SliceIdList parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static context.ContextOuterClass.SliceIdList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.SliceIdList parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static context.ContextOuterClass.SliceIdList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.SliceIdList parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(context.ContextOuterClass.SliceIdList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code context.SliceIdList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:context.SliceIdList) + context.ContextOuterClass.SliceIdListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_SliceIdList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_SliceIdList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.SliceIdList.class, context.ContextOuterClass.SliceIdList.Builder.class); + } + + // Construct using context.ContextOuterClass.SliceIdList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getSliceIdsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (sliceIdsBuilder_ == null) { + sliceIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + sliceIdsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_SliceIdList_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.SliceIdList getDefaultInstanceForType() { + return context.ContextOuterClass.SliceIdList.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.SliceIdList build() { + context.ContextOuterClass.SliceIdList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.SliceIdList buildPartial() { + context.ContextOuterClass.SliceIdList result = new context.ContextOuterClass.SliceIdList(this); + int from_bitField0_ = bitField0_; + if (sliceIdsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + sliceIds_ = java.util.Collections.unmodifiableList(sliceIds_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.sliceIds_ = sliceIds_; + } else { + result.sliceIds_ = sliceIdsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof context.ContextOuterClass.SliceIdList) { + return mergeFrom((context.ContextOuterClass.SliceIdList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.SliceIdList other) { + if (other == context.ContextOuterClass.SliceIdList.getDefaultInstance()) return this; + if (sliceIdsBuilder_ == null) { + if (!other.sliceIds_.isEmpty()) { + if (sliceIds_.isEmpty()) { + sliceIds_ = other.sliceIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSliceIdsIsMutable(); + sliceIds_.addAll(other.sliceIds_); + } + onChanged(); + } + } else { + if (!other.sliceIds_.isEmpty()) { + if (sliceIdsBuilder_.isEmpty()) { + sliceIdsBuilder_.dispose(); + sliceIdsBuilder_ = null; + sliceIds_ = other.sliceIds_; + bitField0_ = (bitField0_ & ~0x00000001); + sliceIdsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSliceIdsFieldBuilder() : null; + } else { + sliceIdsBuilder_.addAllMessages(other.sliceIds_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + context.ContextOuterClass.SliceIdList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.SliceIdList) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List<context.ContextOuterClass.SliceId> sliceIds_ = + java.util.Collections.emptyList(); + private void ensureSliceIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + sliceIds_ = new java.util.ArrayList<context.ContextOuterClass.SliceId>(sliceIds_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> sliceIdsBuilder_; + + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + public java.util.List<context.ContextOuterClass.SliceId> getSliceIdsList() { + if (sliceIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(sliceIds_); + } else { + return sliceIdsBuilder_.getMessageList(); + } + } + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + public int getSliceIdsCount() { + if (sliceIdsBuilder_ == null) { + return sliceIds_.size(); + } else { + return sliceIdsBuilder_.getCount(); + } + } + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + public context.ContextOuterClass.SliceId getSliceIds(int index) { + if (sliceIdsBuilder_ == null) { + return sliceIds_.get(index); + } else { + return sliceIdsBuilder_.getMessage(index); + } + } + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + public Builder setSliceIds( + int index, context.ContextOuterClass.SliceId value) { + if (sliceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceIdsIsMutable(); + sliceIds_.set(index, value); + onChanged(); + } else { + sliceIdsBuilder_.setMessage(index, value); + } + return this; + } + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + public Builder setSliceIds( + int index, context.ContextOuterClass.SliceId.Builder builderForValue) { + if (sliceIdsBuilder_ == null) { + ensureSliceIdsIsMutable(); + sliceIds_.set(index, builderForValue.build()); + onChanged(); + } else { + sliceIdsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + public Builder addSliceIds(context.ContextOuterClass.SliceId value) { + if (sliceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceIdsIsMutable(); + sliceIds_.add(value); + onChanged(); + } else { + sliceIdsBuilder_.addMessage(value); + } + return this; + } + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + public Builder addSliceIds( + int index, context.ContextOuterClass.SliceId value) { + if (sliceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceIdsIsMutable(); + sliceIds_.add(index, value); + onChanged(); + } else { + sliceIdsBuilder_.addMessage(index, value); + } + return this; + } + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + public Builder addSliceIds( + context.ContextOuterClass.SliceId.Builder builderForValue) { + if (sliceIdsBuilder_ == null) { + ensureSliceIdsIsMutable(); + sliceIds_.add(builderForValue.build()); + onChanged(); + } else { + sliceIdsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + public Builder addSliceIds( + int index, context.ContextOuterClass.SliceId.Builder builderForValue) { + if (sliceIdsBuilder_ == null) { + ensureSliceIdsIsMutable(); + sliceIds_.add(index, builderForValue.build()); + onChanged(); + } else { + sliceIdsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + public Builder addAllSliceIds( + java.lang.Iterable<? extends context.ContextOuterClass.SliceId> values) { + if (sliceIdsBuilder_ == null) { + ensureSliceIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, sliceIds_); + onChanged(); + } else { + sliceIdsBuilder_.addAllMessages(values); + } + return this; + } + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + public Builder clearSliceIds() { + if (sliceIdsBuilder_ == null) { + sliceIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + sliceIdsBuilder_.clear(); + } + return this; + } + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + public Builder removeSliceIds(int index) { + if (sliceIdsBuilder_ == null) { + ensureSliceIdsIsMutable(); + sliceIds_.remove(index); + onChanged(); + } else { + sliceIdsBuilder_.remove(index); + } + return this; + } + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + public context.ContextOuterClass.SliceId.Builder getSliceIdsBuilder( + int index) { + return getSliceIdsFieldBuilder().getBuilder(index); + } + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + public context.ContextOuterClass.SliceIdOrBuilder getSliceIdsOrBuilder( + int index) { + if (sliceIdsBuilder_ == null) { + return sliceIds_.get(index); } else { + return sliceIdsBuilder_.getMessageOrBuilder(index); + } + } + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + public java.util.List<? extends context.ContextOuterClass.SliceIdOrBuilder> + getSliceIdsOrBuilderList() { + if (sliceIdsBuilder_ != null) { + return sliceIdsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(sliceIds_); + } + } + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + public context.ContextOuterClass.SliceId.Builder addSliceIdsBuilder() { + return getSliceIdsFieldBuilder().addBuilder( + context.ContextOuterClass.SliceId.getDefaultInstance()); + } + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + public context.ContextOuterClass.SliceId.Builder addSliceIdsBuilder( + int index) { + return getSliceIdsFieldBuilder().addBuilder( + index, context.ContextOuterClass.SliceId.getDefaultInstance()); + } + /** + * <code>repeated .context.SliceId slice_ids = 1;</code> + */ + public java.util.List<context.ContextOuterClass.SliceId.Builder> + getSliceIdsBuilderList() { + return getSliceIdsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> + getSliceIdsFieldBuilder() { + if (sliceIdsBuilder_ == null) { + sliceIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder>( + sliceIds_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + sliceIds_ = null; + } + return sliceIdsBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:context.SliceIdList) + } + + // @@protoc_insertion_point(class_scope:context.SliceIdList) + private static final context.ContextOuterClass.SliceIdList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.SliceIdList(); + } + + public static context.ContextOuterClass.SliceIdList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<SliceIdList> + PARSER = new com.google.protobuf.AbstractParser<SliceIdList>() { + @java.lang.Override + public SliceIdList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SliceIdList(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<SliceIdList> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<SliceIdList> getParserForType() { + return PARSER; + } + + @java.lang.Override + public context.ContextOuterClass.SliceIdList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SliceListOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.SliceList) + com.google.protobuf.MessageOrBuilder { + + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + java.util.List<context.ContextOuterClass.Slice> + getSlicesList(); + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + context.ContextOuterClass.Slice getSlices(int index); + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + int getSlicesCount(); + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + java.util.List<? extends context.ContextOuterClass.SliceOrBuilder> + getSlicesOrBuilderList(); + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + context.ContextOuterClass.SliceOrBuilder getSlicesOrBuilder( + int index); + } + /** + * Protobuf type {@code context.SliceList} + */ + public static final class SliceList extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.SliceList) + SliceListOrBuilder { + private static final long serialVersionUID = 0L; + // Use SliceList.newBuilder() to construct. + private SliceList(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private SliceList() { + slices_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SliceList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SliceList( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + slices_ = new java.util.ArrayList<context.ContextOuterClass.Slice>(); + mutable_bitField0_ |= 0x00000001; + } + slices_.add( + input.readMessage(context.ContextOuterClass.Slice.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + slices_ = java.util.Collections.unmodifiableList(slices_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_SliceList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_SliceList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.SliceList.class, context.ContextOuterClass.SliceList.Builder.class); + } + + public static final int SLICES_FIELD_NUMBER = 1; + private java.util.List<context.ContextOuterClass.Slice> slices_; + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + @java.lang.Override + public java.util.List<context.ContextOuterClass.Slice> getSlicesList() { + return slices_; + } + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + @java.lang.Override + public java.util.List<? extends context.ContextOuterClass.SliceOrBuilder> + getSlicesOrBuilderList() { + return slices_; + } + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + @java.lang.Override + public int getSlicesCount() { + return slices_.size(); + } + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + @java.lang.Override + public context.ContextOuterClass.Slice getSlices(int index) { + return slices_.get(index); + } + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + @java.lang.Override + public context.ContextOuterClass.SliceOrBuilder getSlicesOrBuilder( + int index) { + return slices_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < slices_.size(); i++) { + output.writeMessage(1, slices_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < slices_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, slices_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof context.ContextOuterClass.SliceList)) { + return super.equals(obj); + } + context.ContextOuterClass.SliceList other = (context.ContextOuterClass.SliceList) obj; + + if (!getSlicesList() + .equals(other.getSlicesList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getSlicesCount() > 0) { + hash = (37 * hash) + SLICES_FIELD_NUMBER; + hash = (53 * hash) + getSlicesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.SliceList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.SliceList parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.SliceList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.SliceList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.SliceList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.SliceList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.SliceList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.SliceList parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static context.ContextOuterClass.SliceList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.SliceList parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static context.ContextOuterClass.SliceList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.SliceList parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(context.ContextOuterClass.SliceList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code context.SliceList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:context.SliceList) + context.ContextOuterClass.SliceListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_SliceList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_SliceList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.SliceList.class, context.ContextOuterClass.SliceList.Builder.class); + } + + // Construct using context.ContextOuterClass.SliceList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getSlicesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (slicesBuilder_ == null) { + slices_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + slicesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_SliceList_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.SliceList getDefaultInstanceForType() { + return context.ContextOuterClass.SliceList.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.SliceList build() { + context.ContextOuterClass.SliceList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.SliceList buildPartial() { + context.ContextOuterClass.SliceList result = new context.ContextOuterClass.SliceList(this); + int from_bitField0_ = bitField0_; + if (slicesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + slices_ = java.util.Collections.unmodifiableList(slices_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.slices_ = slices_; + } else { + result.slices_ = slicesBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof context.ContextOuterClass.SliceList) { + return mergeFrom((context.ContextOuterClass.SliceList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.SliceList other) { + if (other == context.ContextOuterClass.SliceList.getDefaultInstance()) return this; + if (slicesBuilder_ == null) { + if (!other.slices_.isEmpty()) { + if (slices_.isEmpty()) { + slices_ = other.slices_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSlicesIsMutable(); + slices_.addAll(other.slices_); + } + onChanged(); + } + } else { + if (!other.slices_.isEmpty()) { + if (slicesBuilder_.isEmpty()) { + slicesBuilder_.dispose(); + slicesBuilder_ = null; + slices_ = other.slices_; + bitField0_ = (bitField0_ & ~0x00000001); + slicesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSlicesFieldBuilder() : null; + } else { + slicesBuilder_.addAllMessages(other.slices_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + context.ContextOuterClass.SliceList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.SliceList) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List<context.ContextOuterClass.Slice> slices_ = + java.util.Collections.emptyList(); + private void ensureSlicesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + slices_ = new java.util.ArrayList<context.ContextOuterClass.Slice>(slices_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Slice, context.ContextOuterClass.Slice.Builder, context.ContextOuterClass.SliceOrBuilder> slicesBuilder_; + + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + public java.util.List<context.ContextOuterClass.Slice> getSlicesList() { + if (slicesBuilder_ == null) { + return java.util.Collections.unmodifiableList(slices_); + } else { + return slicesBuilder_.getMessageList(); + } + } + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + public int getSlicesCount() { + if (slicesBuilder_ == null) { + return slices_.size(); + } else { + return slicesBuilder_.getCount(); + } + } + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + public context.ContextOuterClass.Slice getSlices(int index) { + if (slicesBuilder_ == null) { + return slices_.get(index); + } else { + return slicesBuilder_.getMessage(index); + } + } + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + public Builder setSlices( + int index, context.ContextOuterClass.Slice value) { + if (slicesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSlicesIsMutable(); + slices_.set(index, value); + onChanged(); + } else { + slicesBuilder_.setMessage(index, value); + } + return this; + } + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + public Builder setSlices( + int index, context.ContextOuterClass.Slice.Builder builderForValue) { + if (slicesBuilder_ == null) { + ensureSlicesIsMutable(); + slices_.set(index, builderForValue.build()); + onChanged(); + } else { + slicesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + public Builder addSlices(context.ContextOuterClass.Slice value) { + if (slicesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSlicesIsMutable(); + slices_.add(value); + onChanged(); + } else { + slicesBuilder_.addMessage(value); + } + return this; + } + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + public Builder addSlices( + int index, context.ContextOuterClass.Slice value) { + if (slicesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSlicesIsMutable(); + slices_.add(index, value); + onChanged(); + } else { + slicesBuilder_.addMessage(index, value); + } + return this; + } + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + public Builder addSlices( + context.ContextOuterClass.Slice.Builder builderForValue) { + if (slicesBuilder_ == null) { + ensureSlicesIsMutable(); + slices_.add(builderForValue.build()); + onChanged(); + } else { + slicesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + public Builder addSlices( + int index, context.ContextOuterClass.Slice.Builder builderForValue) { + if (slicesBuilder_ == null) { + ensureSlicesIsMutable(); + slices_.add(index, builderForValue.build()); + onChanged(); + } else { + slicesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + public Builder addAllSlices( + java.lang.Iterable<? extends context.ContextOuterClass.Slice> values) { + if (slicesBuilder_ == null) { + ensureSlicesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, slices_); + onChanged(); + } else { + slicesBuilder_.addAllMessages(values); + } + return this; + } + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + public Builder clearSlices() { + if (slicesBuilder_ == null) { + slices_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + slicesBuilder_.clear(); + } + return this; + } + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + public Builder removeSlices(int index) { + if (slicesBuilder_ == null) { + ensureSlicesIsMutable(); + slices_.remove(index); + onChanged(); + } else { + slicesBuilder_.remove(index); + } + return this; + } + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + public context.ContextOuterClass.Slice.Builder getSlicesBuilder( + int index) { + return getSlicesFieldBuilder().getBuilder(index); + } + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + public context.ContextOuterClass.SliceOrBuilder getSlicesOrBuilder( + int index) { + if (slicesBuilder_ == null) { + return slices_.get(index); } else { + return slicesBuilder_.getMessageOrBuilder(index); + } + } + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + public java.util.List<? extends context.ContextOuterClass.SliceOrBuilder> + getSlicesOrBuilderList() { + if (slicesBuilder_ != null) { + return slicesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(slices_); + } + } + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + public context.ContextOuterClass.Slice.Builder addSlicesBuilder() { + return getSlicesFieldBuilder().addBuilder( + context.ContextOuterClass.Slice.getDefaultInstance()); + } + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + public context.ContextOuterClass.Slice.Builder addSlicesBuilder( + int index) { + return getSlicesFieldBuilder().addBuilder( + index, context.ContextOuterClass.Slice.getDefaultInstance()); + } + /** + * <code>repeated .context.Slice slices = 1;</code> + */ + public java.util.List<context.ContextOuterClass.Slice.Builder> + getSlicesBuilderList() { + return getSlicesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Slice, context.ContextOuterClass.Slice.Builder, context.ContextOuterClass.SliceOrBuilder> + getSlicesFieldBuilder() { + if (slicesBuilder_ == null) { + slicesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Slice, context.ContextOuterClass.Slice.Builder, context.ContextOuterClass.SliceOrBuilder>( + slices_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + slices_ = null; + } + return slicesBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:context.SliceList) + } + + // @@protoc_insertion_point(class_scope:context.SliceList) + private static final context.ContextOuterClass.SliceList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.SliceList(); + } + + public static context.ContextOuterClass.SliceList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<SliceList> + PARSER = new com.google.protobuf.AbstractParser<SliceList>() { + @java.lang.Override + public SliceList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SliceList(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<SliceList> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<SliceList> getParserForType() { + return PARSER; + } + + @java.lang.Override + public context.ContextOuterClass.SliceList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SliceEventOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.SliceEvent) + com.google.protobuf.MessageOrBuilder { + + /** + * <code>.context.Event event = 1;</code> + * @return Whether the event field is set. + */ + boolean hasEvent(); + /** + * <code>.context.Event event = 1;</code> + * @return The event. + */ + context.ContextOuterClass.Event getEvent(); + /** + * <code>.context.Event event = 1;</code> + */ + context.ContextOuterClass.EventOrBuilder getEventOrBuilder(); + + /** + * <code>.context.SliceId slice_id = 2;</code> + * @return Whether the sliceId field is set. + */ + boolean hasSliceId(); + /** + * <code>.context.SliceId slice_id = 2;</code> + * @return The sliceId. + */ + context.ContextOuterClass.SliceId getSliceId(); + /** + * <code>.context.SliceId slice_id = 2;</code> + */ + context.ContextOuterClass.SliceIdOrBuilder getSliceIdOrBuilder(); + } + /** + * Protobuf type {@code context.SliceEvent} + */ + public static final class SliceEvent extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.SliceEvent) + SliceEventOrBuilder { + private static final long serialVersionUID = 0L; + // Use SliceEvent.newBuilder() to construct. + private SliceEvent(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private SliceEvent() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SliceEvent(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SliceEvent( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + context.ContextOuterClass.Event.Builder subBuilder = null; + if (event_ != null) { + subBuilder = event_.toBuilder(); + } + event_ = input.readMessage(context.ContextOuterClass.Event.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(event_); + event_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + context.ContextOuterClass.SliceId.Builder subBuilder = null; + if (sliceId_ != null) { + subBuilder = sliceId_.toBuilder(); + } + sliceId_ = input.readMessage(context.ContextOuterClass.SliceId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(sliceId_); + sliceId_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_SliceEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_SliceEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.SliceEvent.class, context.ContextOuterClass.SliceEvent.Builder.class); + } + + public static final int EVENT_FIELD_NUMBER = 1; + private context.ContextOuterClass.Event event_; + /** + * <code>.context.Event event = 1;</code> + * @return Whether the event field is set. + */ + @java.lang.Override + public boolean hasEvent() { + return event_ != null; + } + /** + * <code>.context.Event event = 1;</code> + * @return The event. + */ + @java.lang.Override + public context.ContextOuterClass.Event getEvent() { + return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; + } + /** + * <code>.context.Event event = 1;</code> + */ + @java.lang.Override + public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { + return getEvent(); + } + + public static final int SLICE_ID_FIELD_NUMBER = 2; + private context.ContextOuterClass.SliceId sliceId_; + /** + * <code>.context.SliceId slice_id = 2;</code> + * @return Whether the sliceId field is set. + */ + @java.lang.Override + public boolean hasSliceId() { + return sliceId_ != null; + } + /** + * <code>.context.SliceId slice_id = 2;</code> + * @return The sliceId. + */ + @java.lang.Override + public context.ContextOuterClass.SliceId getSliceId() { + return sliceId_ == null ? context.ContextOuterClass.SliceId.getDefaultInstance() : sliceId_; + } + /** + * <code>.context.SliceId slice_id = 2;</code> + */ + @java.lang.Override + public context.ContextOuterClass.SliceIdOrBuilder getSliceIdOrBuilder() { + return getSliceId(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (event_ != null) { + output.writeMessage(1, getEvent()); + } + if (sliceId_ != null) { + output.writeMessage(2, getSliceId()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (event_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getEvent()); + } + if (sliceId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getSliceId()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof context.ContextOuterClass.SliceEvent)) { + return super.equals(obj); + } + context.ContextOuterClass.SliceEvent other = (context.ContextOuterClass.SliceEvent) obj; + + if (hasEvent() != other.hasEvent()) return false; + if (hasEvent()) { + if (!getEvent() + .equals(other.getEvent())) return false; + } + if (hasSliceId() != other.hasSliceId()) return false; + if (hasSliceId()) { + if (!getSliceId() + .equals(other.getSliceId())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasEvent()) { + hash = (37 * hash) + EVENT_FIELD_NUMBER; + hash = (53 * hash) + getEvent().hashCode(); + } + if (hasSliceId()) { + hash = (37 * hash) + SLICE_ID_FIELD_NUMBER; + hash = (53 * hash) + getSliceId().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.SliceEvent parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.SliceEvent parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.SliceEvent parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.SliceEvent parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.SliceEvent parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.SliceEvent parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.SliceEvent parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.SliceEvent parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static context.ContextOuterClass.SliceEvent parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.SliceEvent parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static context.ContextOuterClass.SliceEvent parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.SliceEvent parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(context.ContextOuterClass.SliceEvent prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code context.SliceEvent} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:context.SliceEvent) + context.ContextOuterClass.SliceEventOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_SliceEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_SliceEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.SliceEvent.class, context.ContextOuterClass.SliceEvent.Builder.class); + } + + // Construct using context.ContextOuterClass.SliceEvent.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (eventBuilder_ == null) { + event_ = null; + } else { + event_ = null; + eventBuilder_ = null; + } + if (sliceIdBuilder_ == null) { + sliceId_ = null; + } else { + sliceId_ = null; + sliceIdBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_SliceEvent_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.SliceEvent getDefaultInstanceForType() { + return context.ContextOuterClass.SliceEvent.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.SliceEvent build() { + context.ContextOuterClass.SliceEvent result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.SliceEvent buildPartial() { + context.ContextOuterClass.SliceEvent result = new context.ContextOuterClass.SliceEvent(this); + if (eventBuilder_ == null) { + result.event_ = event_; + } else { + result.event_ = eventBuilder_.build(); + } + if (sliceIdBuilder_ == null) { + result.sliceId_ = sliceId_; + } else { + result.sliceId_ = sliceIdBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof context.ContextOuterClass.SliceEvent) { + return mergeFrom((context.ContextOuterClass.SliceEvent)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.SliceEvent other) { + if (other == context.ContextOuterClass.SliceEvent.getDefaultInstance()) return this; + if (other.hasEvent()) { + mergeEvent(other.getEvent()); + } + if (other.hasSliceId()) { + mergeSliceId(other.getSliceId()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + context.ContextOuterClass.SliceEvent parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.SliceEvent) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private context.ContextOuterClass.Event event_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> eventBuilder_; + /** + * <code>.context.Event event = 1;</code> + * @return Whether the event field is set. + */ + public boolean hasEvent() { + return eventBuilder_ != null || event_ != null; + } + /** + * <code>.context.Event event = 1;</code> + * @return The event. + */ + public context.ContextOuterClass.Event getEvent() { + if (eventBuilder_ == null) { + return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; + } else { + return eventBuilder_.getMessage(); + } + } + /** + * <code>.context.Event event = 1;</code> + */ + public Builder setEvent(context.ContextOuterClass.Event value) { + if (eventBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + event_ = value; + onChanged(); + } else { + eventBuilder_.setMessage(value); + } + + return this; + } + /** + * <code>.context.Event event = 1;</code> + */ + public Builder setEvent( + context.ContextOuterClass.Event.Builder builderForValue) { + if (eventBuilder_ == null) { + event_ = builderForValue.build(); + onChanged(); + } else { + eventBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * <code>.context.Event event = 1;</code> + */ + public Builder mergeEvent(context.ContextOuterClass.Event value) { + if (eventBuilder_ == null) { + if (event_ != null) { + event_ = + context.ContextOuterClass.Event.newBuilder(event_).mergeFrom(value).buildPartial(); + } else { + event_ = value; + } + onChanged(); + } else { + eventBuilder_.mergeFrom(value); + } + + return this; + } + /** + * <code>.context.Event event = 1;</code> + */ + public Builder clearEvent() { + if (eventBuilder_ == null) { + event_ = null; + onChanged(); + } else { + event_ = null; + eventBuilder_ = null; + } + + return this; + } + /** + * <code>.context.Event event = 1;</code> + */ + public context.ContextOuterClass.Event.Builder getEventBuilder() { + + onChanged(); + return getEventFieldBuilder().getBuilder(); + } + /** + * <code>.context.Event event = 1;</code> + */ + public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { + if (eventBuilder_ != null) { + return eventBuilder_.getMessageOrBuilder(); + } else { + return event_ == null ? + context.ContextOuterClass.Event.getDefaultInstance() : event_; + } + } + /** + * <code>.context.Event event = 1;</code> + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> + getEventFieldBuilder() { + if (eventBuilder_ == null) { + eventBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder>( + getEvent(), + getParentForChildren(), + isClean()); + event_ = null; + } + return eventBuilder_; + } + + private context.ContextOuterClass.SliceId sliceId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> sliceIdBuilder_; + /** + * <code>.context.SliceId slice_id = 2;</code> + * @return Whether the sliceId field is set. + */ + public boolean hasSliceId() { + return sliceIdBuilder_ != null || sliceId_ != null; + } + /** + * <code>.context.SliceId slice_id = 2;</code> + * @return The sliceId. + */ + public context.ContextOuterClass.SliceId getSliceId() { + if (sliceIdBuilder_ == null) { + return sliceId_ == null ? context.ContextOuterClass.SliceId.getDefaultInstance() : sliceId_; + } else { + return sliceIdBuilder_.getMessage(); + } + } + /** + * <code>.context.SliceId slice_id = 2;</code> + */ + public Builder setSliceId(context.ContextOuterClass.SliceId value) { + if (sliceIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sliceId_ = value; + onChanged(); + } else { + sliceIdBuilder_.setMessage(value); + } + + return this; + } + /** + * <code>.context.SliceId slice_id = 2;</code> + */ + public Builder setSliceId( + context.ContextOuterClass.SliceId.Builder builderForValue) { + if (sliceIdBuilder_ == null) { + sliceId_ = builderForValue.build(); + onChanged(); + } else { + sliceIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * <code>.context.SliceId slice_id = 2;</code> + */ + public Builder mergeSliceId(context.ContextOuterClass.SliceId value) { + if (sliceIdBuilder_ == null) { + if (sliceId_ != null) { + sliceId_ = + context.ContextOuterClass.SliceId.newBuilder(sliceId_).mergeFrom(value).buildPartial(); + } else { + sliceId_ = value; + } + onChanged(); + } else { + sliceIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * <code>.context.SliceId slice_id = 2;</code> + */ + public Builder clearSliceId() { + if (sliceIdBuilder_ == null) { + sliceId_ = null; + onChanged(); + } else { + sliceId_ = null; + sliceIdBuilder_ = null; + } + + return this; + } + /** + * <code>.context.SliceId slice_id = 2;</code> + */ + public context.ContextOuterClass.SliceId.Builder getSliceIdBuilder() { + + onChanged(); + return getSliceIdFieldBuilder().getBuilder(); + } + /** + * <code>.context.SliceId slice_id = 2;</code> + */ + public context.ContextOuterClass.SliceIdOrBuilder getSliceIdOrBuilder() { + if (sliceIdBuilder_ != null) { + return sliceIdBuilder_.getMessageOrBuilder(); + } else { + return sliceId_ == null ? + context.ContextOuterClass.SliceId.getDefaultInstance() : sliceId_; + } + } + /** + * <code>.context.SliceId slice_id = 2;</code> + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> + getSliceIdFieldBuilder() { + if (sliceIdBuilder_ == null) { + sliceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder>( + getSliceId(), + getParentForChildren(), + isClean()); + sliceId_ = null; + } + return sliceIdBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:context.SliceEvent) + } + + // @@protoc_insertion_point(class_scope:context.SliceEvent) + private static final context.ContextOuterClass.SliceEvent DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.SliceEvent(); + } + + public static context.ContextOuterClass.SliceEvent getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<SliceEvent> + PARSER = new com.google.protobuf.AbstractParser<SliceEvent>() { + @java.lang.Override + public SliceEvent parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SliceEvent(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<SliceEvent> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<SliceEvent> getParserForType() { + return PARSER; + } + + @java.lang.Override + public context.ContextOuterClass.SliceEvent getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ConnectionIdOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ConnectionId) + com.google.protobuf.MessageOrBuilder { + + /** + * <code>.context.Uuid connection_uuid = 1;</code> + * @return Whether the connectionUuid field is set. + */ + boolean hasConnectionUuid(); + /** + * <code>.context.Uuid connection_uuid = 1;</code> + * @return The connectionUuid. + */ + context.ContextOuterClass.Uuid getConnectionUuid(); + /** + * <code>.context.Uuid connection_uuid = 1;</code> + */ + context.ContextOuterClass.UuidOrBuilder getConnectionUuidOrBuilder(); + } + /** + * <pre> + * ----- Connection ---------------------------------------------------------------------------------------------------- + * </pre> + * + * Protobuf type {@code context.ConnectionId} + */ + public static final class ConnectionId extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.ConnectionId) + ConnectionIdOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConnectionId.newBuilder() to construct. + private ConnectionId(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private ConnectionId() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ConnectionId(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ConnectionId( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + context.ContextOuterClass.Uuid.Builder subBuilder = null; + if (connectionUuid_ != null) { + subBuilder = connectionUuid_.toBuilder(); + } + connectionUuid_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(connectionUuid_); + connectionUuid_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_ConnectionId_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ConnectionId_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ConnectionId.class, context.ContextOuterClass.ConnectionId.Builder.class); + } + + public static final int CONNECTION_UUID_FIELD_NUMBER = 1; + private context.ContextOuterClass.Uuid connectionUuid_; + /** + * <code>.context.Uuid connection_uuid = 1;</code> + * @return Whether the connectionUuid field is set. + */ + @java.lang.Override + public boolean hasConnectionUuid() { + return connectionUuid_ != null; + } + /** + * <code>.context.Uuid connection_uuid = 1;</code> + * @return The connectionUuid. + */ + @java.lang.Override + public context.ContextOuterClass.Uuid getConnectionUuid() { + return connectionUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : connectionUuid_; + } + /** + * <code>.context.Uuid connection_uuid = 1;</code> + */ + @java.lang.Override + public context.ContextOuterClass.UuidOrBuilder getConnectionUuidOrBuilder() { + return getConnectionUuid(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (connectionUuid_ != null) { + output.writeMessage(1, getConnectionUuid()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (connectionUuid_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getConnectionUuid()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof context.ContextOuterClass.ConnectionId)) { + return super.equals(obj); + } + context.ContextOuterClass.ConnectionId other = (context.ContextOuterClass.ConnectionId) obj; + + if (hasConnectionUuid() != other.hasConnectionUuid()) return false; + if (hasConnectionUuid()) { + if (!getConnectionUuid() + .equals(other.getConnectionUuid())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasConnectionUuid()) { + hash = (37 * hash) + CONNECTION_UUID_FIELD_NUMBER; + hash = (53 * hash) + getConnectionUuid().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.ConnectionId parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ConnectionId parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ConnectionId parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ConnectionId parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ConnectionId parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ConnectionId parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ConnectionId parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ConnectionId parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static context.ContextOuterClass.ConnectionId parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ConnectionId parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static context.ContextOuterClass.ConnectionId parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ConnectionId parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(context.ContextOuterClass.ConnectionId prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * <pre> + * ----- Connection ---------------------------------------------------------------------------------------------------- + * </pre> + * + * Protobuf type {@code context.ConnectionId} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:context.ConnectionId) + context.ContextOuterClass.ConnectionIdOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_ConnectionId_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ConnectionId_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ConnectionId.class, context.ContextOuterClass.ConnectionId.Builder.class); + } + + // Construct using context.ContextOuterClass.ConnectionId.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (connectionUuidBuilder_ == null) { + connectionUuid_ = null; + } else { + connectionUuid_ = null; + connectionUuidBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_ConnectionId_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.ConnectionId getDefaultInstanceForType() { + return context.ContextOuterClass.ConnectionId.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.ConnectionId build() { + context.ContextOuterClass.ConnectionId result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.ConnectionId buildPartial() { + context.ContextOuterClass.ConnectionId result = new context.ContextOuterClass.ConnectionId(this); + if (connectionUuidBuilder_ == null) { + result.connectionUuid_ = connectionUuid_; + } else { + result.connectionUuid_ = connectionUuidBuilder_.build(); } onBuilt(); return result; @@ -37615,6 +43832,36 @@ public final class ContextOuterClass { private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_context_ServiceEvent_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_SliceId_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_SliceId_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_Slice_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_Slice_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_SliceStatus_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_SliceStatus_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_SliceIdList_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_SliceIdList_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_SliceList_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_SliceList_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_SliceEvent_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_SliceEvent_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_context_ConnectionId_descriptor; private static final @@ -37744,107 +43991,134 @@ public final class ContextOuterClass { "\"\n\010services\030\001 \003(\0132\020.context.Service\"U\n\014S" + "erviceEvent\022\035\n\005event\030\001 \001(\0132\016.context.Eve" + "nt\022&\n\nservice_id\030\002 \001(\0132\022.context.Service" + - "Id\"6\n\014ConnectionId\022&\n\017connection_uuid\030\001 " + - "\001(\0132\r.context.Uuid\"\304\001\n\nConnection\022,\n\rcon" + - "nection_id\030\001 \001(\0132\025.context.ConnectionId\022" + - "&\n\nservice_id\030\002 \001(\0132\022.context.ServiceId\022" + - "3\n\026path_hops_endpoint_ids\030\003 \003(\0132\023.contex" + - "t.EndPointId\022+\n\017sub_service_ids\030\004 \003(\0132\022." + - "context.ServiceId\"A\n\020ConnectionIdList\022-\n" + - "\016connection_ids\030\001 \003(\0132\025.context.Connecti" + - "onId\":\n\016ConnectionList\022(\n\013connections\030\001 " + - "\003(\0132\023.context.Connection\"^\n\017ConnectionEv" + - "ent\022\035\n\005event\030\001 \001(\0132\016.context.Event\022,\n\rco" + - "nnection_id\030\002 \001(\0132\025.context.ConnectionId" + - "\"\202\001\n\nEndPointId\022(\n\013topology_id\030\001 \001(\0132\023.c" + - "ontext.TopologyId\022$\n\tdevice_id\030\002 \001(\0132\021.c" + - "ontext.DeviceId\022$\n\rendpoint_uuid\030\003 \001(\0132\r" + - ".context.Uuid\"\206\001\n\010EndPoint\022(\n\013endpoint_i" + - "d\030\001 \001(\0132\023.context.EndPointId\022\025\n\rendpoint" + - "_type\030\002 \001(\t\0229\n\020kpi_sample_types\030\003 \003(\0162\037." + - "kpi_sample_types.KpiSampleType\"e\n\nConfig" + - "Rule\022)\n\006action\030\001 \001(\0162\031.context.ConfigAct" + - "ionEnum\022\024\n\014resource_key\030\002 \001(\t\022\026\n\016resourc" + - "e_value\030\003 \001(\t\"?\n\nConstraint\022\027\n\017constrain" + - "t_type\030\001 \001(\t\022\030\n\020constraint_value\030\002 \001(\t\"^" + - "\n\022TeraFlowController\022&\n\ncontext_id\030\001 \001(\013" + - "2\022.context.ContextId\022\022\n\nip_address\030\002 \001(\t" + - "\022\014\n\004port\030\003 \001(\r\"U\n\024AuthenticationResult\022&" + - "\n\ncontext_id\030\001 \001(\0132\022.context.ContextId\022\025" + - "\n\rauthenticated\030\002 \001(\010*j\n\rEventTypeEnum\022\027" + - "\n\023EVENTTYPE_UNDEFINED\020\000\022\024\n\020EVENTTYPE_CRE" + - "ATE\020\001\022\024\n\020EVENTTYPE_UPDATE\020\002\022\024\n\020EVENTTYPE" + - "_REMOVE\020\003*\305\001\n\020DeviceDriverEnum\022\032\n\026DEVICE" + - "DRIVER_UNDEFINED\020\000\022\033\n\027DEVICEDRIVER_OPENC" + - "ONFIG\020\001\022\036\n\032DEVICEDRIVER_TRANSPORT_API\020\002\022" + - "\023\n\017DEVICEDRIVER_P4\020\003\022&\n\"DEVICEDRIVER_IET" + - "F_NETWORK_TOPOLOGY\020\004\022\033\n\027DEVICEDRIVER_ONF" + - "_TR_352\020\005*\217\001\n\033DeviceOperationalStatusEnu" + - "m\022%\n!DEVICEOPERATIONALSTATUS_UNDEFINED\020\000" + - "\022$\n DEVICEOPERATIONALSTATUS_DISABLED\020\001\022#" + - "\n\037DEVICEOPERATIONALSTATUS_ENABLED\020\002*\201\001\n\017" + - "ServiceTypeEnum\022\027\n\023SERVICETYPE_UNKNOWN\020\000" + - "\022\024\n\020SERVICETYPE_L3NM\020\001\022\024\n\020SERVICETYPE_L2" + - "NM\020\002\022)\n%SERVICETYPE_TAPI_CONNECTIVITY_SE" + - "RVICE\020\003*\210\001\n\021ServiceStatusEnum\022\033\n\027SERVICE" + - "STATUS_UNDEFINED\020\000\022\031\n\025SERVICESTATUS_PLAN" + - "NED\020\001\022\030\n\024SERVICESTATUS_ACTIVE\020\002\022!\n\035SERVI" + - "CESTATUS_PENDING_REMOVAL\020\003*]\n\020ConfigActi" + - "onEnum\022\032\n\026CONFIGACTION_UNDEFINED\020\000\022\024\n\020CO" + - "NFIGACTION_SET\020\001\022\027\n\023CONFIGACTION_DELETE\020" + - "\0022\255\020\n\016ContextService\022:\n\016ListContextIds\022\016" + - ".context.Empty\032\026.context.ContextIdList\"\000" + - "\0226\n\014ListContexts\022\016.context.Empty\032\024.conte" + - "xt.ContextList\"\000\0224\n\nGetContext\022\022.context" + - ".ContextId\032\020.context.Context\"\000\0224\n\nSetCon" + - "text\022\020.context.Context\032\022.context.Context" + - "Id\"\000\0225\n\rRemoveContext\022\022.context.ContextI" + - "d\032\016.context.Empty\"\000\022=\n\020GetContextEvents\022" + - "\016.context.Empty\032\025.context.ContextEvent\"\000" + - "0\001\022@\n\017ListTopologyIds\022\022.context.ContextI" + - "d\032\027.context.TopologyIdList\"\000\022=\n\016ListTopo" + - "logies\022\022.context.ContextId\032\025.context.Top" + - "ologyList\"\000\0227\n\013GetTopology\022\023.context.Top" + - "ologyId\032\021.context.Topology\"\000\0227\n\013SetTopol" + - "ogy\022\021.context.Topology\032\023.context.Topolog" + - "yId\"\000\0227\n\016RemoveTopology\022\023.context.Topolo" + - "gyId\032\016.context.Empty\"\000\022?\n\021GetTopologyEve" + - "nts\022\016.context.Empty\032\026.context.TopologyEv" + - "ent\"\0000\001\0228\n\rListDeviceIds\022\016.context.Empty" + - "\032\025.context.DeviceIdList\"\000\0224\n\013ListDevices" + - "\022\016.context.Empty\032\023.context.DeviceList\"\000\022" + - "1\n\tGetDevice\022\021.context.DeviceId\032\017.contex" + - "t.Device\"\000\0221\n\tSetDevice\022\017.context.Device" + - "\032\021.context.DeviceId\"\000\0223\n\014RemoveDevice\022\021." + - "context.DeviceId\032\016.context.Empty\"\000\022;\n\017Ge" + - "tDeviceEvents\022\016.context.Empty\032\024.context." + - "DeviceEvent\"\0000\001\0224\n\013ListLinkIds\022\016.context" + - ".Empty\032\023.context.LinkIdList\"\000\0220\n\tListLin" + - "ks\022\016.context.Empty\032\021.context.LinkList\"\000\022" + - "+\n\007GetLink\022\017.context.LinkId\032\r.context.Li" + - "nk\"\000\022+\n\007SetLink\022\r.context.Link\032\017.context" + - ".LinkId\"\000\022/\n\nRemoveLink\022\017.context.LinkId" + - "\032\016.context.Empty\"\000\0227\n\rGetLinkEvents\022\016.co" + - "ntext.Empty\032\022.context.LinkEvent\"\0000\001\022>\n\016L" + - "istServiceIds\022\022.context.ContextId\032\026.cont" + - "ext.ServiceIdList\"\000\022:\n\014ListServices\022\022.co" + - "ntext.ContextId\032\024.context.ServiceList\"\000\022" + - "4\n\nGetService\022\022.context.ServiceId\032\020.cont" + - "ext.Service\"\000\0224\n\nSetService\022\020.context.Se" + - "rvice\032\022.context.ServiceId\"\000\0225\n\rRemoveSer" + - "vice\022\022.context.ServiceId\032\016.context.Empty" + - "\"\000\022=\n\020GetServiceEvents\022\016.context.Empty\032\025" + - ".context.ServiceEvent\"\0000\001\022D\n\021ListConnect" + - "ionIds\022\022.context.ServiceId\032\031.context.Con" + - "nectionIdList\"\000\022@\n\017ListConnections\022\022.con" + - "text.ServiceId\032\027.context.ConnectionList\"" + - "\000\022=\n\rGetConnection\022\025.context.ConnectionI" + - "d\032\023.context.Connection\"\000\022=\n\rSetConnectio" + - "n\022\023.context.Connection\032\025.context.Connect" + - "ionId\"\000\022;\n\020RemoveConnection\022\025.context.Co" + - "nnectionId\032\016.context.Empty\"\000\022C\n\023GetConne" + - "ctionEvents\022\016.context.Empty\032\030.context.Co" + - "nnectionEvent\"\0000\001b\006proto3" + "Id\"T\n\007SliceId\022&\n\ncontext_id\030\001 \001(\0132\022.cont" + + "ext.ContextId\022!\n\nslice_uuid\030\002 \001(\0132\r.cont" + + "ext.Uuid\"\225\002\n\005Slice\022\"\n\010slice_id\030\001 \001(\0132\020.c" + + "ontext.SliceId\022/\n\022slice_endpoint_ids\030\002 \003" + + "(\0132\023.context.EndPointId\022.\n\021slice_constra" + + "ints\030\003 \003(\0132\023.context.Constraint\022-\n\021slice" + + "_service_ids\030\004 \003(\0132\022.context.ServiceId\022," + + "\n\022slice_subslice_ids\030\005 \003(\0132\020.context.Sli" + + "ceId\022*\n\014slice_status\030\006 \001(\0132\024.context.Sli" + + "ceStatus\"=\n\013SliceStatus\022.\n\014slice_status\030" + + "\001 \001(\0162\030.context.SliceStatusEnum\"2\n\013Slice" + + "IdList\022#\n\tslice_ids\030\001 \003(\0132\020.context.Slic" + + "eId\"+\n\tSliceList\022\036\n\006slices\030\001 \003(\0132\016.conte" + + "xt.Slice\"O\n\nSliceEvent\022\035\n\005event\030\001 \001(\0132\016." + + "context.Event\022\"\n\010slice_id\030\002 \001(\0132\020.contex" + + "t.SliceId\"6\n\014ConnectionId\022&\n\017connection_" + + "uuid\030\001 \001(\0132\r.context.Uuid\"\304\001\n\nConnection" + + "\022,\n\rconnection_id\030\001 \001(\0132\025.context.Connec" + + "tionId\022&\n\nservice_id\030\002 \001(\0132\022.context.Ser" + + "viceId\0223\n\026path_hops_endpoint_ids\030\003 \003(\0132\023" + + ".context.EndPointId\022+\n\017sub_service_ids\030\004" + + " \003(\0132\022.context.ServiceId\"A\n\020ConnectionId" + + "List\022-\n\016connection_ids\030\001 \003(\0132\025.context.C" + + "onnectionId\":\n\016ConnectionList\022(\n\013connect" + + "ions\030\001 \003(\0132\023.context.Connection\"^\n\017Conne" + + "ctionEvent\022\035\n\005event\030\001 \001(\0132\016.context.Even" + + "t\022,\n\rconnection_id\030\002 \001(\0132\025.context.Conne" + + "ctionId\"\202\001\n\nEndPointId\022(\n\013topology_id\030\001 " + + "\001(\0132\023.context.TopologyId\022$\n\tdevice_id\030\002 " + + "\001(\0132\021.context.DeviceId\022$\n\rendpoint_uuid\030" + + "\003 \001(\0132\r.context.Uuid\"\206\001\n\010EndPoint\022(\n\013end" + + "point_id\030\001 \001(\0132\023.context.EndPointId\022\025\n\re" + + "ndpoint_type\030\002 \001(\t\0229\n\020kpi_sample_types\030\003" + + " \003(\0162\037.kpi_sample_types.KpiSampleType\"e\n" + + "\nConfigRule\022)\n\006action\030\001 \001(\0162\031.context.Co" + + "nfigActionEnum\022\024\n\014resource_key\030\002 \001(\t\022\026\n\016" + + "resource_value\030\003 \001(\t\"?\n\nConstraint\022\027\n\017co" + + "nstraint_type\030\001 \001(\t\022\030\n\020constraint_value\030" + + "\002 \001(\t\"^\n\022TeraFlowController\022&\n\ncontext_i" + + "d\030\001 \001(\0132\022.context.ContextId\022\022\n\nip_addres" + + "s\030\002 \001(\t\022\014\n\004port\030\003 \001(\r\"U\n\024AuthenticationR" + + "esult\022&\n\ncontext_id\030\001 \001(\0132\022.context.Cont" + + "extId\022\025\n\rauthenticated\030\002 \001(\010*j\n\rEventTyp" + + "eEnum\022\027\n\023EVENTTYPE_UNDEFINED\020\000\022\024\n\020EVENTT" + + "YPE_CREATE\020\001\022\024\n\020EVENTTYPE_UPDATE\020\002\022\024\n\020EV" + + "ENTTYPE_REMOVE\020\003*\305\001\n\020DeviceDriverEnum\022\032\n" + + "\026DEVICEDRIVER_UNDEFINED\020\000\022\033\n\027DEVICEDRIVE" + + "R_OPENCONFIG\020\001\022\036\n\032DEVICEDRIVER_TRANSPORT" + + "_API\020\002\022\023\n\017DEVICEDRIVER_P4\020\003\022&\n\"DEVICEDRI" + + "VER_IETF_NETWORK_TOPOLOGY\020\004\022\033\n\027DEVICEDRI" + + "VER_ONF_TR_352\020\005*\217\001\n\033DeviceOperationalSt" + + "atusEnum\022%\n!DEVICEOPERATIONALSTATUS_UNDE" + + "FINED\020\000\022$\n DEVICEOPERATIONALSTATUS_DISAB" + + "LED\020\001\022#\n\037DEVICEOPERATIONALSTATUS_ENABLED" + + "\020\002*\201\001\n\017ServiceTypeEnum\022\027\n\023SERVICETYPE_UN" + + "KNOWN\020\000\022\024\n\020SERVICETYPE_L3NM\020\001\022\024\n\020SERVICE" + + "TYPE_L2NM\020\002\022)\n%SERVICETYPE_TAPI_CONNECTI" + + "VITY_SERVICE\020\003*\210\001\n\021ServiceStatusEnum\022\033\n\027" + + "SERVICESTATUS_UNDEFINED\020\000\022\031\n\025SERVICESTAT" + + "US_PLANNED\020\001\022\030\n\024SERVICESTATUS_ACTIVE\020\002\022!" + + "\n\035SERVICESTATUS_PENDING_REMOVAL\020\003*\213\001\n\017Sl" + + "iceStatusEnum\022\031\n\025SLICESTATUS_UNDEFINED\020\000" + + "\022\027\n\023SLICESTATUS_PLANNED\020\001\022\024\n\020SLICESTATUS" + + "_INIT\020\002\022\026\n\022SLICESTATUS_ACTIVE\020\003\022\026\n\022SLICE" + + "STATUS_DEINIT\020\004*]\n\020ConfigActionEnum\022\032\n\026C" + + "ONFIGACTION_UNDEFINED\020\000\022\024\n\020CONFIGACTION_" + + "SET\020\001\022\027\n\023CONFIGACTION_DELETE\020\0022\357\022\n\016Conte" + + "xtService\022:\n\016ListContextIds\022\016.context.Em" + + "pty\032\026.context.ContextIdList\"\000\0226\n\014ListCon" + + "texts\022\016.context.Empty\032\024.context.ContextL" + + "ist\"\000\0224\n\nGetContext\022\022.context.ContextId\032" + + "\020.context.Context\"\000\0224\n\nSetContext\022\020.cont" + + "ext.Context\032\022.context.ContextId\"\000\0225\n\rRem" + + "oveContext\022\022.context.ContextId\032\016.context" + + ".Empty\"\000\022=\n\020GetContextEvents\022\016.context.E" + + "mpty\032\025.context.ContextEvent\"\0000\001\022@\n\017ListT" + + "opologyIds\022\022.context.ContextId\032\027.context" + + ".TopologyIdList\"\000\022=\n\016ListTopologies\022\022.co" + + "ntext.ContextId\032\025.context.TopologyList\"\000" + + "\0227\n\013GetTopology\022\023.context.TopologyId\032\021.c" + + "ontext.Topology\"\000\0227\n\013SetTopology\022\021.conte" + + "xt.Topology\032\023.context.TopologyId\"\000\0227\n\016Re" + + "moveTopology\022\023.context.TopologyId\032\016.cont" + + "ext.Empty\"\000\022?\n\021GetTopologyEvents\022\016.conte" + + "xt.Empty\032\026.context.TopologyEvent\"\0000\001\0228\n\r" + + "ListDeviceIds\022\016.context.Empty\032\025.context." + + "DeviceIdList\"\000\0224\n\013ListDevices\022\016.context." + + "Empty\032\023.context.DeviceList\"\000\0221\n\tGetDevic" + + "e\022\021.context.DeviceId\032\017.context.Device\"\000\022" + + "1\n\tSetDevice\022\017.context.Device\032\021.context." + + "DeviceId\"\000\0223\n\014RemoveDevice\022\021.context.Dev" + + "iceId\032\016.context.Empty\"\000\022;\n\017GetDeviceEven" + + "ts\022\016.context.Empty\032\024.context.DeviceEvent" + + "\"\0000\001\0224\n\013ListLinkIds\022\016.context.Empty\032\023.co" + + "ntext.LinkIdList\"\000\0220\n\tListLinks\022\016.contex" + + "t.Empty\032\021.context.LinkList\"\000\022+\n\007GetLink\022" + + "\017.context.LinkId\032\r.context.Link\"\000\022+\n\007Set" + + "Link\022\r.context.Link\032\017.context.LinkId\"\000\022/" + + "\n\nRemoveLink\022\017.context.LinkId\032\016.context." + + "Empty\"\000\0227\n\rGetLinkEvents\022\016.context.Empty" + + "\032\022.context.LinkEvent\"\0000\001\022>\n\016ListServiceI" + + "ds\022\022.context.ContextId\032\026.context.Service" + + "IdList\"\000\022:\n\014ListServices\022\022.context.Conte" + + "xtId\032\024.context.ServiceList\"\000\0224\n\nGetServi" + + "ce\022\022.context.ServiceId\032\020.context.Service" + + "\"\000\0224\n\nSetService\022\020.context.Service\032\022.con" + + "text.ServiceId\"\000\0225\n\rRemoveService\022\022.cont" + + "ext.ServiceId\032\016.context.Empty\"\000\022=\n\020GetSe" + + "rviceEvents\022\016.context.Empty\032\025.context.Se" + + "rviceEvent\"\0000\001\022:\n\014ListSliceIds\022\022.context" + + ".ContextId\032\024.context.SliceIdList\"\000\0226\n\nLi" + + "stSlices\022\022.context.ContextId\032\022.context.S" + + "liceList\"\000\022.\n\010GetSlice\022\020.context.SliceId" + + "\032\016.context.Slice\"\000\022.\n\010SetSlice\022\016.context" + + ".Slice\032\020.context.SliceId\"\000\0221\n\013RemoveSlic" + + "e\022\020.context.SliceId\032\016.context.Empty\"\000\0229\n" + + "\016GetSliceEvents\022\016.context.Empty\032\023.contex" + + "t.SliceEvent\"\0000\001\022D\n\021ListConnectionIds\022\022." + + "context.ServiceId\032\031.context.ConnectionId" + + "List\"\000\022@\n\017ListConnections\022\022.context.Serv" + + "iceId\032\027.context.ConnectionList\"\000\022=\n\rGetC" + + "onnection\022\025.context.ConnectionId\032\023.conte" + + "xt.Connection\"\000\022=\n\rSetConnection\022\023.conte" + + "xt.Connection\032\025.context.ConnectionId\"\000\022;" + + "\n\020RemoveConnection\022\025.context.ConnectionI" + + "d\032\016.context.Empty\"\000\022C\n\023GetConnectionEven" + + "ts\022\016.context.Empty\032\030.context.ConnectionE" + + "vent\"\0000\001b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -38037,68 +44311,104 @@ public final class ContextOuterClass { com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ServiceEvent_descriptor, new java.lang.String[] { "Event", "ServiceId", }); - internal_static_context_ConnectionId_descriptor = + internal_static_context_SliceId_descriptor = getDescriptor().getMessageTypes().get(31); + internal_static_context_SliceId_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_SliceId_descriptor, + new java.lang.String[] { "ContextId", "SliceUuid", }); + internal_static_context_Slice_descriptor = + getDescriptor().getMessageTypes().get(32); + internal_static_context_Slice_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_Slice_descriptor, + new java.lang.String[] { "SliceId", "SliceEndpointIds", "SliceConstraints", "SliceServiceIds", "SliceSubsliceIds", "SliceStatus", }); + internal_static_context_SliceStatus_descriptor = + getDescriptor().getMessageTypes().get(33); + internal_static_context_SliceStatus_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_SliceStatus_descriptor, + new java.lang.String[] { "SliceStatus", }); + internal_static_context_SliceIdList_descriptor = + getDescriptor().getMessageTypes().get(34); + internal_static_context_SliceIdList_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_SliceIdList_descriptor, + new java.lang.String[] { "SliceIds", }); + internal_static_context_SliceList_descriptor = + getDescriptor().getMessageTypes().get(35); + internal_static_context_SliceList_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_SliceList_descriptor, + new java.lang.String[] { "Slices", }); + internal_static_context_SliceEvent_descriptor = + getDescriptor().getMessageTypes().get(36); + internal_static_context_SliceEvent_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_SliceEvent_descriptor, + new java.lang.String[] { "Event", "SliceId", }); + internal_static_context_ConnectionId_descriptor = + getDescriptor().getMessageTypes().get(37); internal_static_context_ConnectionId_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ConnectionId_descriptor, new java.lang.String[] { "ConnectionUuid", }); internal_static_context_Connection_descriptor = - getDescriptor().getMessageTypes().get(32); + getDescriptor().getMessageTypes().get(38); internal_static_context_Connection_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Connection_descriptor, new java.lang.String[] { "ConnectionId", "ServiceId", "PathHopsEndpointIds", "SubServiceIds", }); internal_static_context_ConnectionIdList_descriptor = - getDescriptor().getMessageTypes().get(33); + getDescriptor().getMessageTypes().get(39); internal_static_context_ConnectionIdList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ConnectionIdList_descriptor, new java.lang.String[] { "ConnectionIds", }); internal_static_context_ConnectionList_descriptor = - getDescriptor().getMessageTypes().get(34); + getDescriptor().getMessageTypes().get(40); internal_static_context_ConnectionList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ConnectionList_descriptor, new java.lang.String[] { "Connections", }); internal_static_context_ConnectionEvent_descriptor = - getDescriptor().getMessageTypes().get(35); + getDescriptor().getMessageTypes().get(41); internal_static_context_ConnectionEvent_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ConnectionEvent_descriptor, new java.lang.String[] { "Event", "ConnectionId", }); internal_static_context_EndPointId_descriptor = - getDescriptor().getMessageTypes().get(36); + getDescriptor().getMessageTypes().get(42); internal_static_context_EndPointId_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_EndPointId_descriptor, new java.lang.String[] { "TopologyId", "DeviceId", "EndpointUuid", }); internal_static_context_EndPoint_descriptor = - getDescriptor().getMessageTypes().get(37); + getDescriptor().getMessageTypes().get(43); internal_static_context_EndPoint_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_EndPoint_descriptor, new java.lang.String[] { "EndpointId", "EndpointType", "KpiSampleTypes", }); internal_static_context_ConfigRule_descriptor = - getDescriptor().getMessageTypes().get(38); + getDescriptor().getMessageTypes().get(44); internal_static_context_ConfigRule_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ConfigRule_descriptor, new java.lang.String[] { "Action", "ResourceKey", "ResourceValue", }); internal_static_context_Constraint_descriptor = - getDescriptor().getMessageTypes().get(39); + getDescriptor().getMessageTypes().get(45); internal_static_context_Constraint_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Constraint_descriptor, new java.lang.String[] { "ConstraintType", "ConstraintValue", }); internal_static_context_TeraFlowController_descriptor = - getDescriptor().getMessageTypes().get(40); + getDescriptor().getMessageTypes().get(46); internal_static_context_TeraFlowController_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_TeraFlowController_descriptor, new java.lang.String[] { "ContextId", "IpAddress", "Port", }); internal_static_context_AuthenticationResult_descriptor = - getDescriptor().getMessageTypes().get(41); + getDescriptor().getMessageTypes().get(47); internal_static_context_AuthenticationResult_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_AuthenticationResult_descriptor, diff --git a/src/policy/target/generated-sources/grpc/context/ContextService.java b/src/policy/target/generated-sources/grpc/context/ContextService.java index cbd51163f340212839e0eeb2ad096032fdba8109..d54c56057ca53e40071490d3b9aa313a13a77665 100644 --- a/src/policy/target/generated-sources/grpc/context/ContextService.java +++ b/src/policy/target/generated-sources/grpc/context/ContextService.java @@ -58,6 +58,16 @@ public interface ContextService extends MutinyService { io.smallrye.mutiny.Uni<context.ContextOuterClass.Empty> removeService(context.ContextOuterClass.ServiceId request); + io.smallrye.mutiny.Uni<context.ContextOuterClass.SliceIdList> listSliceIds(context.ContextOuterClass.ContextId request); + + io.smallrye.mutiny.Uni<context.ContextOuterClass.SliceList> listSlices(context.ContextOuterClass.ContextId request); + + io.smallrye.mutiny.Uni<context.ContextOuterClass.Slice> getSlice(context.ContextOuterClass.SliceId request); + + io.smallrye.mutiny.Uni<context.ContextOuterClass.SliceId> setSlice(context.ContextOuterClass.Slice request); + + io.smallrye.mutiny.Uni<context.ContextOuterClass.Empty> removeSlice(context.ContextOuterClass.SliceId request); + io.smallrye.mutiny.Uni<context.ContextOuterClass.ConnectionIdList> listConnectionIds(context.ContextOuterClass.ServiceId request); io.smallrye.mutiny.Uni<context.ContextOuterClass.ConnectionList> listConnections(context.ContextOuterClass.ServiceId request); @@ -79,6 +89,8 @@ public interface ContextService extends MutinyService { io.smallrye.mutiny.Multi<context.ContextOuterClass.ServiceEvent> getServiceEvents(context.ContextOuterClass.Empty request); + io.smallrye.mutiny.Multi<context.ContextOuterClass.SliceEvent> getSliceEvents(context.ContextOuterClass.Empty request); + io.smallrye.mutiny.Multi<context.ContextOuterClass.ConnectionEvent> getConnectionEvents(context.ContextOuterClass.Empty request); diff --git a/src/policy/target/generated-sources/grpc/context/ContextServiceBean.java b/src/policy/target/generated-sources/grpc/context/ContextServiceBean.java index 6900cf3c8a09ad6e3df1aaf2cc403c32490d3289..f552294b8e6d645af41cc30632ae0432504bbc67 100644 --- a/src/policy/target/generated-sources/grpc/context/ContextServiceBean.java +++ b/src/policy/target/generated-sources/grpc/context/ContextServiceBean.java @@ -216,6 +216,46 @@ public class ContextServiceBean extends MutinyContextServiceGrpc.ContextServiceI } } @Override + public io.smallrye.mutiny.Uni<context.ContextOuterClass.SliceIdList> listSliceIds(context.ContextOuterClass.ContextId request) { + try { + return delegate.listSliceIds(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni<context.ContextOuterClass.SliceList> listSlices(context.ContextOuterClass.ContextId request) { + try { + return delegate.listSlices(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni<context.ContextOuterClass.Slice> getSlice(context.ContextOuterClass.SliceId request) { + try { + return delegate.getSlice(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni<context.ContextOuterClass.SliceId> setSlice(context.ContextOuterClass.Slice request) { + try { + return delegate.setSlice(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni<context.ContextOuterClass.Empty> removeSlice(context.ContextOuterClass.SliceId request) { + try { + return delegate.removeSlice(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override public io.smallrye.mutiny.Uni<context.ContextOuterClass.ConnectionIdList> listConnectionIds(context.ContextOuterClass.ServiceId request) { try { return delegate.listConnectionIds(request); @@ -301,6 +341,15 @@ public class ContextServiceBean extends MutinyContextServiceGrpc.ContextServiceI } } + @Override + public io.smallrye.mutiny.Multi<context.ContextOuterClass.SliceEvent> getSliceEvents(context.ContextOuterClass.Empty request) { + try { + return delegate.getSliceEvents(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override public io.smallrye.mutiny.Multi<context.ContextOuterClass.ConnectionEvent> getConnectionEvents(context.ContextOuterClass.Empty request) { try { diff --git a/src/policy/target/generated-sources/grpc/context/ContextServiceClient.java b/src/policy/target/generated-sources/grpc/context/ContextServiceClient.java index a3d74cb7dfce2b3ffd259570a6dc65699f85f0cc..c6493bd4d381967238e5eb87dd717f679d028526 100644 --- a/src/policy/target/generated-sources/grpc/context/ContextServiceClient.java +++ b/src/policy/target/generated-sources/grpc/context/ContextServiceClient.java @@ -121,6 +121,26 @@ public class ContextServiceClient implements ContextService, MutinyClient<Mutiny return stub.removeService(request); } @Override + public io.smallrye.mutiny.Uni<context.ContextOuterClass.SliceIdList> listSliceIds(context.ContextOuterClass.ContextId request) { + return stub.listSliceIds(request); + } + @Override + public io.smallrye.mutiny.Uni<context.ContextOuterClass.SliceList> listSlices(context.ContextOuterClass.ContextId request) { + return stub.listSlices(request); + } + @Override + public io.smallrye.mutiny.Uni<context.ContextOuterClass.Slice> getSlice(context.ContextOuterClass.SliceId request) { + return stub.getSlice(request); + } + @Override + public io.smallrye.mutiny.Uni<context.ContextOuterClass.SliceId> setSlice(context.ContextOuterClass.Slice request) { + return stub.setSlice(request); + } + @Override + public io.smallrye.mutiny.Uni<context.ContextOuterClass.Empty> removeSlice(context.ContextOuterClass.SliceId request) { + return stub.removeSlice(request); + } + @Override public io.smallrye.mutiny.Uni<context.ContextOuterClass.ConnectionIdList> listConnectionIds(context.ContextOuterClass.ServiceId request) { return stub.listConnectionIds(request); } @@ -166,6 +186,11 @@ public class ContextServiceClient implements ContextService, MutinyClient<Mutiny return stub.getServiceEvents(request); } + @Override + public io.smallrye.mutiny.Multi<context.ContextOuterClass.SliceEvent> getSliceEvents(context.ContextOuterClass.Empty request) { + return stub.getSliceEvents(request); + } + @Override public io.smallrye.mutiny.Multi<context.ContextOuterClass.ConnectionEvent> getConnectionEvents(context.ContextOuterClass.Empty request) { return stub.getConnectionEvents(request); diff --git a/src/policy/target/generated-sources/grpc/context/ContextServiceGrpc.java b/src/policy/target/generated-sources/grpc/context/ContextServiceGrpc.java index be9f381ffee96febd202beb540bce862c1347378..be720c127439e50f68c2518332f85f750d6579ee 100644 --- a/src/policy/target/generated-sources/grpc/context/ContextServiceGrpc.java +++ b/src/policy/target/generated-sources/grpc/context/ContextServiceGrpc.java @@ -944,6 +944,192 @@ public final class ContextServiceGrpc { return getGetServiceEventsMethod; } + private static volatile io.grpc.MethodDescriptor<context.ContextOuterClass.ContextId, + context.ContextOuterClass.SliceIdList> getListSliceIdsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListSliceIds", + requestType = context.ContextOuterClass.ContextId.class, + responseType = context.ContextOuterClass.SliceIdList.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor<context.ContextOuterClass.ContextId, + context.ContextOuterClass.SliceIdList> getListSliceIdsMethod() { + io.grpc.MethodDescriptor<context.ContextOuterClass.ContextId, context.ContextOuterClass.SliceIdList> getListSliceIdsMethod; + if ((getListSliceIdsMethod = ContextServiceGrpc.getListSliceIdsMethod) == null) { + synchronized (ContextServiceGrpc.class) { + if ((getListSliceIdsMethod = ContextServiceGrpc.getListSliceIdsMethod) == null) { + ContextServiceGrpc.getListSliceIdsMethod = getListSliceIdsMethod = + io.grpc.MethodDescriptor.<context.ContextOuterClass.ContextId, context.ContextOuterClass.SliceIdList>newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListSliceIds")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.ContextId.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.SliceIdList.getDefaultInstance())) + .setSchemaDescriptor(new ContextServiceMethodDescriptorSupplier("ListSliceIds")) + .build(); + } + } + } + return getListSliceIdsMethod; + } + + private static volatile io.grpc.MethodDescriptor<context.ContextOuterClass.ContextId, + context.ContextOuterClass.SliceList> getListSlicesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListSlices", + requestType = context.ContextOuterClass.ContextId.class, + responseType = context.ContextOuterClass.SliceList.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor<context.ContextOuterClass.ContextId, + context.ContextOuterClass.SliceList> getListSlicesMethod() { + io.grpc.MethodDescriptor<context.ContextOuterClass.ContextId, context.ContextOuterClass.SliceList> getListSlicesMethod; + if ((getListSlicesMethod = ContextServiceGrpc.getListSlicesMethod) == null) { + synchronized (ContextServiceGrpc.class) { + if ((getListSlicesMethod = ContextServiceGrpc.getListSlicesMethod) == null) { + ContextServiceGrpc.getListSlicesMethod = getListSlicesMethod = + io.grpc.MethodDescriptor.<context.ContextOuterClass.ContextId, context.ContextOuterClass.SliceList>newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListSlices")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.ContextId.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.SliceList.getDefaultInstance())) + .setSchemaDescriptor(new ContextServiceMethodDescriptorSupplier("ListSlices")) + .build(); + } + } + } + return getListSlicesMethod; + } + + private static volatile io.grpc.MethodDescriptor<context.ContextOuterClass.SliceId, + context.ContextOuterClass.Slice> getGetSliceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetSlice", + requestType = context.ContextOuterClass.SliceId.class, + responseType = context.ContextOuterClass.Slice.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor<context.ContextOuterClass.SliceId, + context.ContextOuterClass.Slice> getGetSliceMethod() { + io.grpc.MethodDescriptor<context.ContextOuterClass.SliceId, context.ContextOuterClass.Slice> getGetSliceMethod; + if ((getGetSliceMethod = ContextServiceGrpc.getGetSliceMethod) == null) { + synchronized (ContextServiceGrpc.class) { + if ((getGetSliceMethod = ContextServiceGrpc.getGetSliceMethod) == null) { + ContextServiceGrpc.getGetSliceMethod = getGetSliceMethod = + io.grpc.MethodDescriptor.<context.ContextOuterClass.SliceId, context.ContextOuterClass.Slice>newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSlice")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.SliceId.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Slice.getDefaultInstance())) + .setSchemaDescriptor(new ContextServiceMethodDescriptorSupplier("GetSlice")) + .build(); + } + } + } + return getGetSliceMethod; + } + + private static volatile io.grpc.MethodDescriptor<context.ContextOuterClass.Slice, + context.ContextOuterClass.SliceId> getSetSliceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SetSlice", + requestType = context.ContextOuterClass.Slice.class, + responseType = context.ContextOuterClass.SliceId.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor<context.ContextOuterClass.Slice, + context.ContextOuterClass.SliceId> getSetSliceMethod() { + io.grpc.MethodDescriptor<context.ContextOuterClass.Slice, context.ContextOuterClass.SliceId> getSetSliceMethod; + if ((getSetSliceMethod = ContextServiceGrpc.getSetSliceMethod) == null) { + synchronized (ContextServiceGrpc.class) { + if ((getSetSliceMethod = ContextServiceGrpc.getSetSliceMethod) == null) { + ContextServiceGrpc.getSetSliceMethod = getSetSliceMethod = + io.grpc.MethodDescriptor.<context.ContextOuterClass.Slice, context.ContextOuterClass.SliceId>newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SetSlice")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Slice.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.SliceId.getDefaultInstance())) + .setSchemaDescriptor(new ContextServiceMethodDescriptorSupplier("SetSlice")) + .build(); + } + } + } + return getSetSliceMethod; + } + + private static volatile io.grpc.MethodDescriptor<context.ContextOuterClass.SliceId, + context.ContextOuterClass.Empty> getRemoveSliceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RemoveSlice", + requestType = context.ContextOuterClass.SliceId.class, + responseType = context.ContextOuterClass.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor<context.ContextOuterClass.SliceId, + context.ContextOuterClass.Empty> getRemoveSliceMethod() { + io.grpc.MethodDescriptor<context.ContextOuterClass.SliceId, context.ContextOuterClass.Empty> getRemoveSliceMethod; + if ((getRemoveSliceMethod = ContextServiceGrpc.getRemoveSliceMethod) == null) { + synchronized (ContextServiceGrpc.class) { + if ((getRemoveSliceMethod = ContextServiceGrpc.getRemoveSliceMethod) == null) { + ContextServiceGrpc.getRemoveSliceMethod = getRemoveSliceMethod = + io.grpc.MethodDescriptor.<context.ContextOuterClass.SliceId, context.ContextOuterClass.Empty>newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RemoveSlice")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.SliceId.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Empty.getDefaultInstance())) + .setSchemaDescriptor(new ContextServiceMethodDescriptorSupplier("RemoveSlice")) + .build(); + } + } + } + return getRemoveSliceMethod; + } + + private static volatile io.grpc.MethodDescriptor<context.ContextOuterClass.Empty, + context.ContextOuterClass.SliceEvent> getGetSliceEventsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetSliceEvents", + requestType = context.ContextOuterClass.Empty.class, + responseType = context.ContextOuterClass.SliceEvent.class, + methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + public static io.grpc.MethodDescriptor<context.ContextOuterClass.Empty, + context.ContextOuterClass.SliceEvent> getGetSliceEventsMethod() { + io.grpc.MethodDescriptor<context.ContextOuterClass.Empty, context.ContextOuterClass.SliceEvent> getGetSliceEventsMethod; + if ((getGetSliceEventsMethod = ContextServiceGrpc.getGetSliceEventsMethod) == null) { + synchronized (ContextServiceGrpc.class) { + if ((getGetSliceEventsMethod = ContextServiceGrpc.getGetSliceEventsMethod) == null) { + ContextServiceGrpc.getGetSliceEventsMethod = getGetSliceEventsMethod = + io.grpc.MethodDescriptor.<context.ContextOuterClass.Empty, context.ContextOuterClass.SliceEvent>newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSliceEvents")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Empty.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.SliceEvent.getDefaultInstance())) + .setSchemaDescriptor(new ContextServiceMethodDescriptorSupplier("GetSliceEvents")) + .build(); + } + } + } + return getGetSliceEventsMethod; + } + private static volatile io.grpc.MethodDescriptor<context.ContextOuterClass.ServiceId, context.ContextOuterClass.ConnectionIdList> getListConnectionIdsMethod; @@ -1388,6 +1574,48 @@ public final class ContextServiceGrpc { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetServiceEventsMethod(), responseObserver); } + /** + */ + public void listSliceIds(context.ContextOuterClass.ContextId request, + io.grpc.stub.StreamObserver<context.ContextOuterClass.SliceIdList> responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListSliceIdsMethod(), responseObserver); + } + + /** + */ + public void listSlices(context.ContextOuterClass.ContextId request, + io.grpc.stub.StreamObserver<context.ContextOuterClass.SliceList> responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListSlicesMethod(), responseObserver); + } + + /** + */ + public void getSlice(context.ContextOuterClass.SliceId request, + io.grpc.stub.StreamObserver<context.ContextOuterClass.Slice> responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetSliceMethod(), responseObserver); + } + + /** + */ + public void setSlice(context.ContextOuterClass.Slice request, + io.grpc.stub.StreamObserver<context.ContextOuterClass.SliceId> responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSetSliceMethod(), responseObserver); + } + + /** + */ + public void removeSlice(context.ContextOuterClass.SliceId request, + io.grpc.stub.StreamObserver<context.ContextOuterClass.Empty> responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRemoveSliceMethod(), responseObserver); + } + + /** + */ + public void getSliceEvents(context.ContextOuterClass.Empty request, + io.grpc.stub.StreamObserver<context.ContextOuterClass.SliceEvent> responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetSliceEventsMethod(), responseObserver); + } + /** */ public void listConnectionIds(context.ContextOuterClass.ServiceId request, @@ -1642,6 +1870,48 @@ public final class ContextServiceGrpc { context.ContextOuterClass.Empty, context.ContextOuterClass.ServiceEvent>( this, METHODID_GET_SERVICE_EVENTS))) + .addMethod( + getListSliceIdsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.ContextId, + context.ContextOuterClass.SliceIdList>( + this, METHODID_LIST_SLICE_IDS))) + .addMethod( + getListSlicesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.ContextId, + context.ContextOuterClass.SliceList>( + this, METHODID_LIST_SLICES))) + .addMethod( + getGetSliceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.SliceId, + context.ContextOuterClass.Slice>( + this, METHODID_GET_SLICE))) + .addMethod( + getSetSliceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.Slice, + context.ContextOuterClass.SliceId>( + this, METHODID_SET_SLICE))) + .addMethod( + getRemoveSliceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.SliceId, + context.ContextOuterClass.Empty>( + this, METHODID_REMOVE_SLICE))) + .addMethod( + getGetSliceEventsMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + context.ContextOuterClass.Empty, + context.ContextOuterClass.SliceEvent>( + this, METHODID_GET_SLICE_EVENTS))) .addMethod( getListConnectionIdsMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( @@ -1942,6 +2212,54 @@ public final class ContextServiceGrpc { getChannel().newCall(getGetServiceEventsMethod(), getCallOptions()), request, responseObserver); } + /** + */ + public void listSliceIds(context.ContextOuterClass.ContextId request, + io.grpc.stub.StreamObserver<context.ContextOuterClass.SliceIdList> responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListSliceIdsMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void listSlices(context.ContextOuterClass.ContextId request, + io.grpc.stub.StreamObserver<context.ContextOuterClass.SliceList> responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListSlicesMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getSlice(context.ContextOuterClass.SliceId request, + io.grpc.stub.StreamObserver<context.ContextOuterClass.Slice> responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetSliceMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void setSlice(context.ContextOuterClass.Slice request, + io.grpc.stub.StreamObserver<context.ContextOuterClass.SliceId> responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSetSliceMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void removeSlice(context.ContextOuterClass.SliceId request, + io.grpc.stub.StreamObserver<context.ContextOuterClass.Empty> responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRemoveSliceMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getSliceEvents(context.ContextOuterClass.Empty request, + io.grpc.stub.StreamObserver<context.ContextOuterClass.SliceEvent> responseObserver) { + io.grpc.stub.ClientCalls.asyncServerStreamingCall( + getChannel().newCall(getGetSliceEventsMethod(), getCallOptions()), request, responseObserver); + } + /** */ public void listConnectionIds(context.ContextOuterClass.ServiceId request, @@ -2220,6 +2538,49 @@ public final class ContextServiceGrpc { getChannel(), getGetServiceEventsMethod(), getCallOptions(), request); } + /** + */ + public context.ContextOuterClass.SliceIdList listSliceIds(context.ContextOuterClass.ContextId request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListSliceIdsMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.SliceList listSlices(context.ContextOuterClass.ContextId request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListSlicesMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.Slice getSlice(context.ContextOuterClass.SliceId request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetSliceMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.SliceId setSlice(context.ContextOuterClass.Slice request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSetSliceMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.Empty removeSlice(context.ContextOuterClass.SliceId request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRemoveSliceMethod(), getCallOptions(), request); + } + + /** + */ + public java.util.Iterator<context.ContextOuterClass.SliceEvent> getSliceEvents( + context.ContextOuterClass.Empty request) { + return io.grpc.stub.ClientCalls.blockingServerStreamingCall( + getChannel(), getGetSliceEventsMethod(), getCallOptions(), request); + } + /** */ public context.ContextOuterClass.ConnectionIdList listConnectionIds(context.ContextOuterClass.ServiceId request) { @@ -2478,6 +2839,46 @@ public final class ContextServiceGrpc { getChannel().newCall(getRemoveServiceMethod(), getCallOptions()), request); } + /** + */ + public com.google.common.util.concurrent.ListenableFuture<context.ContextOuterClass.SliceIdList> listSliceIds( + context.ContextOuterClass.ContextId request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListSliceIdsMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture<context.ContextOuterClass.SliceList> listSlices( + context.ContextOuterClass.ContextId request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListSlicesMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture<context.ContextOuterClass.Slice> getSlice( + context.ContextOuterClass.SliceId request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetSliceMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture<context.ContextOuterClass.SliceId> setSlice( + context.ContextOuterClass.Slice request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSetSliceMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture<context.ContextOuterClass.Empty> removeSlice( + context.ContextOuterClass.SliceId request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRemoveSliceMethod(), getCallOptions()), request); + } + /** */ public com.google.common.util.concurrent.ListenableFuture<context.ContextOuterClass.ConnectionIdList> listConnectionIds( @@ -2549,12 +2950,18 @@ public final class ContextServiceGrpc { private static final int METHODID_SET_SERVICE = 27; private static final int METHODID_REMOVE_SERVICE = 28; private static final int METHODID_GET_SERVICE_EVENTS = 29; - private static final int METHODID_LIST_CONNECTION_IDS = 30; - private static final int METHODID_LIST_CONNECTIONS = 31; - private static final int METHODID_GET_CONNECTION = 32; - private static final int METHODID_SET_CONNECTION = 33; - private static final int METHODID_REMOVE_CONNECTION = 34; - private static final int METHODID_GET_CONNECTION_EVENTS = 35; + private static final int METHODID_LIST_SLICE_IDS = 30; + private static final int METHODID_LIST_SLICES = 31; + private static final int METHODID_GET_SLICE = 32; + private static final int METHODID_SET_SLICE = 33; + private static final int METHODID_REMOVE_SLICE = 34; + private static final int METHODID_GET_SLICE_EVENTS = 35; + private static final int METHODID_LIST_CONNECTION_IDS = 36; + private static final int METHODID_LIST_CONNECTIONS = 37; + private static final int METHODID_GET_CONNECTION = 38; + private static final int METHODID_SET_CONNECTION = 39; + private static final int METHODID_REMOVE_CONNECTION = 40; + private static final int METHODID_GET_CONNECTION_EVENTS = 41; private static final class MethodHandlers<Req, Resp> implements io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>, @@ -2693,6 +3100,30 @@ public final class ContextServiceGrpc { serviceImpl.getServiceEvents((context.ContextOuterClass.Empty) request, (io.grpc.stub.StreamObserver<context.ContextOuterClass.ServiceEvent>) responseObserver); break; + case METHODID_LIST_SLICE_IDS: + serviceImpl.listSliceIds((context.ContextOuterClass.ContextId) request, + (io.grpc.stub.StreamObserver<context.ContextOuterClass.SliceIdList>) responseObserver); + break; + case METHODID_LIST_SLICES: + serviceImpl.listSlices((context.ContextOuterClass.ContextId) request, + (io.grpc.stub.StreamObserver<context.ContextOuterClass.SliceList>) responseObserver); + break; + case METHODID_GET_SLICE: + serviceImpl.getSlice((context.ContextOuterClass.SliceId) request, + (io.grpc.stub.StreamObserver<context.ContextOuterClass.Slice>) responseObserver); + break; + case METHODID_SET_SLICE: + serviceImpl.setSlice((context.ContextOuterClass.Slice) request, + (io.grpc.stub.StreamObserver<context.ContextOuterClass.SliceId>) responseObserver); + break; + case METHODID_REMOVE_SLICE: + serviceImpl.removeSlice((context.ContextOuterClass.SliceId) request, + (io.grpc.stub.StreamObserver<context.ContextOuterClass.Empty>) responseObserver); + break; + case METHODID_GET_SLICE_EVENTS: + serviceImpl.getSliceEvents((context.ContextOuterClass.Empty) request, + (io.grpc.stub.StreamObserver<context.ContextOuterClass.SliceEvent>) responseObserver); + break; case METHODID_LIST_CONNECTION_IDS: serviceImpl.listConnectionIds((context.ContextOuterClass.ServiceId) request, (io.grpc.stub.StreamObserver<context.ContextOuterClass.ConnectionIdList>) responseObserver); @@ -2808,6 +3239,12 @@ public final class ContextServiceGrpc { .addMethod(getSetServiceMethod()) .addMethod(getRemoveServiceMethod()) .addMethod(getGetServiceEventsMethod()) + .addMethod(getListSliceIdsMethod()) + .addMethod(getListSlicesMethod()) + .addMethod(getGetSliceMethod()) + .addMethod(getSetSliceMethod()) + .addMethod(getRemoveSliceMethod()) + .addMethod(getGetSliceEventsMethod()) .addMethod(getListConnectionIdsMethod()) .addMethod(getListConnectionsMethod()) .addMethod(getGetConnectionMethod()) diff --git a/src/policy/target/generated-sources/grpc/context/MutinyContextServiceGrpc.java b/src/policy/target/generated-sources/grpc/context/MutinyContextServiceGrpc.java index 85abba20a9f315f684f964d16db4ad0cd7e91299..9f71b53786e40922546dc59cfd4328040a40bd7c 100644 --- a/src/policy/target/generated-sources/grpc/context/MutinyContextServiceGrpc.java +++ b/src/policy/target/generated-sources/grpc/context/MutinyContextServiceGrpc.java @@ -161,6 +161,31 @@ public final class MutinyContextServiceGrpc implements io.quarkus.grpc.runtime.M } + public io.smallrye.mutiny.Uni<context.ContextOuterClass.SliceIdList> listSliceIds(context.ContextOuterClass.ContextId request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::listSliceIds); + } + + + public io.smallrye.mutiny.Uni<context.ContextOuterClass.SliceList> listSlices(context.ContextOuterClass.ContextId request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::listSlices); + } + + + public io.smallrye.mutiny.Uni<context.ContextOuterClass.Slice> getSlice(context.ContextOuterClass.SliceId request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::getSlice); + } + + + public io.smallrye.mutiny.Uni<context.ContextOuterClass.SliceId> setSlice(context.ContextOuterClass.Slice request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::setSlice); + } + + + public io.smallrye.mutiny.Uni<context.ContextOuterClass.Empty> removeSlice(context.ContextOuterClass.SliceId request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::removeSlice); + } + + public io.smallrye.mutiny.Uni<context.ContextOuterClass.ConnectionIdList> listConnectionIds(context.ContextOuterClass.ServiceId request) { return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::listConnectionIds); } @@ -211,6 +236,11 @@ public final class MutinyContextServiceGrpc implements io.quarkus.grpc.runtime.M } + public io.smallrye.mutiny.Multi<context.ContextOuterClass.SliceEvent> getSliceEvents(context.ContextOuterClass.Empty request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToMany(request, delegateStub::getSliceEvents); + } + + public io.smallrye.mutiny.Multi<context.ContextOuterClass.ConnectionEvent> getConnectionEvents(context.ContextOuterClass.Empty request) { return io.quarkus.grpc.runtime.ClientCalls.oneToMany(request, delegateStub::getConnectionEvents); } @@ -358,6 +388,31 @@ public final class MutinyContextServiceGrpc implements io.quarkus.grpc.runtime.M } + public io.smallrye.mutiny.Uni<context.ContextOuterClass.SliceIdList> listSliceIds(context.ContextOuterClass.ContextId request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni<context.ContextOuterClass.SliceList> listSlices(context.ContextOuterClass.ContextId request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni<context.ContextOuterClass.Slice> getSlice(context.ContextOuterClass.SliceId request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni<context.ContextOuterClass.SliceId> setSlice(context.ContextOuterClass.Slice request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni<context.ContextOuterClass.Empty> removeSlice(context.ContextOuterClass.SliceId request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + public io.smallrye.mutiny.Uni<context.ContextOuterClass.ConnectionIdList> listConnectionIds(context.ContextOuterClass.ServiceId request) { throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } @@ -408,6 +463,11 @@ public final class MutinyContextServiceGrpc implements io.quarkus.grpc.runtime.M } + public io.smallrye.mutiny.Multi<context.ContextOuterClass.SliceEvent> getSliceEvents(context.ContextOuterClass.Empty request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + public io.smallrye.mutiny.Multi<context.ContextOuterClass.ConnectionEvent> getConnectionEvents(context.ContextOuterClass.Empty request) { throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } @@ -624,6 +684,48 @@ public final class MutinyContextServiceGrpc implements io.quarkus.grpc.runtime.M context.ContextOuterClass.Empty, context.ContextOuterClass.ServiceEvent>( this, METHODID_GET_SERVICE_EVENTS, compression))) + .addMethod( + context.ContextServiceGrpc.getListSliceIdsMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.ContextId, + context.ContextOuterClass.SliceIdList>( + this, METHODID_LIST_SLICE_IDS, compression))) + .addMethod( + context.ContextServiceGrpc.getListSlicesMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.ContextId, + context.ContextOuterClass.SliceList>( + this, METHODID_LIST_SLICES, compression))) + .addMethod( + context.ContextServiceGrpc.getGetSliceMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.SliceId, + context.ContextOuterClass.Slice>( + this, METHODID_GET_SLICE, compression))) + .addMethod( + context.ContextServiceGrpc.getSetSliceMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.Slice, + context.ContextOuterClass.SliceId>( + this, METHODID_SET_SLICE, compression))) + .addMethod( + context.ContextServiceGrpc.getRemoveSliceMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.SliceId, + context.ContextOuterClass.Empty>( + this, METHODID_REMOVE_SLICE, compression))) + .addMethod( + context.ContextServiceGrpc.getGetSliceEventsMethod(), + asyncServerStreamingCall( + new MethodHandlers< + context.ContextOuterClass.Empty, + context.ContextOuterClass.SliceEvent>( + this, METHODID_GET_SLICE_EVENTS, compression))) .addMethod( context.ContextServiceGrpc.getListConnectionIdsMethod(), asyncUnaryCall( @@ -700,12 +802,18 @@ public final class MutinyContextServiceGrpc implements io.quarkus.grpc.runtime.M private static final int METHODID_SET_SERVICE = 27; private static final int METHODID_REMOVE_SERVICE = 28; private static final int METHODID_GET_SERVICE_EVENTS = 29; - private static final int METHODID_LIST_CONNECTION_IDS = 30; - private static final int METHODID_LIST_CONNECTIONS = 31; - private static final int METHODID_GET_CONNECTION = 32; - private static final int METHODID_SET_CONNECTION = 33; - private static final int METHODID_REMOVE_CONNECTION = 34; - private static final int METHODID_GET_CONNECTION_EVENTS = 35; + private static final int METHODID_LIST_SLICE_IDS = 30; + private static final int METHODID_LIST_SLICES = 31; + private static final int METHODID_GET_SLICE = 32; + private static final int METHODID_SET_SLICE = 33; + private static final int METHODID_REMOVE_SLICE = 34; + private static final int METHODID_GET_SLICE_EVENTS = 35; + private static final int METHODID_LIST_CONNECTION_IDS = 36; + private static final int METHODID_LIST_CONNECTIONS = 37; + private static final int METHODID_GET_CONNECTION = 38; + private static final int METHODID_SET_CONNECTION = 39; + private static final int METHODID_REMOVE_CONNECTION = 40; + private static final int METHODID_GET_CONNECTION_EVENTS = 41; private static final class MethodHandlers<Req, Resp> implements io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>, @@ -906,6 +1014,42 @@ public final class MutinyContextServiceGrpc implements io.quarkus.grpc.runtime.M compression, serviceImpl::getServiceEvents); break; + case METHODID_LIST_SLICE_IDS: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.ContextId) request, + (io.grpc.stub.StreamObserver<context.ContextOuterClass.SliceIdList>) responseObserver, + compression, + serviceImpl::listSliceIds); + break; + case METHODID_LIST_SLICES: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.ContextId) request, + (io.grpc.stub.StreamObserver<context.ContextOuterClass.SliceList>) responseObserver, + compression, + serviceImpl::listSlices); + break; + case METHODID_GET_SLICE: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.SliceId) request, + (io.grpc.stub.StreamObserver<context.ContextOuterClass.Slice>) responseObserver, + compression, + serviceImpl::getSlice); + break; + case METHODID_SET_SLICE: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.Slice) request, + (io.grpc.stub.StreamObserver<context.ContextOuterClass.SliceId>) responseObserver, + compression, + serviceImpl::setSlice); + break; + case METHODID_REMOVE_SLICE: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.SliceId) request, + (io.grpc.stub.StreamObserver<context.ContextOuterClass.Empty>) responseObserver, + compression, + serviceImpl::removeSlice); + break; + case METHODID_GET_SLICE_EVENTS: + io.quarkus.grpc.runtime.ServerCalls.oneToMany((context.ContextOuterClass.Empty) request, + (io.grpc.stub.StreamObserver<context.ContextOuterClass.SliceEvent>) responseObserver, + compression, + serviceImpl::getSliceEvents); + break; case METHODID_LIST_CONNECTION_IDS: io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.ServiceId) request, (io.grpc.stub.StreamObserver<context.ContextOuterClass.ConnectionIdList>) responseObserver, diff --git a/src/policy/target/generated-sources/grpc/monitoring/Monitoring.java b/src/policy/target/generated-sources/grpc/monitoring/Monitoring.java new file mode 100644 index 0000000000000000000000000000000000000000..1ef1f0c029d1d5916eaf5ffc4f185c048a40b5a3 --- /dev/null +++ b/src/policy/target/generated-sources/grpc/monitoring/Monitoring.java @@ -0,0 +1,5629 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: monitoring.proto + +package monitoring; + +public final class Monitoring { + private Monitoring() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface KpiDescriptorOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.KpiDescriptor) + com.google.protobuf.MessageOrBuilder { + + /** + * <code>string kpi_description = 1;</code> + * @return The kpiDescription. + */ + java.lang.String getKpiDescription(); + /** + * <code>string kpi_description = 1;</code> + * @return The bytes for kpiDescription. + */ + com.google.protobuf.ByteString + getKpiDescriptionBytes(); + + /** + * <code>.kpi_sample_types.KpiSampleType kpi_sample_type = 2;</code> + * @return The enum numeric value on the wire for kpiSampleType. + */ + int getKpiSampleTypeValue(); + /** + * <code>.kpi_sample_types.KpiSampleType kpi_sample_type = 2;</code> + * @return The kpiSampleType. + */ + kpi_sample_types.KpiSampleTypes.KpiSampleType getKpiSampleType(); + + /** + * <code>.context.DeviceId device_id = 3;</code> + * @return Whether the deviceId field is set. + */ + boolean hasDeviceId(); + /** + * <code>.context.DeviceId device_id = 3;</code> + * @return The deviceId. + */ + context.ContextOuterClass.DeviceId getDeviceId(); + /** + * <code>.context.DeviceId device_id = 3;</code> + */ + context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder(); + + /** + * <code>.context.EndPointId endpoint_id = 4;</code> + * @return Whether the endpointId field is set. + */ + boolean hasEndpointId(); + /** + * <code>.context.EndPointId endpoint_id = 4;</code> + * @return The endpointId. + */ + context.ContextOuterClass.EndPointId getEndpointId(); + /** + * <code>.context.EndPointId endpoint_id = 4;</code> + */ + context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder(); + + /** + * <pre> + * context.SliceId slice_id = 6; + * </pre> + * + * <code>.context.ServiceId service_id = 5;</code> + * @return Whether the serviceId field is set. + */ + boolean hasServiceId(); + /** + * <pre> + * context.SliceId slice_id = 6; + * </pre> + * + * <code>.context.ServiceId service_id = 5;</code> + * @return The serviceId. + */ + context.ContextOuterClass.ServiceId getServiceId(); + /** + * <pre> + * context.SliceId slice_id = 6; + * </pre> + * + * <code>.context.ServiceId service_id = 5;</code> + */ + context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder(); + } + /** + * Protobuf type {@code monitoring.KpiDescriptor} + */ + public static final class KpiDescriptor extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.KpiDescriptor) + KpiDescriptorOrBuilder { + private static final long serialVersionUID = 0L; + // Use KpiDescriptor.newBuilder() to construct. + private KpiDescriptor(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private KpiDescriptor() { + kpiDescription_ = ""; + kpiSampleType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new KpiDescriptor(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private KpiDescriptor( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + kpiDescription_ = s; + break; + } + case 16: { + int rawValue = input.readEnum(); + + kpiSampleType_ = rawValue; + break; + } + case 26: { + context.ContextOuterClass.DeviceId.Builder subBuilder = null; + if (deviceId_ != null) { + subBuilder = deviceId_.toBuilder(); + } + deviceId_ = input.readMessage(context.ContextOuterClass.DeviceId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(deviceId_); + deviceId_ = subBuilder.buildPartial(); + } + + break; + } + case 34: { + context.ContextOuterClass.EndPointId.Builder subBuilder = null; + if (endpointId_ != null) { + subBuilder = endpointId_.toBuilder(); + } + endpointId_ = input.readMessage(context.ContextOuterClass.EndPointId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endpointId_); + endpointId_ = subBuilder.buildPartial(); + } + + break; + } + case 42: { + context.ContextOuterClass.ServiceId.Builder subBuilder = null; + if (serviceId_ != null) { + subBuilder = serviceId_.toBuilder(); + } + serviceId_ = input.readMessage(context.ContextOuterClass.ServiceId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(serviceId_); + serviceId_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_KpiDescriptor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_KpiDescriptor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.KpiDescriptor.class, monitoring.Monitoring.KpiDescriptor.Builder.class); + } + + public static final int KPI_DESCRIPTION_FIELD_NUMBER = 1; + private volatile java.lang.Object kpiDescription_; + /** + * <code>string kpi_description = 1;</code> + * @return The kpiDescription. + */ + @java.lang.Override + public java.lang.String getKpiDescription() { + java.lang.Object ref = kpiDescription_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kpiDescription_ = s; + return s; + } + } + /** + * <code>string kpi_description = 1;</code> + * @return The bytes for kpiDescription. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getKpiDescriptionBytes() { + java.lang.Object ref = kpiDescription_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + kpiDescription_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KPI_SAMPLE_TYPE_FIELD_NUMBER = 2; + private int kpiSampleType_; + /** + * <code>.kpi_sample_types.KpiSampleType kpi_sample_type = 2;</code> + * @return The enum numeric value on the wire for kpiSampleType. + */ + @java.lang.Override public int getKpiSampleTypeValue() { + return kpiSampleType_; + } + /** + * <code>.kpi_sample_types.KpiSampleType kpi_sample_type = 2;</code> + * @return The kpiSampleType. + */ + @java.lang.Override public kpi_sample_types.KpiSampleTypes.KpiSampleType getKpiSampleType() { + @SuppressWarnings("deprecation") + kpi_sample_types.KpiSampleTypes.KpiSampleType result = kpi_sample_types.KpiSampleTypes.KpiSampleType.valueOf(kpiSampleType_); + return result == null ? kpi_sample_types.KpiSampleTypes.KpiSampleType.UNRECOGNIZED : result; + } + + public static final int DEVICE_ID_FIELD_NUMBER = 3; + private context.ContextOuterClass.DeviceId deviceId_; + /** + * <code>.context.DeviceId device_id = 3;</code> + * @return Whether the deviceId field is set. + */ + @java.lang.Override + public boolean hasDeviceId() { + return deviceId_ != null; + } + /** + * <code>.context.DeviceId device_id = 3;</code> + * @return The deviceId. + */ + @java.lang.Override + public context.ContextOuterClass.DeviceId getDeviceId() { + return deviceId_ == null ? context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; + } + /** + * <code>.context.DeviceId device_id = 3;</code> + */ + @java.lang.Override + public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder() { + return getDeviceId(); + } + + public static final int ENDPOINT_ID_FIELD_NUMBER = 4; + private context.ContextOuterClass.EndPointId endpointId_; + /** + * <code>.context.EndPointId endpoint_id = 4;</code> + * @return Whether the endpointId field is set. + */ + @java.lang.Override + public boolean hasEndpointId() { + return endpointId_ != null; + } + /** + * <code>.context.EndPointId endpoint_id = 4;</code> + * @return The endpointId. + */ + @java.lang.Override + public context.ContextOuterClass.EndPointId getEndpointId() { + return endpointId_ == null ? context.ContextOuterClass.EndPointId.getDefaultInstance() : endpointId_; + } + /** + * <code>.context.EndPointId endpoint_id = 4;</code> + */ + @java.lang.Override + public context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder() { + return getEndpointId(); + } + + public static final int SERVICE_ID_FIELD_NUMBER = 5; + private context.ContextOuterClass.ServiceId serviceId_; + /** + * <pre> + * context.SliceId slice_id = 6; + * </pre> + * + * <code>.context.ServiceId service_id = 5;</code> + * @return Whether the serviceId field is set. + */ + @java.lang.Override + public boolean hasServiceId() { + return serviceId_ != null; + } + /** + * <pre> + * context.SliceId slice_id = 6; + * </pre> + * + * <code>.context.ServiceId service_id = 5;</code> + * @return The serviceId. + */ + @java.lang.Override + public context.ContextOuterClass.ServiceId getServiceId() { + return serviceId_ == null ? context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; + } + /** + * <pre> + * context.SliceId slice_id = 6; + * </pre> + * + * <code>.context.ServiceId service_id = 5;</code> + */ + @java.lang.Override + public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder() { + return getServiceId(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getKpiDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, kpiDescription_); + } + if (kpiSampleType_ != kpi_sample_types.KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_UNKNOWN.getNumber()) { + output.writeEnum(2, kpiSampleType_); + } + if (deviceId_ != null) { + output.writeMessage(3, getDeviceId()); + } + if (endpointId_ != null) { + output.writeMessage(4, getEndpointId()); + } + if (serviceId_ != null) { + output.writeMessage(5, getServiceId()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getKpiDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, kpiDescription_); + } + if (kpiSampleType_ != kpi_sample_types.KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, kpiSampleType_); + } + if (deviceId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getDeviceId()); + } + if (endpointId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getEndpointId()); + } + if (serviceId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getServiceId()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof monitoring.Monitoring.KpiDescriptor)) { + return super.equals(obj); + } + monitoring.Monitoring.KpiDescriptor other = (monitoring.Monitoring.KpiDescriptor) obj; + + if (!getKpiDescription() + .equals(other.getKpiDescription())) return false; + if (kpiSampleType_ != other.kpiSampleType_) return false; + if (hasDeviceId() != other.hasDeviceId()) return false; + if (hasDeviceId()) { + if (!getDeviceId() + .equals(other.getDeviceId())) return false; + } + if (hasEndpointId() != other.hasEndpointId()) return false; + if (hasEndpointId()) { + if (!getEndpointId() + .equals(other.getEndpointId())) return false; + } + if (hasServiceId() != other.hasServiceId()) return false; + if (hasServiceId()) { + if (!getServiceId() + .equals(other.getServiceId())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KPI_DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getKpiDescription().hashCode(); + hash = (37 * hash) + KPI_SAMPLE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + kpiSampleType_; + if (hasDeviceId()) { + hash = (37 * hash) + DEVICE_ID_FIELD_NUMBER; + hash = (53 * hash) + getDeviceId().hashCode(); + } + if (hasEndpointId()) { + hash = (37 * hash) + ENDPOINT_ID_FIELD_NUMBER; + hash = (53 * hash) + getEndpointId().hashCode(); + } + if (hasServiceId()) { + hash = (37 * hash) + SERVICE_ID_FIELD_NUMBER; + hash = (53 * hash) + getServiceId().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.KpiDescriptor parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiDescriptor parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiDescriptor parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiDescriptor parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiDescriptor parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiDescriptor parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiDescriptor parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiDescriptor parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static monitoring.Monitoring.KpiDescriptor parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiDescriptor parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static monitoring.Monitoring.KpiDescriptor parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiDescriptor parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(monitoring.Monitoring.KpiDescriptor prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code monitoring.KpiDescriptor} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:monitoring.KpiDescriptor) + monitoring.Monitoring.KpiDescriptorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_KpiDescriptor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_KpiDescriptor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.KpiDescriptor.class, monitoring.Monitoring.KpiDescriptor.Builder.class); + } + + // Construct using monitoring.Monitoring.KpiDescriptor.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + kpiDescription_ = ""; + + kpiSampleType_ = 0; + + if (deviceIdBuilder_ == null) { + deviceId_ = null; + } else { + deviceId_ = null; + deviceIdBuilder_ = null; + } + if (endpointIdBuilder_ == null) { + endpointId_ = null; + } else { + endpointId_ = null; + endpointIdBuilder_ = null; + } + if (serviceIdBuilder_ == null) { + serviceId_ = null; + } else { + serviceId_ = null; + serviceIdBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_KpiDescriptor_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.KpiDescriptor getDefaultInstanceForType() { + return monitoring.Monitoring.KpiDescriptor.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.KpiDescriptor build() { + monitoring.Monitoring.KpiDescriptor result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.KpiDescriptor buildPartial() { + monitoring.Monitoring.KpiDescriptor result = new monitoring.Monitoring.KpiDescriptor(this); + result.kpiDescription_ = kpiDescription_; + result.kpiSampleType_ = kpiSampleType_; + if (deviceIdBuilder_ == null) { + result.deviceId_ = deviceId_; + } else { + result.deviceId_ = deviceIdBuilder_.build(); + } + if (endpointIdBuilder_ == null) { + result.endpointId_ = endpointId_; + } else { + result.endpointId_ = endpointIdBuilder_.build(); + } + if (serviceIdBuilder_ == null) { + result.serviceId_ = serviceId_; + } else { + result.serviceId_ = serviceIdBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof monitoring.Monitoring.KpiDescriptor) { + return mergeFrom((monitoring.Monitoring.KpiDescriptor)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.KpiDescriptor other) { + if (other == monitoring.Monitoring.KpiDescriptor.getDefaultInstance()) return this; + if (!other.getKpiDescription().isEmpty()) { + kpiDescription_ = other.kpiDescription_; + onChanged(); + } + if (other.kpiSampleType_ != 0) { + setKpiSampleTypeValue(other.getKpiSampleTypeValue()); + } + if (other.hasDeviceId()) { + mergeDeviceId(other.getDeviceId()); + } + if (other.hasEndpointId()) { + mergeEndpointId(other.getEndpointId()); + } + if (other.hasServiceId()) { + mergeServiceId(other.getServiceId()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + monitoring.Monitoring.KpiDescriptor parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.KpiDescriptor) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object kpiDescription_ = ""; + /** + * <code>string kpi_description = 1;</code> + * @return The kpiDescription. + */ + public java.lang.String getKpiDescription() { + java.lang.Object ref = kpiDescription_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kpiDescription_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * <code>string kpi_description = 1;</code> + * @return The bytes for kpiDescription. + */ + public com.google.protobuf.ByteString + getKpiDescriptionBytes() { + java.lang.Object ref = kpiDescription_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + kpiDescription_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * <code>string kpi_description = 1;</code> + * @param value The kpiDescription to set. + * @return This builder for chaining. + */ + public Builder setKpiDescription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + kpiDescription_ = value; + onChanged(); + return this; + } + /** + * <code>string kpi_description = 1;</code> + * @return This builder for chaining. + */ + public Builder clearKpiDescription() { + + kpiDescription_ = getDefaultInstance().getKpiDescription(); + onChanged(); + return this; + } + /** + * <code>string kpi_description = 1;</code> + * @param value The bytes for kpiDescription to set. + * @return This builder for chaining. + */ + public Builder setKpiDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + kpiDescription_ = value; + onChanged(); + return this; + } + + private int kpiSampleType_ = 0; + /** + * <code>.kpi_sample_types.KpiSampleType kpi_sample_type = 2;</code> + * @return The enum numeric value on the wire for kpiSampleType. + */ + @java.lang.Override public int getKpiSampleTypeValue() { + return kpiSampleType_; + } + /** + * <code>.kpi_sample_types.KpiSampleType kpi_sample_type = 2;</code> + * @param value The enum numeric value on the wire for kpiSampleType to set. + * @return This builder for chaining. + */ + public Builder setKpiSampleTypeValue(int value) { + + kpiSampleType_ = value; + onChanged(); + return this; + } + /** + * <code>.kpi_sample_types.KpiSampleType kpi_sample_type = 2;</code> + * @return The kpiSampleType. + */ + @java.lang.Override + public kpi_sample_types.KpiSampleTypes.KpiSampleType getKpiSampleType() { + @SuppressWarnings("deprecation") + kpi_sample_types.KpiSampleTypes.KpiSampleType result = kpi_sample_types.KpiSampleTypes.KpiSampleType.valueOf(kpiSampleType_); + return result == null ? kpi_sample_types.KpiSampleTypes.KpiSampleType.UNRECOGNIZED : result; + } + /** + * <code>.kpi_sample_types.KpiSampleType kpi_sample_type = 2;</code> + * @param value The kpiSampleType to set. + * @return This builder for chaining. + */ + public Builder setKpiSampleType(kpi_sample_types.KpiSampleTypes.KpiSampleType value) { + if (value == null) { + throw new NullPointerException(); + } + + kpiSampleType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * <code>.kpi_sample_types.KpiSampleType kpi_sample_type = 2;</code> + * @return This builder for chaining. + */ + public Builder clearKpiSampleType() { + + kpiSampleType_ = 0; + onChanged(); + return this; + } + + private context.ContextOuterClass.DeviceId deviceId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> deviceIdBuilder_; + /** + * <code>.context.DeviceId device_id = 3;</code> + * @return Whether the deviceId field is set. + */ + public boolean hasDeviceId() { + return deviceIdBuilder_ != null || deviceId_ != null; + } + /** + * <code>.context.DeviceId device_id = 3;</code> + * @return The deviceId. + */ + public context.ContextOuterClass.DeviceId getDeviceId() { + if (deviceIdBuilder_ == null) { + return deviceId_ == null ? context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; + } else { + return deviceIdBuilder_.getMessage(); + } + } + /** + * <code>.context.DeviceId device_id = 3;</code> + */ + public Builder setDeviceId(context.ContextOuterClass.DeviceId value) { + if (deviceIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deviceId_ = value; + onChanged(); + } else { + deviceIdBuilder_.setMessage(value); + } + + return this; + } + /** + * <code>.context.DeviceId device_id = 3;</code> + */ + public Builder setDeviceId( + context.ContextOuterClass.DeviceId.Builder builderForValue) { + if (deviceIdBuilder_ == null) { + deviceId_ = builderForValue.build(); + onChanged(); + } else { + deviceIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * <code>.context.DeviceId device_id = 3;</code> + */ + public Builder mergeDeviceId(context.ContextOuterClass.DeviceId value) { + if (deviceIdBuilder_ == null) { + if (deviceId_ != null) { + deviceId_ = + context.ContextOuterClass.DeviceId.newBuilder(deviceId_).mergeFrom(value).buildPartial(); + } else { + deviceId_ = value; + } + onChanged(); + } else { + deviceIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * <code>.context.DeviceId device_id = 3;</code> + */ + public Builder clearDeviceId() { + if (deviceIdBuilder_ == null) { + deviceId_ = null; + onChanged(); + } else { + deviceId_ = null; + deviceIdBuilder_ = null; + } + + return this; + } + /** + * <code>.context.DeviceId device_id = 3;</code> + */ + public context.ContextOuterClass.DeviceId.Builder getDeviceIdBuilder() { + + onChanged(); + return getDeviceIdFieldBuilder().getBuilder(); + } + /** + * <code>.context.DeviceId device_id = 3;</code> + */ + public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder() { + if (deviceIdBuilder_ != null) { + return deviceIdBuilder_.getMessageOrBuilder(); + } else { + return deviceId_ == null ? + context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; + } + } + /** + * <code>.context.DeviceId device_id = 3;</code> + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> + getDeviceIdFieldBuilder() { + if (deviceIdBuilder_ == null) { + deviceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder>( + getDeviceId(), + getParentForChildren(), + isClean()); + deviceId_ = null; + } + return deviceIdBuilder_; + } + + private context.ContextOuterClass.EndPointId endpointId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> endpointIdBuilder_; + /** + * <code>.context.EndPointId endpoint_id = 4;</code> + * @return Whether the endpointId field is set. + */ + public boolean hasEndpointId() { + return endpointIdBuilder_ != null || endpointId_ != null; + } + /** + * <code>.context.EndPointId endpoint_id = 4;</code> + * @return The endpointId. + */ + public context.ContextOuterClass.EndPointId getEndpointId() { + if (endpointIdBuilder_ == null) { + return endpointId_ == null ? context.ContextOuterClass.EndPointId.getDefaultInstance() : endpointId_; + } else { + return endpointIdBuilder_.getMessage(); + } + } + /** + * <code>.context.EndPointId endpoint_id = 4;</code> + */ + public Builder setEndpointId(context.ContextOuterClass.EndPointId value) { + if (endpointIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endpointId_ = value; + onChanged(); + } else { + endpointIdBuilder_.setMessage(value); + } + + return this; + } + /** + * <code>.context.EndPointId endpoint_id = 4;</code> + */ + public Builder setEndpointId( + context.ContextOuterClass.EndPointId.Builder builderForValue) { + if (endpointIdBuilder_ == null) { + endpointId_ = builderForValue.build(); + onChanged(); + } else { + endpointIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * <code>.context.EndPointId endpoint_id = 4;</code> + */ + public Builder mergeEndpointId(context.ContextOuterClass.EndPointId value) { + if (endpointIdBuilder_ == null) { + if (endpointId_ != null) { + endpointId_ = + context.ContextOuterClass.EndPointId.newBuilder(endpointId_).mergeFrom(value).buildPartial(); + } else { + endpointId_ = value; + } + onChanged(); + } else { + endpointIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * <code>.context.EndPointId endpoint_id = 4;</code> + */ + public Builder clearEndpointId() { + if (endpointIdBuilder_ == null) { + endpointId_ = null; + onChanged(); + } else { + endpointId_ = null; + endpointIdBuilder_ = null; + } + + return this; + } + /** + * <code>.context.EndPointId endpoint_id = 4;</code> + */ + public context.ContextOuterClass.EndPointId.Builder getEndpointIdBuilder() { + + onChanged(); + return getEndpointIdFieldBuilder().getBuilder(); + } + /** + * <code>.context.EndPointId endpoint_id = 4;</code> + */ + public context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder() { + if (endpointIdBuilder_ != null) { + return endpointIdBuilder_.getMessageOrBuilder(); + } else { + return endpointId_ == null ? + context.ContextOuterClass.EndPointId.getDefaultInstance() : endpointId_; + } + } + /** + * <code>.context.EndPointId endpoint_id = 4;</code> + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> + getEndpointIdFieldBuilder() { + if (endpointIdBuilder_ == null) { + endpointIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder>( + getEndpointId(), + getParentForChildren(), + isClean()); + endpointId_ = null; + } + return endpointIdBuilder_; + } + + private context.ContextOuterClass.ServiceId serviceId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> serviceIdBuilder_; + /** + * <pre> + * context.SliceId slice_id = 6; + * </pre> + * + * <code>.context.ServiceId service_id = 5;</code> + * @return Whether the serviceId field is set. + */ + public boolean hasServiceId() { + return serviceIdBuilder_ != null || serviceId_ != null; + } + /** + * <pre> + * context.SliceId slice_id = 6; + * </pre> + * + * <code>.context.ServiceId service_id = 5;</code> + * @return The serviceId. + */ + public context.ContextOuterClass.ServiceId getServiceId() { + if (serviceIdBuilder_ == null) { + return serviceId_ == null ? context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; + } else { + return serviceIdBuilder_.getMessage(); + } + } + /** + * <pre> + * context.SliceId slice_id = 6; + * </pre> + * + * <code>.context.ServiceId service_id = 5;</code> + */ + public Builder setServiceId(context.ContextOuterClass.ServiceId value) { + if (serviceIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + serviceId_ = value; + onChanged(); + } else { + serviceIdBuilder_.setMessage(value); + } + + return this; + } + /** + * <pre> + * context.SliceId slice_id = 6; + * </pre> + * + * <code>.context.ServiceId service_id = 5;</code> + */ + public Builder setServiceId( + context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (serviceIdBuilder_ == null) { + serviceId_ = builderForValue.build(); + onChanged(); + } else { + serviceIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * <pre> + * context.SliceId slice_id = 6; + * </pre> + * + * <code>.context.ServiceId service_id = 5;</code> + */ + public Builder mergeServiceId(context.ContextOuterClass.ServiceId value) { + if (serviceIdBuilder_ == null) { + if (serviceId_ != null) { + serviceId_ = + context.ContextOuterClass.ServiceId.newBuilder(serviceId_).mergeFrom(value).buildPartial(); + } else { + serviceId_ = value; + } + onChanged(); + } else { + serviceIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * <pre> + * context.SliceId slice_id = 6; + * </pre> + * + * <code>.context.ServiceId service_id = 5;</code> + */ + public Builder clearServiceId() { + if (serviceIdBuilder_ == null) { + serviceId_ = null; + onChanged(); + } else { + serviceId_ = null; + serviceIdBuilder_ = null; + } + + return this; + } + /** + * <pre> + * context.SliceId slice_id = 6; + * </pre> + * + * <code>.context.ServiceId service_id = 5;</code> + */ + public context.ContextOuterClass.ServiceId.Builder getServiceIdBuilder() { + + onChanged(); + return getServiceIdFieldBuilder().getBuilder(); + } + /** + * <pre> + * context.SliceId slice_id = 6; + * </pre> + * + * <code>.context.ServiceId service_id = 5;</code> + */ + public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder() { + if (serviceIdBuilder_ != null) { + return serviceIdBuilder_.getMessageOrBuilder(); + } else { + return serviceId_ == null ? + context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; + } + } + /** + * <pre> + * context.SliceId slice_id = 6; + * </pre> + * + * <code>.context.ServiceId service_id = 5;</code> + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> + getServiceIdFieldBuilder() { + if (serviceIdBuilder_ == null) { + serviceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder>( + getServiceId(), + getParentForChildren(), + isClean()); + serviceId_ = null; + } + return serviceIdBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:monitoring.KpiDescriptor) + } + + // @@protoc_insertion_point(class_scope:monitoring.KpiDescriptor) + private static final monitoring.Monitoring.KpiDescriptor DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.KpiDescriptor(); + } + + public static monitoring.Monitoring.KpiDescriptor getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<KpiDescriptor> + PARSER = new com.google.protobuf.AbstractParser<KpiDescriptor>() { + @java.lang.Override + public KpiDescriptor parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new KpiDescriptor(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<KpiDescriptor> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<KpiDescriptor> getParserForType() { + return PARSER; + } + + @java.lang.Override + public monitoring.Monitoring.KpiDescriptor getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface MonitorKpiRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.MonitorKpiRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * <code>.monitoring.KpiId kpi_id = 1;</code> + * @return Whether the kpiId field is set. + */ + boolean hasKpiId(); + /** + * <code>.monitoring.KpiId kpi_id = 1;</code> + * @return The kpiId. + */ + monitoring.Monitoring.KpiId getKpiId(); + /** + * <code>.monitoring.KpiId kpi_id = 1;</code> + */ + monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder(); + + /** + * <code>float sampling_duration_s = 2;</code> + * @return The samplingDurationS. + */ + float getSamplingDurationS(); + + /** + * <code>float sampling_interval_s = 3;</code> + * @return The samplingIntervalS. + */ + float getSamplingIntervalS(); + } + /** + * Protobuf type {@code monitoring.MonitorKpiRequest} + */ + public static final class MonitorKpiRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.MonitorKpiRequest) + MonitorKpiRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use MonitorKpiRequest.newBuilder() to construct. + private MonitorKpiRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private MonitorKpiRequest() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new MonitorKpiRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private MonitorKpiRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + monitoring.Monitoring.KpiId.Builder subBuilder = null; + if (kpiId_ != null) { + subBuilder = kpiId_.toBuilder(); + } + kpiId_ = input.readMessage(monitoring.Monitoring.KpiId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(kpiId_); + kpiId_ = subBuilder.buildPartial(); + } + + break; + } + case 21: { + + samplingDurationS_ = input.readFloat(); + break; + } + case 29: { + + samplingIntervalS_ = input.readFloat(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_MonitorKpiRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_MonitorKpiRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.MonitorKpiRequest.class, monitoring.Monitoring.MonitorKpiRequest.Builder.class); + } + + public static final int KPI_ID_FIELD_NUMBER = 1; + private monitoring.Monitoring.KpiId kpiId_; + /** + * <code>.monitoring.KpiId kpi_id = 1;</code> + * @return Whether the kpiId field is set. + */ + @java.lang.Override + public boolean hasKpiId() { + return kpiId_ != null; + } + /** + * <code>.monitoring.KpiId kpi_id = 1;</code> + * @return The kpiId. + */ + @java.lang.Override + public monitoring.Monitoring.KpiId getKpiId() { + return kpiId_ == null ? monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } + /** + * <code>.monitoring.KpiId kpi_id = 1;</code> + */ + @java.lang.Override + public monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder() { + return getKpiId(); + } + + public static final int SAMPLING_DURATION_S_FIELD_NUMBER = 2; + private float samplingDurationS_; + /** + * <code>float sampling_duration_s = 2;</code> + * @return The samplingDurationS. + */ + @java.lang.Override + public float getSamplingDurationS() { + return samplingDurationS_; + } + + public static final int SAMPLING_INTERVAL_S_FIELD_NUMBER = 3; + private float samplingIntervalS_; + /** + * <code>float sampling_interval_s = 3;</code> + * @return The samplingIntervalS. + */ + @java.lang.Override + public float getSamplingIntervalS() { + return samplingIntervalS_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (kpiId_ != null) { + output.writeMessage(1, getKpiId()); + } + if (samplingDurationS_ != 0F) { + output.writeFloat(2, samplingDurationS_); + } + if (samplingIntervalS_ != 0F) { + output.writeFloat(3, samplingIntervalS_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (kpiId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getKpiId()); + } + if (samplingDurationS_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, samplingDurationS_); + } + if (samplingIntervalS_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(3, samplingIntervalS_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof monitoring.Monitoring.MonitorKpiRequest)) { + return super.equals(obj); + } + monitoring.Monitoring.MonitorKpiRequest other = (monitoring.Monitoring.MonitorKpiRequest) obj; + + if (hasKpiId() != other.hasKpiId()) return false; + if (hasKpiId()) { + if (!getKpiId() + .equals(other.getKpiId())) return false; + } + if (java.lang.Float.floatToIntBits(getSamplingDurationS()) + != java.lang.Float.floatToIntBits( + other.getSamplingDurationS())) return false; + if (java.lang.Float.floatToIntBits(getSamplingIntervalS()) + != java.lang.Float.floatToIntBits( + other.getSamplingIntervalS())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasKpiId()) { + hash = (37 * hash) + KPI_ID_FIELD_NUMBER; + hash = (53 * hash) + getKpiId().hashCode(); + } + hash = (37 * hash) + SAMPLING_DURATION_S_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getSamplingDurationS()); + hash = (37 * hash) + SAMPLING_INTERVAL_S_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getSamplingIntervalS()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.MonitorKpiRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.MonitorKpiRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.MonitorKpiRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.MonitorKpiRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.MonitorKpiRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.MonitorKpiRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.MonitorKpiRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.MonitorKpiRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static monitoring.Monitoring.MonitorKpiRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.MonitorKpiRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static monitoring.Monitoring.MonitorKpiRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.MonitorKpiRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(monitoring.Monitoring.MonitorKpiRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code monitoring.MonitorKpiRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:monitoring.MonitorKpiRequest) + monitoring.Monitoring.MonitorKpiRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_MonitorKpiRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_MonitorKpiRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.MonitorKpiRequest.class, monitoring.Monitoring.MonitorKpiRequest.Builder.class); + } + + // Construct using monitoring.Monitoring.MonitorKpiRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (kpiIdBuilder_ == null) { + kpiId_ = null; + } else { + kpiId_ = null; + kpiIdBuilder_ = null; + } + samplingDurationS_ = 0F; + + samplingIntervalS_ = 0F; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_MonitorKpiRequest_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.MonitorKpiRequest getDefaultInstanceForType() { + return monitoring.Monitoring.MonitorKpiRequest.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.MonitorKpiRequest build() { + monitoring.Monitoring.MonitorKpiRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.MonitorKpiRequest buildPartial() { + monitoring.Monitoring.MonitorKpiRequest result = new monitoring.Monitoring.MonitorKpiRequest(this); + if (kpiIdBuilder_ == null) { + result.kpiId_ = kpiId_; + } else { + result.kpiId_ = kpiIdBuilder_.build(); + } + result.samplingDurationS_ = samplingDurationS_; + result.samplingIntervalS_ = samplingIntervalS_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof monitoring.Monitoring.MonitorKpiRequest) { + return mergeFrom((monitoring.Monitoring.MonitorKpiRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.MonitorKpiRequest other) { + if (other == monitoring.Monitoring.MonitorKpiRequest.getDefaultInstance()) return this; + if (other.hasKpiId()) { + mergeKpiId(other.getKpiId()); + } + if (other.getSamplingDurationS() != 0F) { + setSamplingDurationS(other.getSamplingDurationS()); + } + if (other.getSamplingIntervalS() != 0F) { + setSamplingIntervalS(other.getSamplingIntervalS()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + monitoring.Monitoring.MonitorKpiRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.MonitorKpiRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private monitoring.Monitoring.KpiId kpiId_; + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder> kpiIdBuilder_; + /** + * <code>.monitoring.KpiId kpi_id = 1;</code> + * @return Whether the kpiId field is set. + */ + public boolean hasKpiId() { + return kpiIdBuilder_ != null || kpiId_ != null; + } + /** + * <code>.monitoring.KpiId kpi_id = 1;</code> + * @return The kpiId. + */ + public monitoring.Monitoring.KpiId getKpiId() { + if (kpiIdBuilder_ == null) { + return kpiId_ == null ? monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } else { + return kpiIdBuilder_.getMessage(); + } + } + /** + * <code>.monitoring.KpiId kpi_id = 1;</code> + */ + public Builder setKpiId(monitoring.Monitoring.KpiId value) { + if (kpiIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kpiId_ = value; + onChanged(); + } else { + kpiIdBuilder_.setMessage(value); + } + + return this; + } + /** + * <code>.monitoring.KpiId kpi_id = 1;</code> + */ + public Builder setKpiId( + monitoring.Monitoring.KpiId.Builder builderForValue) { + if (kpiIdBuilder_ == null) { + kpiId_ = builderForValue.build(); + onChanged(); + } else { + kpiIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * <code>.monitoring.KpiId kpi_id = 1;</code> + */ + public Builder mergeKpiId(monitoring.Monitoring.KpiId value) { + if (kpiIdBuilder_ == null) { + if (kpiId_ != null) { + kpiId_ = + monitoring.Monitoring.KpiId.newBuilder(kpiId_).mergeFrom(value).buildPartial(); + } else { + kpiId_ = value; + } + onChanged(); + } else { + kpiIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * <code>.monitoring.KpiId kpi_id = 1;</code> + */ + public Builder clearKpiId() { + if (kpiIdBuilder_ == null) { + kpiId_ = null; + onChanged(); + } else { + kpiId_ = null; + kpiIdBuilder_ = null; + } + + return this; + } + /** + * <code>.monitoring.KpiId kpi_id = 1;</code> + */ + public monitoring.Monitoring.KpiId.Builder getKpiIdBuilder() { + + onChanged(); + return getKpiIdFieldBuilder().getBuilder(); + } + /** + * <code>.monitoring.KpiId kpi_id = 1;</code> + */ + public monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder() { + if (kpiIdBuilder_ != null) { + return kpiIdBuilder_.getMessageOrBuilder(); + } else { + return kpiId_ == null ? + monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } + } + /** + * <code>.monitoring.KpiId kpi_id = 1;</code> + */ + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder> + getKpiIdFieldBuilder() { + if (kpiIdBuilder_ == null) { + kpiIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder>( + getKpiId(), + getParentForChildren(), + isClean()); + kpiId_ = null; + } + return kpiIdBuilder_; + } + + private float samplingDurationS_ ; + /** + * <code>float sampling_duration_s = 2;</code> + * @return The samplingDurationS. + */ + @java.lang.Override + public float getSamplingDurationS() { + return samplingDurationS_; + } + /** + * <code>float sampling_duration_s = 2;</code> + * @param value The samplingDurationS to set. + * @return This builder for chaining. + */ + public Builder setSamplingDurationS(float value) { + + samplingDurationS_ = value; + onChanged(); + return this; + } + /** + * <code>float sampling_duration_s = 2;</code> + * @return This builder for chaining. + */ + public Builder clearSamplingDurationS() { + + samplingDurationS_ = 0F; + onChanged(); + return this; + } + + private float samplingIntervalS_ ; + /** + * <code>float sampling_interval_s = 3;</code> + * @return The samplingIntervalS. + */ + @java.lang.Override + public float getSamplingIntervalS() { + return samplingIntervalS_; + } + /** + * <code>float sampling_interval_s = 3;</code> + * @param value The samplingIntervalS to set. + * @return This builder for chaining. + */ + public Builder setSamplingIntervalS(float value) { + + samplingIntervalS_ = value; + onChanged(); + return this; + } + /** + * <code>float sampling_interval_s = 3;</code> + * @return This builder for chaining. + */ + public Builder clearSamplingIntervalS() { + + samplingIntervalS_ = 0F; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:monitoring.MonitorKpiRequest) + } + + // @@protoc_insertion_point(class_scope:monitoring.MonitorKpiRequest) + private static final monitoring.Monitoring.MonitorKpiRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.MonitorKpiRequest(); + } + + public static monitoring.Monitoring.MonitorKpiRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<MonitorKpiRequest> + PARSER = new com.google.protobuf.AbstractParser<MonitorKpiRequest>() { + @java.lang.Override + public MonitorKpiRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new MonitorKpiRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<MonitorKpiRequest> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<MonitorKpiRequest> getParserForType() { + return PARSER; + } + + @java.lang.Override + public monitoring.Monitoring.MonitorKpiRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface KpiIdOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.KpiId) + com.google.protobuf.MessageOrBuilder { + + /** + * <code>.context.Uuid kpi_id = 1;</code> + * @return Whether the kpiId field is set. + */ + boolean hasKpiId(); + /** + * <code>.context.Uuid kpi_id = 1;</code> + * @return The kpiId. + */ + context.ContextOuterClass.Uuid getKpiId(); + /** + * <code>.context.Uuid kpi_id = 1;</code> + */ + context.ContextOuterClass.UuidOrBuilder getKpiIdOrBuilder(); + } + /** + * Protobuf type {@code monitoring.KpiId} + */ + public static final class KpiId extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.KpiId) + KpiIdOrBuilder { + private static final long serialVersionUID = 0L; + // Use KpiId.newBuilder() to construct. + private KpiId(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private KpiId() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new KpiId(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private KpiId( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + context.ContextOuterClass.Uuid.Builder subBuilder = null; + if (kpiId_ != null) { + subBuilder = kpiId_.toBuilder(); + } + kpiId_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(kpiId_); + kpiId_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_KpiId_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_KpiId_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.KpiId.class, monitoring.Monitoring.KpiId.Builder.class); + } + + public static final int KPI_ID_FIELD_NUMBER = 1; + private context.ContextOuterClass.Uuid kpiId_; + /** + * <code>.context.Uuid kpi_id = 1;</code> + * @return Whether the kpiId field is set. + */ + @java.lang.Override + public boolean hasKpiId() { + return kpiId_ != null; + } + /** + * <code>.context.Uuid kpi_id = 1;</code> + * @return The kpiId. + */ + @java.lang.Override + public context.ContextOuterClass.Uuid getKpiId() { + return kpiId_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : kpiId_; + } + /** + * <code>.context.Uuid kpi_id = 1;</code> + */ + @java.lang.Override + public context.ContextOuterClass.UuidOrBuilder getKpiIdOrBuilder() { + return getKpiId(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (kpiId_ != null) { + output.writeMessage(1, getKpiId()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (kpiId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getKpiId()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof monitoring.Monitoring.KpiId)) { + return super.equals(obj); + } + monitoring.Monitoring.KpiId other = (monitoring.Monitoring.KpiId) obj; + + if (hasKpiId() != other.hasKpiId()) return false; + if (hasKpiId()) { + if (!getKpiId() + .equals(other.getKpiId())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasKpiId()) { + hash = (37 * hash) + KPI_ID_FIELD_NUMBER; + hash = (53 * hash) + getKpiId().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.KpiId parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiId parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiId parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiId parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiId parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiId parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiId parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiId parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static monitoring.Monitoring.KpiId parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiId parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static monitoring.Monitoring.KpiId parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiId parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(monitoring.Monitoring.KpiId prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code monitoring.KpiId} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:monitoring.KpiId) + monitoring.Monitoring.KpiIdOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_KpiId_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_KpiId_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.KpiId.class, monitoring.Monitoring.KpiId.Builder.class); + } + + // Construct using monitoring.Monitoring.KpiId.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (kpiIdBuilder_ == null) { + kpiId_ = null; + } else { + kpiId_ = null; + kpiIdBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_KpiId_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.KpiId getDefaultInstanceForType() { + return monitoring.Monitoring.KpiId.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.KpiId build() { + monitoring.Monitoring.KpiId result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.KpiId buildPartial() { + monitoring.Monitoring.KpiId result = new monitoring.Monitoring.KpiId(this); + if (kpiIdBuilder_ == null) { + result.kpiId_ = kpiId_; + } else { + result.kpiId_ = kpiIdBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof monitoring.Monitoring.KpiId) { + return mergeFrom((monitoring.Monitoring.KpiId)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.KpiId other) { + if (other == monitoring.Monitoring.KpiId.getDefaultInstance()) return this; + if (other.hasKpiId()) { + mergeKpiId(other.getKpiId()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + monitoring.Monitoring.KpiId parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.KpiId) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private context.ContextOuterClass.Uuid kpiId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> kpiIdBuilder_; + /** + * <code>.context.Uuid kpi_id = 1;</code> + * @return Whether the kpiId field is set. + */ + public boolean hasKpiId() { + return kpiIdBuilder_ != null || kpiId_ != null; + } + /** + * <code>.context.Uuid kpi_id = 1;</code> + * @return The kpiId. + */ + public context.ContextOuterClass.Uuid getKpiId() { + if (kpiIdBuilder_ == null) { + return kpiId_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : kpiId_; + } else { + return kpiIdBuilder_.getMessage(); + } + } + /** + * <code>.context.Uuid kpi_id = 1;</code> + */ + public Builder setKpiId(context.ContextOuterClass.Uuid value) { + if (kpiIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kpiId_ = value; + onChanged(); + } else { + kpiIdBuilder_.setMessage(value); + } + + return this; + } + /** + * <code>.context.Uuid kpi_id = 1;</code> + */ + public Builder setKpiId( + context.ContextOuterClass.Uuid.Builder builderForValue) { + if (kpiIdBuilder_ == null) { + kpiId_ = builderForValue.build(); + onChanged(); + } else { + kpiIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * <code>.context.Uuid kpi_id = 1;</code> + */ + public Builder mergeKpiId(context.ContextOuterClass.Uuid value) { + if (kpiIdBuilder_ == null) { + if (kpiId_ != null) { + kpiId_ = + context.ContextOuterClass.Uuid.newBuilder(kpiId_).mergeFrom(value).buildPartial(); + } else { + kpiId_ = value; + } + onChanged(); + } else { + kpiIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * <code>.context.Uuid kpi_id = 1;</code> + */ + public Builder clearKpiId() { + if (kpiIdBuilder_ == null) { + kpiId_ = null; + onChanged(); + } else { + kpiId_ = null; + kpiIdBuilder_ = null; + } + + return this; + } + /** + * <code>.context.Uuid kpi_id = 1;</code> + */ + public context.ContextOuterClass.Uuid.Builder getKpiIdBuilder() { + + onChanged(); + return getKpiIdFieldBuilder().getBuilder(); + } + /** + * <code>.context.Uuid kpi_id = 1;</code> + */ + public context.ContextOuterClass.UuidOrBuilder getKpiIdOrBuilder() { + if (kpiIdBuilder_ != null) { + return kpiIdBuilder_.getMessageOrBuilder(); + } else { + return kpiId_ == null ? + context.ContextOuterClass.Uuid.getDefaultInstance() : kpiId_; + } + } + /** + * <code>.context.Uuid kpi_id = 1;</code> + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> + getKpiIdFieldBuilder() { + if (kpiIdBuilder_ == null) { + kpiIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( + getKpiId(), + getParentForChildren(), + isClean()); + kpiId_ = null; + } + return kpiIdBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:monitoring.KpiId) + } + + // @@protoc_insertion_point(class_scope:monitoring.KpiId) + private static final monitoring.Monitoring.KpiId DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.KpiId(); + } + + public static monitoring.Monitoring.KpiId getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<KpiId> + PARSER = new com.google.protobuf.AbstractParser<KpiId>() { + @java.lang.Override + public KpiId parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new KpiId(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<KpiId> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<KpiId> getParserForType() { + return PARSER; + } + + @java.lang.Override + public monitoring.Monitoring.KpiId getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface KpiOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.Kpi) + com.google.protobuf.MessageOrBuilder { + + /** + * <code>.monitoring.KpiId kpi_id = 1;</code> + * @return Whether the kpiId field is set. + */ + boolean hasKpiId(); + /** + * <code>.monitoring.KpiId kpi_id = 1;</code> + * @return The kpiId. + */ + monitoring.Monitoring.KpiId getKpiId(); + /** + * <code>.monitoring.KpiId kpi_id = 1;</code> + */ + monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder(); + + /** + * <code>string timestamp = 2;</code> + * @return The timestamp. + */ + java.lang.String getTimestamp(); + /** + * <code>string timestamp = 2;</code> + * @return The bytes for timestamp. + */ + com.google.protobuf.ByteString + getTimestampBytes(); + + /** + * <code>.monitoring.KpiValue kpi_value = 4;</code> + * @return Whether the kpiValue field is set. + */ + boolean hasKpiValue(); + /** + * <code>.monitoring.KpiValue kpi_value = 4;</code> + * @return The kpiValue. + */ + monitoring.Monitoring.KpiValue getKpiValue(); + /** + * <code>.monitoring.KpiValue kpi_value = 4;</code> + */ + monitoring.Monitoring.KpiValueOrBuilder getKpiValueOrBuilder(); + } + /** + * Protobuf type {@code monitoring.Kpi} + */ + public static final class Kpi extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.Kpi) + KpiOrBuilder { + private static final long serialVersionUID = 0L; + // Use Kpi.newBuilder() to construct. + private Kpi(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private Kpi() { + timestamp_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Kpi(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Kpi( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + monitoring.Monitoring.KpiId.Builder subBuilder = null; + if (kpiId_ != null) { + subBuilder = kpiId_.toBuilder(); + } + kpiId_ = input.readMessage(monitoring.Monitoring.KpiId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(kpiId_); + kpiId_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + timestamp_ = s; + break; + } + case 34: { + monitoring.Monitoring.KpiValue.Builder subBuilder = null; + if (kpiValue_ != null) { + subBuilder = kpiValue_.toBuilder(); + } + kpiValue_ = input.readMessage(monitoring.Monitoring.KpiValue.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(kpiValue_); + kpiValue_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_Kpi_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_Kpi_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.Kpi.class, monitoring.Monitoring.Kpi.Builder.class); + } + + public static final int KPI_ID_FIELD_NUMBER = 1; + private monitoring.Monitoring.KpiId kpiId_; + /** + * <code>.monitoring.KpiId kpi_id = 1;</code> + * @return Whether the kpiId field is set. + */ + @java.lang.Override + public boolean hasKpiId() { + return kpiId_ != null; + } + /** + * <code>.monitoring.KpiId kpi_id = 1;</code> + * @return The kpiId. + */ + @java.lang.Override + public monitoring.Monitoring.KpiId getKpiId() { + return kpiId_ == null ? monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } + /** + * <code>.monitoring.KpiId kpi_id = 1;</code> + */ + @java.lang.Override + public monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder() { + return getKpiId(); + } + + public static final int TIMESTAMP_FIELD_NUMBER = 2; + private volatile java.lang.Object timestamp_; + /** + * <code>string timestamp = 2;</code> + * @return The timestamp. + */ + @java.lang.Override + public java.lang.String getTimestamp() { + java.lang.Object ref = timestamp_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + timestamp_ = s; + return s; + } + } + /** + * <code>string timestamp = 2;</code> + * @return The bytes for timestamp. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTimestampBytes() { + java.lang.Object ref = timestamp_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + timestamp_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KPI_VALUE_FIELD_NUMBER = 4; + private monitoring.Monitoring.KpiValue kpiValue_; + /** + * <code>.monitoring.KpiValue kpi_value = 4;</code> + * @return Whether the kpiValue field is set. + */ + @java.lang.Override + public boolean hasKpiValue() { + return kpiValue_ != null; + } + /** + * <code>.monitoring.KpiValue kpi_value = 4;</code> + * @return The kpiValue. + */ + @java.lang.Override + public monitoring.Monitoring.KpiValue getKpiValue() { + return kpiValue_ == null ? monitoring.Monitoring.KpiValue.getDefaultInstance() : kpiValue_; + } + /** + * <code>.monitoring.KpiValue kpi_value = 4;</code> + */ + @java.lang.Override + public monitoring.Monitoring.KpiValueOrBuilder getKpiValueOrBuilder() { + return getKpiValue(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (kpiId_ != null) { + output.writeMessage(1, getKpiId()); + } + if (!getTimestampBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, timestamp_); + } + if (kpiValue_ != null) { + output.writeMessage(4, getKpiValue()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (kpiId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getKpiId()); + } + if (!getTimestampBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, timestamp_); + } + if (kpiValue_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getKpiValue()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof monitoring.Monitoring.Kpi)) { + return super.equals(obj); + } + monitoring.Monitoring.Kpi other = (monitoring.Monitoring.Kpi) obj; + + if (hasKpiId() != other.hasKpiId()) return false; + if (hasKpiId()) { + if (!getKpiId() + .equals(other.getKpiId())) return false; + } + if (!getTimestamp() + .equals(other.getTimestamp())) return false; + if (hasKpiValue() != other.hasKpiValue()) return false; + if (hasKpiValue()) { + if (!getKpiValue() + .equals(other.getKpiValue())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasKpiId()) { + hash = (37 * hash) + KPI_ID_FIELD_NUMBER; + hash = (53 * hash) + getKpiId().hashCode(); + } + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + getTimestamp().hashCode(); + if (hasKpiValue()) { + hash = (37 * hash) + KPI_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getKpiValue().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.Kpi parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.Kpi parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.Kpi parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.Kpi parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.Kpi parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.Kpi parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.Kpi parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.Kpi parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static monitoring.Monitoring.Kpi parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.Kpi parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static monitoring.Monitoring.Kpi parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.Kpi parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(monitoring.Monitoring.Kpi prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code monitoring.Kpi} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:monitoring.Kpi) + monitoring.Monitoring.KpiOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_Kpi_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_Kpi_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.Kpi.class, monitoring.Monitoring.Kpi.Builder.class); + } + + // Construct using monitoring.Monitoring.Kpi.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (kpiIdBuilder_ == null) { + kpiId_ = null; + } else { + kpiId_ = null; + kpiIdBuilder_ = null; + } + timestamp_ = ""; + + if (kpiValueBuilder_ == null) { + kpiValue_ = null; + } else { + kpiValue_ = null; + kpiValueBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_Kpi_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.Kpi getDefaultInstanceForType() { + return monitoring.Monitoring.Kpi.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.Kpi build() { + monitoring.Monitoring.Kpi result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.Kpi buildPartial() { + monitoring.Monitoring.Kpi result = new monitoring.Monitoring.Kpi(this); + if (kpiIdBuilder_ == null) { + result.kpiId_ = kpiId_; + } else { + result.kpiId_ = kpiIdBuilder_.build(); + } + result.timestamp_ = timestamp_; + if (kpiValueBuilder_ == null) { + result.kpiValue_ = kpiValue_; + } else { + result.kpiValue_ = kpiValueBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof monitoring.Monitoring.Kpi) { + return mergeFrom((monitoring.Monitoring.Kpi)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.Kpi other) { + if (other == monitoring.Monitoring.Kpi.getDefaultInstance()) return this; + if (other.hasKpiId()) { + mergeKpiId(other.getKpiId()); + } + if (!other.getTimestamp().isEmpty()) { + timestamp_ = other.timestamp_; + onChanged(); + } + if (other.hasKpiValue()) { + mergeKpiValue(other.getKpiValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + monitoring.Monitoring.Kpi parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.Kpi) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private monitoring.Monitoring.KpiId kpiId_; + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder> kpiIdBuilder_; + /** + * <code>.monitoring.KpiId kpi_id = 1;</code> + * @return Whether the kpiId field is set. + */ + public boolean hasKpiId() { + return kpiIdBuilder_ != null || kpiId_ != null; + } + /** + * <code>.monitoring.KpiId kpi_id = 1;</code> + * @return The kpiId. + */ + public monitoring.Monitoring.KpiId getKpiId() { + if (kpiIdBuilder_ == null) { + return kpiId_ == null ? monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } else { + return kpiIdBuilder_.getMessage(); + } + } + /** + * <code>.monitoring.KpiId kpi_id = 1;</code> + */ + public Builder setKpiId(monitoring.Monitoring.KpiId value) { + if (kpiIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kpiId_ = value; + onChanged(); + } else { + kpiIdBuilder_.setMessage(value); + } + + return this; + } + /** + * <code>.monitoring.KpiId kpi_id = 1;</code> + */ + public Builder setKpiId( + monitoring.Monitoring.KpiId.Builder builderForValue) { + if (kpiIdBuilder_ == null) { + kpiId_ = builderForValue.build(); + onChanged(); + } else { + kpiIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * <code>.monitoring.KpiId kpi_id = 1;</code> + */ + public Builder mergeKpiId(monitoring.Monitoring.KpiId value) { + if (kpiIdBuilder_ == null) { + if (kpiId_ != null) { + kpiId_ = + monitoring.Monitoring.KpiId.newBuilder(kpiId_).mergeFrom(value).buildPartial(); + } else { + kpiId_ = value; + } + onChanged(); + } else { + kpiIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * <code>.monitoring.KpiId kpi_id = 1;</code> + */ + public Builder clearKpiId() { + if (kpiIdBuilder_ == null) { + kpiId_ = null; + onChanged(); + } else { + kpiId_ = null; + kpiIdBuilder_ = null; + } + + return this; + } + /** + * <code>.monitoring.KpiId kpi_id = 1;</code> + */ + public monitoring.Monitoring.KpiId.Builder getKpiIdBuilder() { + + onChanged(); + return getKpiIdFieldBuilder().getBuilder(); + } + /** + * <code>.monitoring.KpiId kpi_id = 1;</code> + */ + public monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder() { + if (kpiIdBuilder_ != null) { + return kpiIdBuilder_.getMessageOrBuilder(); + } else { + return kpiId_ == null ? + monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } + } + /** + * <code>.monitoring.KpiId kpi_id = 1;</code> + */ + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder> + getKpiIdFieldBuilder() { + if (kpiIdBuilder_ == null) { + kpiIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder>( + getKpiId(), + getParentForChildren(), + isClean()); + kpiId_ = null; + } + return kpiIdBuilder_; + } + + private java.lang.Object timestamp_ = ""; + /** + * <code>string timestamp = 2;</code> + * @return The timestamp. + */ + public java.lang.String getTimestamp() { + java.lang.Object ref = timestamp_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + timestamp_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * <code>string timestamp = 2;</code> + * @return The bytes for timestamp. + */ + public com.google.protobuf.ByteString + getTimestampBytes() { + java.lang.Object ref = timestamp_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + timestamp_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * <code>string timestamp = 2;</code> + * @param value The timestamp to set. + * @return This builder for chaining. + */ + public Builder setTimestamp( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + timestamp_ = value; + onChanged(); + return this; + } + /** + * <code>string timestamp = 2;</code> + * @return This builder for chaining. + */ + public Builder clearTimestamp() { + + timestamp_ = getDefaultInstance().getTimestamp(); + onChanged(); + return this; + } + /** + * <code>string timestamp = 2;</code> + * @param value The bytes for timestamp to set. + * @return This builder for chaining. + */ + public Builder setTimestampBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + timestamp_ = value; + onChanged(); + return this; + } + + private monitoring.Monitoring.KpiValue kpiValue_; + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiValue, monitoring.Monitoring.KpiValue.Builder, monitoring.Monitoring.KpiValueOrBuilder> kpiValueBuilder_; + /** + * <code>.monitoring.KpiValue kpi_value = 4;</code> + * @return Whether the kpiValue field is set. + */ + public boolean hasKpiValue() { + return kpiValueBuilder_ != null || kpiValue_ != null; + } + /** + * <code>.monitoring.KpiValue kpi_value = 4;</code> + * @return The kpiValue. + */ + public monitoring.Monitoring.KpiValue getKpiValue() { + if (kpiValueBuilder_ == null) { + return kpiValue_ == null ? monitoring.Monitoring.KpiValue.getDefaultInstance() : kpiValue_; + } else { + return kpiValueBuilder_.getMessage(); + } + } + /** + * <code>.monitoring.KpiValue kpi_value = 4;</code> + */ + public Builder setKpiValue(monitoring.Monitoring.KpiValue value) { + if (kpiValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kpiValue_ = value; + onChanged(); + } else { + kpiValueBuilder_.setMessage(value); + } + + return this; + } + /** + * <code>.monitoring.KpiValue kpi_value = 4;</code> + */ + public Builder setKpiValue( + monitoring.Monitoring.KpiValue.Builder builderForValue) { + if (kpiValueBuilder_ == null) { + kpiValue_ = builderForValue.build(); + onChanged(); + } else { + kpiValueBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * <code>.monitoring.KpiValue kpi_value = 4;</code> + */ + public Builder mergeKpiValue(monitoring.Monitoring.KpiValue value) { + if (kpiValueBuilder_ == null) { + if (kpiValue_ != null) { + kpiValue_ = + monitoring.Monitoring.KpiValue.newBuilder(kpiValue_).mergeFrom(value).buildPartial(); + } else { + kpiValue_ = value; + } + onChanged(); + } else { + kpiValueBuilder_.mergeFrom(value); + } + + return this; + } + /** + * <code>.monitoring.KpiValue kpi_value = 4;</code> + */ + public Builder clearKpiValue() { + if (kpiValueBuilder_ == null) { + kpiValue_ = null; + onChanged(); + } else { + kpiValue_ = null; + kpiValueBuilder_ = null; + } + + return this; + } + /** + * <code>.monitoring.KpiValue kpi_value = 4;</code> + */ + public monitoring.Monitoring.KpiValue.Builder getKpiValueBuilder() { + + onChanged(); + return getKpiValueFieldBuilder().getBuilder(); + } + /** + * <code>.monitoring.KpiValue kpi_value = 4;</code> + */ + public monitoring.Monitoring.KpiValueOrBuilder getKpiValueOrBuilder() { + if (kpiValueBuilder_ != null) { + return kpiValueBuilder_.getMessageOrBuilder(); + } else { + return kpiValue_ == null ? + monitoring.Monitoring.KpiValue.getDefaultInstance() : kpiValue_; + } + } + /** + * <code>.monitoring.KpiValue kpi_value = 4;</code> + */ + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiValue, monitoring.Monitoring.KpiValue.Builder, monitoring.Monitoring.KpiValueOrBuilder> + getKpiValueFieldBuilder() { + if (kpiValueBuilder_ == null) { + kpiValueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiValue, monitoring.Monitoring.KpiValue.Builder, monitoring.Monitoring.KpiValueOrBuilder>( + getKpiValue(), + getParentForChildren(), + isClean()); + kpiValue_ = null; + } + return kpiValueBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:monitoring.Kpi) + } + + // @@protoc_insertion_point(class_scope:monitoring.Kpi) + private static final monitoring.Monitoring.Kpi DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.Kpi(); + } + + public static monitoring.Monitoring.Kpi getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<Kpi> + PARSER = new com.google.protobuf.AbstractParser<Kpi>() { + @java.lang.Override + public Kpi parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Kpi(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<Kpi> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<Kpi> getParserForType() { + return PARSER; + } + + @java.lang.Override + public monitoring.Monitoring.Kpi getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface KpiValueOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.KpiValue) + com.google.protobuf.MessageOrBuilder { + + /** + * <code>uint32 intVal = 1;</code> + * @return Whether the intVal field is set. + */ + boolean hasIntVal(); + /** + * <code>uint32 intVal = 1;</code> + * @return The intVal. + */ + int getIntVal(); + + /** + * <code>float floatVal = 2;</code> + * @return Whether the floatVal field is set. + */ + boolean hasFloatVal(); + /** + * <code>float floatVal = 2;</code> + * @return The floatVal. + */ + float getFloatVal(); + + /** + * <code>string stringVal = 3;</code> + * @return Whether the stringVal field is set. + */ + boolean hasStringVal(); + /** + * <code>string stringVal = 3;</code> + * @return The stringVal. + */ + java.lang.String getStringVal(); + /** + * <code>string stringVal = 3;</code> + * @return The bytes for stringVal. + */ + com.google.protobuf.ByteString + getStringValBytes(); + + /** + * <code>bool boolVal = 4;</code> + * @return Whether the boolVal field is set. + */ + boolean hasBoolVal(); + /** + * <code>bool boolVal = 4;</code> + * @return The boolVal. + */ + boolean getBoolVal(); + + public monitoring.Monitoring.KpiValue.ValueCase getValueCase(); + } + /** + * Protobuf type {@code monitoring.KpiValue} + */ + public static final class KpiValue extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.KpiValue) + KpiValueOrBuilder { + private static final long serialVersionUID = 0L; + // Use KpiValue.newBuilder() to construct. + private KpiValue(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private KpiValue() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new KpiValue(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private KpiValue( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + valueCase_ = 1; + value_ = input.readUInt32(); + break; + } + case 21: { + valueCase_ = 2; + value_ = input.readFloat(); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + valueCase_ = 3; + value_ = s; + break; + } + case 32: { + valueCase_ = 4; + value_ = input.readBool(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_KpiValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_KpiValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.KpiValue.class, monitoring.Monitoring.KpiValue.Builder.class); + } + + private int valueCase_ = 0; + private java.lang.Object value_; + public enum ValueCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + INTVAL(1), + FLOATVAL(2), + STRINGVAL(3), + BOOLVAL(4), + VALUE_NOT_SET(0); + private final int value; + private ValueCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ValueCase valueOf(int value) { + return forNumber(value); + } + + public static ValueCase forNumber(int value) { + switch (value) { + case 1: return INTVAL; + case 2: return FLOATVAL; + case 3: return STRINGVAL; + case 4: return BOOLVAL; + case 0: return VALUE_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public ValueCase + getValueCase() { + return ValueCase.forNumber( + valueCase_); + } + + public static final int INTVAL_FIELD_NUMBER = 1; + /** + * <code>uint32 intVal = 1;</code> + * @return Whether the intVal field is set. + */ + @java.lang.Override + public boolean hasIntVal() { + return valueCase_ == 1; + } + /** + * <code>uint32 intVal = 1;</code> + * @return The intVal. + */ + @java.lang.Override + public int getIntVal() { + if (valueCase_ == 1) { + return (java.lang.Integer) value_; + } + return 0; + } + + public static final int FLOATVAL_FIELD_NUMBER = 2; + /** + * <code>float floatVal = 2;</code> + * @return Whether the floatVal field is set. + */ + @java.lang.Override + public boolean hasFloatVal() { + return valueCase_ == 2; + } + /** + * <code>float floatVal = 2;</code> + * @return The floatVal. + */ + @java.lang.Override + public float getFloatVal() { + if (valueCase_ == 2) { + return (java.lang.Float) value_; + } + return 0F; + } + + public static final int STRINGVAL_FIELD_NUMBER = 3; + /** + * <code>string stringVal = 3;</code> + * @return Whether the stringVal field is set. + */ + public boolean hasStringVal() { + return valueCase_ == 3; + } + /** + * <code>string stringVal = 3;</code> + * @return The stringVal. + */ + public java.lang.String getStringVal() { + java.lang.Object ref = ""; + if (valueCase_ == 3) { + ref = value_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (valueCase_ == 3) { + value_ = s; + } + return s; + } + } + /** + * <code>string stringVal = 3;</code> + * @return The bytes for stringVal. + */ + public com.google.protobuf.ByteString + getStringValBytes() { + java.lang.Object ref = ""; + if (valueCase_ == 3) { + ref = value_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (valueCase_ == 3) { + value_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BOOLVAL_FIELD_NUMBER = 4; + /** + * <code>bool boolVal = 4;</code> + * @return Whether the boolVal field is set. + */ + @java.lang.Override + public boolean hasBoolVal() { + return valueCase_ == 4; + } + /** + * <code>bool boolVal = 4;</code> + * @return The boolVal. + */ + @java.lang.Override + public boolean getBoolVal() { + if (valueCase_ == 4) { + return (java.lang.Boolean) value_; + } + return false; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (valueCase_ == 1) { + output.writeUInt32( + 1, (int)((java.lang.Integer) value_)); + } + if (valueCase_ == 2) { + output.writeFloat( + 2, (float)((java.lang.Float) value_)); + } + if (valueCase_ == 3) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, value_); + } + if (valueCase_ == 4) { + output.writeBool( + 4, (boolean)((java.lang.Boolean) value_)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (valueCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size( + 1, (int)((java.lang.Integer) value_)); + } + if (valueCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize( + 2, (float)((java.lang.Float) value_)); + } + if (valueCase_ == 3) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, value_); + } + if (valueCase_ == 4) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize( + 4, (boolean)((java.lang.Boolean) value_)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof monitoring.Monitoring.KpiValue)) { + return super.equals(obj); + } + monitoring.Monitoring.KpiValue other = (monitoring.Monitoring.KpiValue) obj; + + if (!getValueCase().equals(other.getValueCase())) return false; + switch (valueCase_) { + case 1: + if (getIntVal() + != other.getIntVal()) return false; + break; + case 2: + if (java.lang.Float.floatToIntBits(getFloatVal()) + != java.lang.Float.floatToIntBits( + other.getFloatVal())) return false; + break; + case 3: + if (!getStringVal() + .equals(other.getStringVal())) return false; + break; + case 4: + if (getBoolVal() + != other.getBoolVal()) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (valueCase_) { + case 1: + hash = (37 * hash) + INTVAL_FIELD_NUMBER; + hash = (53 * hash) + getIntVal(); + break; + case 2: + hash = (37 * hash) + FLOATVAL_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getFloatVal()); + break; + case 3: + hash = (37 * hash) + STRINGVAL_FIELD_NUMBER; + hash = (53 * hash) + getStringVal().hashCode(); + break; + case 4: + hash = (37 * hash) + BOOLVAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getBoolVal()); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.KpiValue parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiValue parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiValue parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiValue parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiValue parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiValue parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiValue parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiValue parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static monitoring.Monitoring.KpiValue parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiValue parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static monitoring.Monitoring.KpiValue parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiValue parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(monitoring.Monitoring.KpiValue prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code monitoring.KpiValue} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:monitoring.KpiValue) + monitoring.Monitoring.KpiValueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_KpiValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_KpiValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.KpiValue.class, monitoring.Monitoring.KpiValue.Builder.class); + } + + // Construct using monitoring.Monitoring.KpiValue.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + valueCase_ = 0; + value_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_KpiValue_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.KpiValue getDefaultInstanceForType() { + return monitoring.Monitoring.KpiValue.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.KpiValue build() { + monitoring.Monitoring.KpiValue result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.KpiValue buildPartial() { + monitoring.Monitoring.KpiValue result = new monitoring.Monitoring.KpiValue(this); + if (valueCase_ == 1) { + result.value_ = value_; + } + if (valueCase_ == 2) { + result.value_ = value_; + } + if (valueCase_ == 3) { + result.value_ = value_; + } + if (valueCase_ == 4) { + result.value_ = value_; + } + result.valueCase_ = valueCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof monitoring.Monitoring.KpiValue) { + return mergeFrom((monitoring.Monitoring.KpiValue)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.KpiValue other) { + if (other == monitoring.Monitoring.KpiValue.getDefaultInstance()) return this; + switch (other.getValueCase()) { + case INTVAL: { + setIntVal(other.getIntVal()); + break; + } + case FLOATVAL: { + setFloatVal(other.getFloatVal()); + break; + } + case STRINGVAL: { + valueCase_ = 3; + value_ = other.value_; + onChanged(); + break; + } + case BOOLVAL: { + setBoolVal(other.getBoolVal()); + break; + } + case VALUE_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + monitoring.Monitoring.KpiValue parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.KpiValue) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int valueCase_ = 0; + private java.lang.Object value_; + public ValueCase + getValueCase() { + return ValueCase.forNumber( + valueCase_); + } + + public Builder clearValue() { + valueCase_ = 0; + value_ = null; + onChanged(); + return this; + } + + + /** + * <code>uint32 intVal = 1;</code> + * @return Whether the intVal field is set. + */ + public boolean hasIntVal() { + return valueCase_ == 1; + } + /** + * <code>uint32 intVal = 1;</code> + * @return The intVal. + */ + public int getIntVal() { + if (valueCase_ == 1) { + return (java.lang.Integer) value_; + } + return 0; + } + /** + * <code>uint32 intVal = 1;</code> + * @param value The intVal to set. + * @return This builder for chaining. + */ + public Builder setIntVal(int value) { + valueCase_ = 1; + value_ = value; + onChanged(); + return this; + } + /** + * <code>uint32 intVal = 1;</code> + * @return This builder for chaining. + */ + public Builder clearIntVal() { + if (valueCase_ == 1) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + return this; + } + + /** + * <code>float floatVal = 2;</code> + * @return Whether the floatVal field is set. + */ + public boolean hasFloatVal() { + return valueCase_ == 2; + } + /** + * <code>float floatVal = 2;</code> + * @return The floatVal. + */ + public float getFloatVal() { + if (valueCase_ == 2) { + return (java.lang.Float) value_; + } + return 0F; + } + /** + * <code>float floatVal = 2;</code> + * @param value The floatVal to set. + * @return This builder for chaining. + */ + public Builder setFloatVal(float value) { + valueCase_ = 2; + value_ = value; + onChanged(); + return this; + } + /** + * <code>float floatVal = 2;</code> + * @return This builder for chaining. + */ + public Builder clearFloatVal() { + if (valueCase_ == 2) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + return this; + } + + /** + * <code>string stringVal = 3;</code> + * @return Whether the stringVal field is set. + */ + @java.lang.Override + public boolean hasStringVal() { + return valueCase_ == 3; + } + /** + * <code>string stringVal = 3;</code> + * @return The stringVal. + */ + @java.lang.Override + public java.lang.String getStringVal() { + java.lang.Object ref = ""; + if (valueCase_ == 3) { + ref = value_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (valueCase_ == 3) { + value_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * <code>string stringVal = 3;</code> + * @return The bytes for stringVal. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getStringValBytes() { + java.lang.Object ref = ""; + if (valueCase_ == 3) { + ref = value_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (valueCase_ == 3) { + value_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * <code>string stringVal = 3;</code> + * @param value The stringVal to set. + * @return This builder for chaining. + */ + public Builder setStringVal( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + valueCase_ = 3; + value_ = value; + onChanged(); + return this; + } + /** + * <code>string stringVal = 3;</code> + * @return This builder for chaining. + */ + public Builder clearStringVal() { + if (valueCase_ == 3) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + return this; + } + /** + * <code>string stringVal = 3;</code> + * @param value The bytes for stringVal to set. + * @return This builder for chaining. + */ + public Builder setStringValBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + valueCase_ = 3; + value_ = value; + onChanged(); + return this; + } + + /** + * <code>bool boolVal = 4;</code> + * @return Whether the boolVal field is set. + */ + public boolean hasBoolVal() { + return valueCase_ == 4; + } + /** + * <code>bool boolVal = 4;</code> + * @return The boolVal. + */ + public boolean getBoolVal() { + if (valueCase_ == 4) { + return (java.lang.Boolean) value_; + } + return false; + } + /** + * <code>bool boolVal = 4;</code> + * @param value The boolVal to set. + * @return This builder for chaining. + */ + public Builder setBoolVal(boolean value) { + valueCase_ = 4; + value_ = value; + onChanged(); + return this; + } + /** + * <code>bool boolVal = 4;</code> + * @return This builder for chaining. + */ + public Builder clearBoolVal() { + if (valueCase_ == 4) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:monitoring.KpiValue) + } + + // @@protoc_insertion_point(class_scope:monitoring.KpiValue) + private static final monitoring.Monitoring.KpiValue DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.KpiValue(); + } + + public static monitoring.Monitoring.KpiValue getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<KpiValue> + PARSER = new com.google.protobuf.AbstractParser<KpiValue>() { + @java.lang.Override + public KpiValue parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new KpiValue(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<KpiValue> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<KpiValue> getParserForType() { + return PARSER; + } + + @java.lang.Override + public monitoring.Monitoring.KpiValue getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface KpiListOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.KpiList) + com.google.protobuf.MessageOrBuilder { + + /** + * <code>repeated .monitoring.Kpi kpi_list = 1;</code> + */ + java.util.List<monitoring.Monitoring.Kpi> + getKpiListList(); + /** + * <code>repeated .monitoring.Kpi kpi_list = 1;</code> + */ + monitoring.Monitoring.Kpi getKpiList(int index); + /** + * <code>repeated .monitoring.Kpi kpi_list = 1;</code> + */ + int getKpiListCount(); + /** + * <code>repeated .monitoring.Kpi kpi_list = 1;</code> + */ + java.util.List<? extends monitoring.Monitoring.KpiOrBuilder> + getKpiListOrBuilderList(); + /** + * <code>repeated .monitoring.Kpi kpi_list = 1;</code> + */ + monitoring.Monitoring.KpiOrBuilder getKpiListOrBuilder( + int index); + } + /** + * Protobuf type {@code monitoring.KpiList} + */ + public static final class KpiList extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.KpiList) + KpiListOrBuilder { + private static final long serialVersionUID = 0L; + // Use KpiList.newBuilder() to construct. + private KpiList(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private KpiList() { + kpiList_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new KpiList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private KpiList( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + kpiList_ = new java.util.ArrayList<monitoring.Monitoring.Kpi>(); + mutable_bitField0_ |= 0x00000001; + } + kpiList_.add( + input.readMessage(monitoring.Monitoring.Kpi.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + kpiList_ = java.util.Collections.unmodifiableList(kpiList_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_KpiList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_KpiList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.KpiList.class, monitoring.Monitoring.KpiList.Builder.class); + } + + public static final int KPI_LIST_FIELD_NUMBER = 1; + private java.util.List<monitoring.Monitoring.Kpi> kpiList_; + /** + * <code>repeated .monitoring.Kpi kpi_list = 1;</code> + */ + @java.lang.Override + public java.util.List<monitoring.Monitoring.Kpi> getKpiListList() { + return kpiList_; + } + /** + * <code>repeated .monitoring.Kpi kpi_list = 1;</code> + */ + @java.lang.Override + public java.util.List<? extends monitoring.Monitoring.KpiOrBuilder> + getKpiListOrBuilderList() { + return kpiList_; + } + /** + * <code>repeated .monitoring.Kpi kpi_list = 1;</code> + */ + @java.lang.Override + public int getKpiListCount() { + return kpiList_.size(); + } + /** + * <code>repeated .monitoring.Kpi kpi_list = 1;</code> + */ + @java.lang.Override + public monitoring.Monitoring.Kpi getKpiList(int index) { + return kpiList_.get(index); + } + /** + * <code>repeated .monitoring.Kpi kpi_list = 1;</code> + */ + @java.lang.Override + public monitoring.Monitoring.KpiOrBuilder getKpiListOrBuilder( + int index) { + return kpiList_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < kpiList_.size(); i++) { + output.writeMessage(1, kpiList_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < kpiList_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, kpiList_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof monitoring.Monitoring.KpiList)) { + return super.equals(obj); + } + monitoring.Monitoring.KpiList other = (monitoring.Monitoring.KpiList) obj; + + if (!getKpiListList() + .equals(other.getKpiListList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getKpiListCount() > 0) { + hash = (37 * hash) + KPI_LIST_FIELD_NUMBER; + hash = (53 * hash) + getKpiListList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.KpiList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiList parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiList parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static monitoring.Monitoring.KpiList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiList parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static monitoring.Monitoring.KpiList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiList parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(monitoring.Monitoring.KpiList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code monitoring.KpiList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:monitoring.KpiList) + monitoring.Monitoring.KpiListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_KpiList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_KpiList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.KpiList.class, monitoring.Monitoring.KpiList.Builder.class); + } + + // Construct using monitoring.Monitoring.KpiList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getKpiListFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (kpiListBuilder_ == null) { + kpiList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + kpiListBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_KpiList_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.KpiList getDefaultInstanceForType() { + return monitoring.Monitoring.KpiList.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.KpiList build() { + monitoring.Monitoring.KpiList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.KpiList buildPartial() { + monitoring.Monitoring.KpiList result = new monitoring.Monitoring.KpiList(this); + int from_bitField0_ = bitField0_; + if (kpiListBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + kpiList_ = java.util.Collections.unmodifiableList(kpiList_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.kpiList_ = kpiList_; + } else { + result.kpiList_ = kpiListBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof monitoring.Monitoring.KpiList) { + return mergeFrom((monitoring.Monitoring.KpiList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.KpiList other) { + if (other == monitoring.Monitoring.KpiList.getDefaultInstance()) return this; + if (kpiListBuilder_ == null) { + if (!other.kpiList_.isEmpty()) { + if (kpiList_.isEmpty()) { + kpiList_ = other.kpiList_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureKpiListIsMutable(); + kpiList_.addAll(other.kpiList_); + } + onChanged(); + } + } else { + if (!other.kpiList_.isEmpty()) { + if (kpiListBuilder_.isEmpty()) { + kpiListBuilder_.dispose(); + kpiListBuilder_ = null; + kpiList_ = other.kpiList_; + bitField0_ = (bitField0_ & ~0x00000001); + kpiListBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getKpiListFieldBuilder() : null; + } else { + kpiListBuilder_.addAllMessages(other.kpiList_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + monitoring.Monitoring.KpiList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.KpiList) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List<monitoring.Monitoring.Kpi> kpiList_ = + java.util.Collections.emptyList(); + private void ensureKpiListIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + kpiList_ = new java.util.ArrayList<monitoring.Monitoring.Kpi>(kpiList_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.Kpi, monitoring.Monitoring.Kpi.Builder, monitoring.Monitoring.KpiOrBuilder> kpiListBuilder_; + + /** + * <code>repeated .monitoring.Kpi kpi_list = 1;</code> + */ + public java.util.List<monitoring.Monitoring.Kpi> getKpiListList() { + if (kpiListBuilder_ == null) { + return java.util.Collections.unmodifiableList(kpiList_); + } else { + return kpiListBuilder_.getMessageList(); + } + } + /** + * <code>repeated .monitoring.Kpi kpi_list = 1;</code> + */ + public int getKpiListCount() { + if (kpiListBuilder_ == null) { + return kpiList_.size(); + } else { + return kpiListBuilder_.getCount(); + } + } + /** + * <code>repeated .monitoring.Kpi kpi_list = 1;</code> + */ + public monitoring.Monitoring.Kpi getKpiList(int index) { + if (kpiListBuilder_ == null) { + return kpiList_.get(index); + } else { + return kpiListBuilder_.getMessage(index); + } + } + /** + * <code>repeated .monitoring.Kpi kpi_list = 1;</code> + */ + public Builder setKpiList( + int index, monitoring.Monitoring.Kpi value) { + if (kpiListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKpiListIsMutable(); + kpiList_.set(index, value); + onChanged(); + } else { + kpiListBuilder_.setMessage(index, value); + } + return this; + } + /** + * <code>repeated .monitoring.Kpi kpi_list = 1;</code> + */ + public Builder setKpiList( + int index, monitoring.Monitoring.Kpi.Builder builderForValue) { + if (kpiListBuilder_ == null) { + ensureKpiListIsMutable(); + kpiList_.set(index, builderForValue.build()); + onChanged(); + } else { + kpiListBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * <code>repeated .monitoring.Kpi kpi_list = 1;</code> + */ + public Builder addKpiList(monitoring.Monitoring.Kpi value) { + if (kpiListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKpiListIsMutable(); + kpiList_.add(value); + onChanged(); + } else { + kpiListBuilder_.addMessage(value); + } + return this; + } + /** + * <code>repeated .monitoring.Kpi kpi_list = 1;</code> + */ + public Builder addKpiList( + int index, monitoring.Monitoring.Kpi value) { + if (kpiListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKpiListIsMutable(); + kpiList_.add(index, value); + onChanged(); + } else { + kpiListBuilder_.addMessage(index, value); + } + return this; + } + /** + * <code>repeated .monitoring.Kpi kpi_list = 1;</code> + */ + public Builder addKpiList( + monitoring.Monitoring.Kpi.Builder builderForValue) { + if (kpiListBuilder_ == null) { + ensureKpiListIsMutable(); + kpiList_.add(builderForValue.build()); + onChanged(); + } else { + kpiListBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * <code>repeated .monitoring.Kpi kpi_list = 1;</code> + */ + public Builder addKpiList( + int index, monitoring.Monitoring.Kpi.Builder builderForValue) { + if (kpiListBuilder_ == null) { + ensureKpiListIsMutable(); + kpiList_.add(index, builderForValue.build()); + onChanged(); + } else { + kpiListBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * <code>repeated .monitoring.Kpi kpi_list = 1;</code> + */ + public Builder addAllKpiList( + java.lang.Iterable<? extends monitoring.Monitoring.Kpi> values) { + if (kpiListBuilder_ == null) { + ensureKpiListIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, kpiList_); + onChanged(); + } else { + kpiListBuilder_.addAllMessages(values); + } + return this; + } + /** + * <code>repeated .monitoring.Kpi kpi_list = 1;</code> + */ + public Builder clearKpiList() { + if (kpiListBuilder_ == null) { + kpiList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + kpiListBuilder_.clear(); + } + return this; + } + /** + * <code>repeated .monitoring.Kpi kpi_list = 1;</code> + */ + public Builder removeKpiList(int index) { + if (kpiListBuilder_ == null) { + ensureKpiListIsMutable(); + kpiList_.remove(index); + onChanged(); + } else { + kpiListBuilder_.remove(index); + } + return this; + } + /** + * <code>repeated .monitoring.Kpi kpi_list = 1;</code> + */ + public monitoring.Monitoring.Kpi.Builder getKpiListBuilder( + int index) { + return getKpiListFieldBuilder().getBuilder(index); + } + /** + * <code>repeated .monitoring.Kpi kpi_list = 1;</code> + */ + public monitoring.Monitoring.KpiOrBuilder getKpiListOrBuilder( + int index) { + if (kpiListBuilder_ == null) { + return kpiList_.get(index); } else { + return kpiListBuilder_.getMessageOrBuilder(index); + } + } + /** + * <code>repeated .monitoring.Kpi kpi_list = 1;</code> + */ + public java.util.List<? extends monitoring.Monitoring.KpiOrBuilder> + getKpiListOrBuilderList() { + if (kpiListBuilder_ != null) { + return kpiListBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(kpiList_); + } + } + /** + * <code>repeated .monitoring.Kpi kpi_list = 1;</code> + */ + public monitoring.Monitoring.Kpi.Builder addKpiListBuilder() { + return getKpiListFieldBuilder().addBuilder( + monitoring.Monitoring.Kpi.getDefaultInstance()); + } + /** + * <code>repeated .monitoring.Kpi kpi_list = 1;</code> + */ + public monitoring.Monitoring.Kpi.Builder addKpiListBuilder( + int index) { + return getKpiListFieldBuilder().addBuilder( + index, monitoring.Monitoring.Kpi.getDefaultInstance()); + } + /** + * <code>repeated .monitoring.Kpi kpi_list = 1;</code> + */ + public java.util.List<monitoring.Monitoring.Kpi.Builder> + getKpiListBuilderList() { + return getKpiListFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.Kpi, monitoring.Monitoring.Kpi.Builder, monitoring.Monitoring.KpiOrBuilder> + getKpiListFieldBuilder() { + if (kpiListBuilder_ == null) { + kpiListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.Kpi, monitoring.Monitoring.Kpi.Builder, monitoring.Monitoring.KpiOrBuilder>( + kpiList_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + kpiList_ = null; + } + return kpiListBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:monitoring.KpiList) + } + + // @@protoc_insertion_point(class_scope:monitoring.KpiList) + private static final monitoring.Monitoring.KpiList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.KpiList(); + } + + public static monitoring.Monitoring.KpiList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<KpiList> + PARSER = new com.google.protobuf.AbstractParser<KpiList>() { + @java.lang.Override + public KpiList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new KpiList(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<KpiList> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<KpiList> getParserForType() { + return PARSER; + } + + @java.lang.Override + public monitoring.Monitoring.KpiList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_KpiDescriptor_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_KpiDescriptor_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_MonitorKpiRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_MonitorKpiRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_KpiId_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_KpiId_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_Kpi_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_Kpi_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_KpiValue_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_KpiValue_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_KpiList_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_KpiList_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\020monitoring.proto\022\nmonitoring\032\rcontext." + + "proto\032\026kpi_sample_types.proto\"\332\001\n\rKpiDes" + + "criptor\022\027\n\017kpi_description\030\001 \001(\t\0228\n\017kpi_" + + "sample_type\030\002 \001(\0162\037.kpi_sample_types.Kpi" + + "SampleType\022$\n\tdevice_id\030\003 \001(\0132\021.context." + + "DeviceId\022(\n\013endpoint_id\030\004 \001(\0132\023.context." + + "EndPointId\022&\n\nservice_id\030\005 \001(\0132\022.context" + + ".ServiceId\"p\n\021MonitorKpiRequest\022!\n\006kpi_i" + + "d\030\001 \001(\0132\021.monitoring.KpiId\022\033\n\023sampling_d" + + "uration_s\030\002 \001(\002\022\033\n\023sampling_interval_s\030\003" + + " \001(\002\"&\n\005KpiId\022\035\n\006kpi_id\030\001 \001(\0132\r.context." + + "Uuid\"d\n\003Kpi\022!\n\006kpi_id\030\001 \001(\0132\021.monitoring" + + ".KpiId\022\021\n\ttimestamp\030\002 \001(\t\022\'\n\tkpi_value\030\004" + + " \001(\0132\024.monitoring.KpiValue\"a\n\010KpiValue\022\020" + + "\n\006intVal\030\001 \001(\rH\000\022\022\n\010floatVal\030\002 \001(\002H\000\022\023\n\t" + + "stringVal\030\003 \001(\tH\000\022\021\n\007boolVal\030\004 \001(\010H\000B\007\n\005" + + "value\",\n\007KpiList\022!\n\010kpi_list\030\001 \003(\0132\017.mon" + + "itoring.Kpi2\363\002\n\021MonitoringService\022;\n\tCre" + + "ateKpi\022\031.monitoring.KpiDescriptor\032\021.moni" + + "toring.KpiId\"\000\022B\n\020GetKpiDescriptor\022\021.mon" + + "itoring.KpiId\032\031.monitoring.KpiDescriptor" + + "\"\000\022/\n\nIncludeKpi\022\017.monitoring.Kpi\032\016.cont" + + "ext.Empty\"\000\022=\n\nMonitorKpi\022\035.monitoring.M" + + "onitorKpiRequest\032\016.context.Empty\"\000\0226\n\014Ge" + + "tStreamKpi\022\021.monitoring.KpiId\032\017.monitori" + + "ng.Kpi\"\0000\001\0225\n\rGetInstantKpi\022\021.monitoring" + + ".KpiId\032\017.monitoring.Kpi\"\000b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + context.ContextOuterClass.getDescriptor(), + kpi_sample_types.KpiSampleTypes.getDescriptor(), + }); + internal_static_monitoring_KpiDescriptor_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_monitoring_KpiDescriptor_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_KpiDescriptor_descriptor, + new java.lang.String[] { "KpiDescription", "KpiSampleType", "DeviceId", "EndpointId", "ServiceId", }); + internal_static_monitoring_MonitorKpiRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_monitoring_MonitorKpiRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_MonitorKpiRequest_descriptor, + new java.lang.String[] { "KpiId", "SamplingDurationS", "SamplingIntervalS", }); + internal_static_monitoring_KpiId_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_monitoring_KpiId_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_KpiId_descriptor, + new java.lang.String[] { "KpiId", }); + internal_static_monitoring_Kpi_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_monitoring_Kpi_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_Kpi_descriptor, + new java.lang.String[] { "KpiId", "Timestamp", "KpiValue", }); + internal_static_monitoring_KpiValue_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_monitoring_KpiValue_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_KpiValue_descriptor, + new java.lang.String[] { "IntVal", "FloatVal", "StringVal", "BoolVal", "Value", }); + internal_static_monitoring_KpiList_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_monitoring_KpiList_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_KpiList_descriptor, + new java.lang.String[] { "KpiList", }); + context.ContextOuterClass.getDescriptor(); + kpi_sample_types.KpiSampleTypes.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/src/policy/target/generated-sources/grpc/monitoring/MonitoringService.java b/src/policy/target/generated-sources/grpc/monitoring/MonitoringService.java new file mode 100644 index 0000000000000000000000000000000000000000..480e193125e51851a72e18473c139d71190bab11 --- /dev/null +++ b/src/policy/target/generated-sources/grpc/monitoring/MonitoringService.java @@ -0,0 +1,26 @@ +package monitoring; + +import io.quarkus.grpc.runtime.MutinyService; + +@javax.annotation.Generated( +value = "by Mutiny Grpc generator", +comments = "Source: monitoring.proto") +public interface MonitoringService extends MutinyService { + + + io.smallrye.mutiny.Uni<monitoring.Monitoring.KpiId> createKpi(monitoring.Monitoring.KpiDescriptor request); + + io.smallrye.mutiny.Uni<monitoring.Monitoring.KpiDescriptor> getKpiDescriptor(monitoring.Monitoring.KpiId request); + + io.smallrye.mutiny.Uni<context.ContextOuterClass.Empty> includeKpi(monitoring.Monitoring.Kpi request); + + io.smallrye.mutiny.Uni<context.ContextOuterClass.Empty> monitorKpi(monitoring.Monitoring.MonitorKpiRequest request); + + io.smallrye.mutiny.Uni<monitoring.Monitoring.Kpi> getInstantKpi(monitoring.Monitoring.KpiId request); + + + io.smallrye.mutiny.Multi<monitoring.Monitoring.Kpi> getStreamKpi(monitoring.Monitoring.KpiId request); + + + +} \ No newline at end of file diff --git a/src/policy/target/generated-sources/grpc/monitoring/MonitoringServiceBean.java b/src/policy/target/generated-sources/grpc/monitoring/MonitoringServiceBean.java new file mode 100644 index 0000000000000000000000000000000000000000..b0b2f5abd4144d8f6e41c2613a36c5b78051dd57 --- /dev/null +++ b/src/policy/target/generated-sources/grpc/monitoring/MonitoringServiceBean.java @@ -0,0 +1,68 @@ +package monitoring; + +import io.grpc.BindableService; +import io.quarkus.grpc.GrpcService; +import io.quarkus.grpc.runtime.MutinyBean; + +@javax.annotation.Generated( +value = "by Mutiny Grpc generator", +comments = "Source: monitoring.proto") +public class MonitoringServiceBean extends MutinyMonitoringServiceGrpc.MonitoringServiceImplBase implements BindableService, MutinyBean { + + private final MonitoringService delegate; + + MonitoringServiceBean(@GrpcService MonitoringService delegate) { + this.delegate = delegate; + } + + @Override + public io.smallrye.mutiny.Uni<monitoring.Monitoring.KpiId> createKpi(monitoring.Monitoring.KpiDescriptor request) { + try { + return delegate.createKpi(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni<monitoring.Monitoring.KpiDescriptor> getKpiDescriptor(monitoring.Monitoring.KpiId request) { + try { + return delegate.getKpiDescriptor(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni<context.ContextOuterClass.Empty> includeKpi(monitoring.Monitoring.Kpi request) { + try { + return delegate.includeKpi(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni<context.ContextOuterClass.Empty> monitorKpi(monitoring.Monitoring.MonitorKpiRequest request) { + try { + return delegate.monitorKpi(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni<monitoring.Monitoring.Kpi> getInstantKpi(monitoring.Monitoring.KpiId request) { + try { + return delegate.getInstantKpi(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + + @Override + public io.smallrye.mutiny.Multi<monitoring.Monitoring.Kpi> getStreamKpi(monitoring.Monitoring.KpiId request) { + try { + return delegate.getStreamKpi(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + +} \ No newline at end of file diff --git a/src/policy/target/generated-sources/grpc/monitoring/MonitoringServiceClient.java b/src/policy/target/generated-sources/grpc/monitoring/MonitoringServiceClient.java new file mode 100644 index 0000000000000000000000000000000000000000..293a7c418e6e027792e8007234e34225b8c1848a --- /dev/null +++ b/src/policy/target/generated-sources/grpc/monitoring/MonitoringServiceClient.java @@ -0,0 +1,49 @@ +package monitoring; + +import java.util.function.BiFunction; + +import io.quarkus.grpc.runtime.MutinyClient; + +@javax.annotation.Generated( +value = "by Mutiny Grpc generator", +comments = "Source: monitoring.proto") +public class MonitoringServiceClient implements MonitoringService, MutinyClient<MutinyMonitoringServiceGrpc.MutinyMonitoringServiceStub> { + + private final MutinyMonitoringServiceGrpc.MutinyMonitoringServiceStub stub; + + public MonitoringServiceClient(String name, io.grpc.Channel channel, BiFunction<String, MutinyMonitoringServiceGrpc.MutinyMonitoringServiceStub, MutinyMonitoringServiceGrpc.MutinyMonitoringServiceStub> stubConfigurator) { + this.stub = stubConfigurator.apply(name,MutinyMonitoringServiceGrpc.newMutinyStub(channel)); + } + + @Override + public MutinyMonitoringServiceGrpc.MutinyMonitoringServiceStub getStub() { + return stub; + } + + @Override + public io.smallrye.mutiny.Uni<monitoring.Monitoring.KpiId> createKpi(monitoring.Monitoring.KpiDescriptor request) { + return stub.createKpi(request); + } + @Override + public io.smallrye.mutiny.Uni<monitoring.Monitoring.KpiDescriptor> getKpiDescriptor(monitoring.Monitoring.KpiId request) { + return stub.getKpiDescriptor(request); + } + @Override + public io.smallrye.mutiny.Uni<context.ContextOuterClass.Empty> includeKpi(monitoring.Monitoring.Kpi request) { + return stub.includeKpi(request); + } + @Override + public io.smallrye.mutiny.Uni<context.ContextOuterClass.Empty> monitorKpi(monitoring.Monitoring.MonitorKpiRequest request) { + return stub.monitorKpi(request); + } + @Override + public io.smallrye.mutiny.Uni<monitoring.Monitoring.Kpi> getInstantKpi(monitoring.Monitoring.KpiId request) { + return stub.getInstantKpi(request); + } + + @Override + public io.smallrye.mutiny.Multi<monitoring.Monitoring.Kpi> getStreamKpi(monitoring.Monitoring.KpiId request) { + return stub.getStreamKpi(request); + } + +} \ No newline at end of file diff --git a/src/policy/target/generated-sources/grpc/monitoring/MonitoringServiceGrpc.java b/src/policy/target/generated-sources/grpc/monitoring/MonitoringServiceGrpc.java new file mode 100644 index 0000000000000000000000000000000000000000..7749c322a714ed96bc523a6bb77da9d43e54dbca --- /dev/null +++ b/src/policy/target/generated-sources/grpc/monitoring/MonitoringServiceGrpc.java @@ -0,0 +1,638 @@ +package monitoring; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.38.1)", + comments = "Source: monitoring.proto") +public final class MonitoringServiceGrpc { + + private MonitoringServiceGrpc() {} + + public static final String SERVICE_NAME = "monitoring.MonitoringService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor<monitoring.Monitoring.KpiDescriptor, + monitoring.Monitoring.KpiId> getCreateKpiMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateKpi", + requestType = monitoring.Monitoring.KpiDescriptor.class, + responseType = monitoring.Monitoring.KpiId.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor<monitoring.Monitoring.KpiDescriptor, + monitoring.Monitoring.KpiId> getCreateKpiMethod() { + io.grpc.MethodDescriptor<monitoring.Monitoring.KpiDescriptor, monitoring.Monitoring.KpiId> getCreateKpiMethod; + if ((getCreateKpiMethod = MonitoringServiceGrpc.getCreateKpiMethod) == null) { + synchronized (MonitoringServiceGrpc.class) { + if ((getCreateKpiMethod = MonitoringServiceGrpc.getCreateKpiMethod) == null) { + MonitoringServiceGrpc.getCreateKpiMethod = getCreateKpiMethod = + io.grpc.MethodDescriptor.<monitoring.Monitoring.KpiDescriptor, monitoring.Monitoring.KpiId>newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateKpi")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.KpiDescriptor.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.KpiId.getDefaultInstance())) + .setSchemaDescriptor(new MonitoringServiceMethodDescriptorSupplier("CreateKpi")) + .build(); + } + } + } + return getCreateKpiMethod; + } + + private static volatile io.grpc.MethodDescriptor<monitoring.Monitoring.KpiId, + monitoring.Monitoring.KpiDescriptor> getGetKpiDescriptorMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetKpiDescriptor", + requestType = monitoring.Monitoring.KpiId.class, + responseType = monitoring.Monitoring.KpiDescriptor.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor<monitoring.Monitoring.KpiId, + monitoring.Monitoring.KpiDescriptor> getGetKpiDescriptorMethod() { + io.grpc.MethodDescriptor<monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiDescriptor> getGetKpiDescriptorMethod; + if ((getGetKpiDescriptorMethod = MonitoringServiceGrpc.getGetKpiDescriptorMethod) == null) { + synchronized (MonitoringServiceGrpc.class) { + if ((getGetKpiDescriptorMethod = MonitoringServiceGrpc.getGetKpiDescriptorMethod) == null) { + MonitoringServiceGrpc.getGetKpiDescriptorMethod = getGetKpiDescriptorMethod = + io.grpc.MethodDescriptor.<monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiDescriptor>newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetKpiDescriptor")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.KpiId.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.KpiDescriptor.getDefaultInstance())) + .setSchemaDescriptor(new MonitoringServiceMethodDescriptorSupplier("GetKpiDescriptor")) + .build(); + } + } + } + return getGetKpiDescriptorMethod; + } + + private static volatile io.grpc.MethodDescriptor<monitoring.Monitoring.Kpi, + context.ContextOuterClass.Empty> getIncludeKpiMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "IncludeKpi", + requestType = monitoring.Monitoring.Kpi.class, + responseType = context.ContextOuterClass.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor<monitoring.Monitoring.Kpi, + context.ContextOuterClass.Empty> getIncludeKpiMethod() { + io.grpc.MethodDescriptor<monitoring.Monitoring.Kpi, context.ContextOuterClass.Empty> getIncludeKpiMethod; + if ((getIncludeKpiMethod = MonitoringServiceGrpc.getIncludeKpiMethod) == null) { + synchronized (MonitoringServiceGrpc.class) { + if ((getIncludeKpiMethod = MonitoringServiceGrpc.getIncludeKpiMethod) == null) { + MonitoringServiceGrpc.getIncludeKpiMethod = getIncludeKpiMethod = + io.grpc.MethodDescriptor.<monitoring.Monitoring.Kpi, context.ContextOuterClass.Empty>newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "IncludeKpi")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.Kpi.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Empty.getDefaultInstance())) + .setSchemaDescriptor(new MonitoringServiceMethodDescriptorSupplier("IncludeKpi")) + .build(); + } + } + } + return getIncludeKpiMethod; + } + + private static volatile io.grpc.MethodDescriptor<monitoring.Monitoring.MonitorKpiRequest, + context.ContextOuterClass.Empty> getMonitorKpiMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "MonitorKpi", + requestType = monitoring.Monitoring.MonitorKpiRequest.class, + responseType = context.ContextOuterClass.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor<monitoring.Monitoring.MonitorKpiRequest, + context.ContextOuterClass.Empty> getMonitorKpiMethod() { + io.grpc.MethodDescriptor<monitoring.Monitoring.MonitorKpiRequest, context.ContextOuterClass.Empty> getMonitorKpiMethod; + if ((getMonitorKpiMethod = MonitoringServiceGrpc.getMonitorKpiMethod) == null) { + synchronized (MonitoringServiceGrpc.class) { + if ((getMonitorKpiMethod = MonitoringServiceGrpc.getMonitorKpiMethod) == null) { + MonitoringServiceGrpc.getMonitorKpiMethod = getMonitorKpiMethod = + io.grpc.MethodDescriptor.<monitoring.Monitoring.MonitorKpiRequest, context.ContextOuterClass.Empty>newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "MonitorKpi")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.MonitorKpiRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Empty.getDefaultInstance())) + .setSchemaDescriptor(new MonitoringServiceMethodDescriptorSupplier("MonitorKpi")) + .build(); + } + } + } + return getMonitorKpiMethod; + } + + private static volatile io.grpc.MethodDescriptor<monitoring.Monitoring.KpiId, + monitoring.Monitoring.Kpi> getGetStreamKpiMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetStreamKpi", + requestType = monitoring.Monitoring.KpiId.class, + responseType = monitoring.Monitoring.Kpi.class, + methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + public static io.grpc.MethodDescriptor<monitoring.Monitoring.KpiId, + monitoring.Monitoring.Kpi> getGetStreamKpiMethod() { + io.grpc.MethodDescriptor<monitoring.Monitoring.KpiId, monitoring.Monitoring.Kpi> getGetStreamKpiMethod; + if ((getGetStreamKpiMethod = MonitoringServiceGrpc.getGetStreamKpiMethod) == null) { + synchronized (MonitoringServiceGrpc.class) { + if ((getGetStreamKpiMethod = MonitoringServiceGrpc.getGetStreamKpiMethod) == null) { + MonitoringServiceGrpc.getGetStreamKpiMethod = getGetStreamKpiMethod = + io.grpc.MethodDescriptor.<monitoring.Monitoring.KpiId, monitoring.Monitoring.Kpi>newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetStreamKpi")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.KpiId.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.Kpi.getDefaultInstance())) + .setSchemaDescriptor(new MonitoringServiceMethodDescriptorSupplier("GetStreamKpi")) + .build(); + } + } + } + return getGetStreamKpiMethod; + } + + private static volatile io.grpc.MethodDescriptor<monitoring.Monitoring.KpiId, + monitoring.Monitoring.Kpi> getGetInstantKpiMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetInstantKpi", + requestType = monitoring.Monitoring.KpiId.class, + responseType = monitoring.Monitoring.Kpi.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor<monitoring.Monitoring.KpiId, + monitoring.Monitoring.Kpi> getGetInstantKpiMethod() { + io.grpc.MethodDescriptor<monitoring.Monitoring.KpiId, monitoring.Monitoring.Kpi> getGetInstantKpiMethod; + if ((getGetInstantKpiMethod = MonitoringServiceGrpc.getGetInstantKpiMethod) == null) { + synchronized (MonitoringServiceGrpc.class) { + if ((getGetInstantKpiMethod = MonitoringServiceGrpc.getGetInstantKpiMethod) == null) { + MonitoringServiceGrpc.getGetInstantKpiMethod = getGetInstantKpiMethod = + io.grpc.MethodDescriptor.<monitoring.Monitoring.KpiId, monitoring.Monitoring.Kpi>newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetInstantKpi")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.KpiId.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.Kpi.getDefaultInstance())) + .setSchemaDescriptor(new MonitoringServiceMethodDescriptorSupplier("GetInstantKpi")) + .build(); + } + } + } + return getGetInstantKpiMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static MonitoringServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory<MonitoringServiceStub> factory = + new io.grpc.stub.AbstractStub.StubFactory<MonitoringServiceStub>() { + @java.lang.Override + public MonitoringServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MonitoringServiceStub(channel, callOptions); + } + }; + return MonitoringServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static MonitoringServiceBlockingStub newBlockingStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory<MonitoringServiceBlockingStub> factory = + new io.grpc.stub.AbstractStub.StubFactory<MonitoringServiceBlockingStub>() { + @java.lang.Override + public MonitoringServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MonitoringServiceBlockingStub(channel, callOptions); + } + }; + return MonitoringServiceBlockingStub.newStub(factory, channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static MonitoringServiceFutureStub newFutureStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory<MonitoringServiceFutureStub> factory = + new io.grpc.stub.AbstractStub.StubFactory<MonitoringServiceFutureStub>() { + @java.lang.Override + public MonitoringServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MonitoringServiceFutureStub(channel, callOptions); + } + }; + return MonitoringServiceFutureStub.newStub(factory, channel); + } + + /** + */ + public static abstract class MonitoringServiceImplBase implements io.grpc.BindableService { + + /** + */ + public void createKpi(monitoring.Monitoring.KpiDescriptor request, + io.grpc.stub.StreamObserver<monitoring.Monitoring.KpiId> responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateKpiMethod(), responseObserver); + } + + /** + */ + public void getKpiDescriptor(monitoring.Monitoring.KpiId request, + io.grpc.stub.StreamObserver<monitoring.Monitoring.KpiDescriptor> responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetKpiDescriptorMethod(), responseObserver); + } + + /** + */ + public void includeKpi(monitoring.Monitoring.Kpi request, + io.grpc.stub.StreamObserver<context.ContextOuterClass.Empty> responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getIncludeKpiMethod(), responseObserver); + } + + /** + */ + public void monitorKpi(monitoring.Monitoring.MonitorKpiRequest request, + io.grpc.stub.StreamObserver<context.ContextOuterClass.Empty> responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getMonitorKpiMethod(), responseObserver); + } + + /** + */ + public void getStreamKpi(monitoring.Monitoring.KpiId request, + io.grpc.stub.StreamObserver<monitoring.Monitoring.Kpi> responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetStreamKpiMethod(), responseObserver); + } + + /** + */ + public void getInstantKpi(monitoring.Monitoring.KpiId request, + io.grpc.stub.StreamObserver<monitoring.Monitoring.Kpi> responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetInstantKpiMethod(), responseObserver); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateKpiMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.KpiDescriptor, + monitoring.Monitoring.KpiId>( + this, METHODID_CREATE_KPI))) + .addMethod( + getGetKpiDescriptorMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.KpiId, + monitoring.Monitoring.KpiDescriptor>( + this, METHODID_GET_KPI_DESCRIPTOR))) + .addMethod( + getIncludeKpiMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.Kpi, + context.ContextOuterClass.Empty>( + this, METHODID_INCLUDE_KPI))) + .addMethod( + getMonitorKpiMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.MonitorKpiRequest, + context.ContextOuterClass.Empty>( + this, METHODID_MONITOR_KPI))) + .addMethod( + getGetStreamKpiMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + monitoring.Monitoring.KpiId, + monitoring.Monitoring.Kpi>( + this, METHODID_GET_STREAM_KPI))) + .addMethod( + getGetInstantKpiMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.KpiId, + monitoring.Monitoring.Kpi>( + this, METHODID_GET_INSTANT_KPI))) + .build(); + } + } + + /** + */ + public static final class MonitoringServiceStub extends io.grpc.stub.AbstractAsyncStub<MonitoringServiceStub> { + private MonitoringServiceStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MonitoringServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MonitoringServiceStub(channel, callOptions); + } + + /** + */ + public void createKpi(monitoring.Monitoring.KpiDescriptor request, + io.grpc.stub.StreamObserver<monitoring.Monitoring.KpiId> responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateKpiMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getKpiDescriptor(monitoring.Monitoring.KpiId request, + io.grpc.stub.StreamObserver<monitoring.Monitoring.KpiDescriptor> responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetKpiDescriptorMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void includeKpi(monitoring.Monitoring.Kpi request, + io.grpc.stub.StreamObserver<context.ContextOuterClass.Empty> responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getIncludeKpiMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void monitorKpi(monitoring.Monitoring.MonitorKpiRequest request, + io.grpc.stub.StreamObserver<context.ContextOuterClass.Empty> responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getMonitorKpiMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getStreamKpi(monitoring.Monitoring.KpiId request, + io.grpc.stub.StreamObserver<monitoring.Monitoring.Kpi> responseObserver) { + io.grpc.stub.ClientCalls.asyncServerStreamingCall( + getChannel().newCall(getGetStreamKpiMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getInstantKpi(monitoring.Monitoring.KpiId request, + io.grpc.stub.StreamObserver<monitoring.Monitoring.Kpi> responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetInstantKpiMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + */ + public static final class MonitoringServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub<MonitoringServiceBlockingStub> { + private MonitoringServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MonitoringServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MonitoringServiceBlockingStub(channel, callOptions); + } + + /** + */ + public monitoring.Monitoring.KpiId createKpi(monitoring.Monitoring.KpiDescriptor request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateKpiMethod(), getCallOptions(), request); + } + + /** + */ + public monitoring.Monitoring.KpiDescriptor getKpiDescriptor(monitoring.Monitoring.KpiId request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetKpiDescriptorMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.Empty includeKpi(monitoring.Monitoring.Kpi request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getIncludeKpiMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.Empty monitorKpi(monitoring.Monitoring.MonitorKpiRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getMonitorKpiMethod(), getCallOptions(), request); + } + + /** + */ + public java.util.Iterator<monitoring.Monitoring.Kpi> getStreamKpi( + monitoring.Monitoring.KpiId request) { + return io.grpc.stub.ClientCalls.blockingServerStreamingCall( + getChannel(), getGetStreamKpiMethod(), getCallOptions(), request); + } + + /** + */ + public monitoring.Monitoring.Kpi getInstantKpi(monitoring.Monitoring.KpiId request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetInstantKpiMethod(), getCallOptions(), request); + } + } + + /** + */ + public static final class MonitoringServiceFutureStub extends io.grpc.stub.AbstractFutureStub<MonitoringServiceFutureStub> { + private MonitoringServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MonitoringServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MonitoringServiceFutureStub(channel, callOptions); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture<monitoring.Monitoring.KpiId> createKpi( + monitoring.Monitoring.KpiDescriptor request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateKpiMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture<monitoring.Monitoring.KpiDescriptor> getKpiDescriptor( + monitoring.Monitoring.KpiId request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetKpiDescriptorMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture<context.ContextOuterClass.Empty> includeKpi( + monitoring.Monitoring.Kpi request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getIncludeKpiMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture<context.ContextOuterClass.Empty> monitorKpi( + monitoring.Monitoring.MonitorKpiRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getMonitorKpiMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture<monitoring.Monitoring.Kpi> getInstantKpi( + monitoring.Monitoring.KpiId request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetInstantKpiMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_KPI = 0; + private static final int METHODID_GET_KPI_DESCRIPTOR = 1; + private static final int METHODID_INCLUDE_KPI = 2; + private static final int METHODID_MONITOR_KPI = 3; + private static final int METHODID_GET_STREAM_KPI = 4; + private static final int METHODID_GET_INSTANT_KPI = 5; + + private static final class MethodHandlers<Req, Resp> implements + io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>, + io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>, + io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>, + io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> { + private final MonitoringServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(MonitoringServiceImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) { + switch (methodId) { + case METHODID_CREATE_KPI: + serviceImpl.createKpi((monitoring.Monitoring.KpiDescriptor) request, + (io.grpc.stub.StreamObserver<monitoring.Monitoring.KpiId>) responseObserver); + break; + case METHODID_GET_KPI_DESCRIPTOR: + serviceImpl.getKpiDescriptor((monitoring.Monitoring.KpiId) request, + (io.grpc.stub.StreamObserver<monitoring.Monitoring.KpiDescriptor>) responseObserver); + break; + case METHODID_INCLUDE_KPI: + serviceImpl.includeKpi((monitoring.Monitoring.Kpi) request, + (io.grpc.stub.StreamObserver<context.ContextOuterClass.Empty>) responseObserver); + break; + case METHODID_MONITOR_KPI: + serviceImpl.monitorKpi((monitoring.Monitoring.MonitorKpiRequest) request, + (io.grpc.stub.StreamObserver<context.ContextOuterClass.Empty>) responseObserver); + break; + case METHODID_GET_STREAM_KPI: + serviceImpl.getStreamKpi((monitoring.Monitoring.KpiId) request, + (io.grpc.stub.StreamObserver<monitoring.Monitoring.Kpi>) responseObserver); + break; + case METHODID_GET_INSTANT_KPI: + serviceImpl.getInstantKpi((monitoring.Monitoring.KpiId) request, + (io.grpc.stub.StreamObserver<monitoring.Monitoring.Kpi>) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver<Req> invoke( + io.grpc.stub.StreamObserver<Resp> responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private static abstract class MonitoringServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + MonitoringServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return monitoring.Monitoring.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("MonitoringService"); + } + } + + private static final class MonitoringServiceFileDescriptorSupplier + extends MonitoringServiceBaseDescriptorSupplier { + MonitoringServiceFileDescriptorSupplier() {} + } + + private static final class MonitoringServiceMethodDescriptorSupplier + extends MonitoringServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + MonitoringServiceMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (MonitoringServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new MonitoringServiceFileDescriptorSupplier()) + .addMethod(getCreateKpiMethod()) + .addMethod(getGetKpiDescriptorMethod()) + .addMethod(getIncludeKpiMethod()) + .addMethod(getMonitorKpiMethod()) + .addMethod(getGetStreamKpiMethod()) + .addMethod(getGetInstantKpiMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/src/policy/target/generated-sources/grpc/monitoring/MutinyMonitoringServiceGrpc.java b/src/policy/target/generated-sources/grpc/monitoring/MutinyMonitoringServiceGrpc.java new file mode 100644 index 0000000000000000000000000000000000000000..e5157378c1d8d4608d5da2ec0e429fbb2412c175 --- /dev/null +++ b/src/policy/target/generated-sources/grpc/monitoring/MutinyMonitoringServiceGrpc.java @@ -0,0 +1,240 @@ +package monitoring; + +import static monitoring.MonitoringServiceGrpc.getServiceDescriptor; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; +import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; +import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; + +@javax.annotation.Generated( +value = "by Mutiny Grpc generator", +comments = "Source: monitoring.proto") +public final class MutinyMonitoringServiceGrpc implements io.quarkus.grpc.runtime.MutinyGrpc { + private MutinyMonitoringServiceGrpc() {} + + public static MutinyMonitoringServiceStub newMutinyStub(io.grpc.Channel channel) { + return new MutinyMonitoringServiceStub(channel); + } + + + public static final class MutinyMonitoringServiceStub extends io.grpc.stub.AbstractStub<MutinyMonitoringServiceStub> implements io.quarkus.grpc.runtime.MutinyStub { + private MonitoringServiceGrpc.MonitoringServiceStub delegateStub; + + private MutinyMonitoringServiceStub(io.grpc.Channel channel) { + super(channel); + delegateStub = MonitoringServiceGrpc.newStub(channel); + } + + private MutinyMonitoringServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + delegateStub = MonitoringServiceGrpc.newStub(channel).build(channel, callOptions); + } + + @Override + protected MutinyMonitoringServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MutinyMonitoringServiceStub(channel, callOptions); + } + + + public io.smallrye.mutiny.Uni<monitoring.Monitoring.KpiId> createKpi(monitoring.Monitoring.KpiDescriptor request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::createKpi); + } + + + public io.smallrye.mutiny.Uni<monitoring.Monitoring.KpiDescriptor> getKpiDescriptor(monitoring.Monitoring.KpiId request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::getKpiDescriptor); + } + + + public io.smallrye.mutiny.Uni<context.ContextOuterClass.Empty> includeKpi(monitoring.Monitoring.Kpi request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::includeKpi); + } + + + public io.smallrye.mutiny.Uni<context.ContextOuterClass.Empty> monitorKpi(monitoring.Monitoring.MonitorKpiRequest request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::monitorKpi); + } + + + public io.smallrye.mutiny.Uni<monitoring.Monitoring.Kpi> getInstantKpi(monitoring.Monitoring.KpiId request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::getInstantKpi); + } + + + public io.smallrye.mutiny.Multi<monitoring.Monitoring.Kpi> getStreamKpi(monitoring.Monitoring.KpiId request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToMany(request, delegateStub::getStreamKpi); + } + + } + + + public static abstract class MonitoringServiceImplBase implements io.grpc.BindableService { + + private String compression; + /** + * Set whether the server will try to use a compressed response. + * + * @param compression the compression, e.g {@code gzip} + */ + public MonitoringServiceImplBase withCompression(String compression) { + this.compression = compression; + return this; + } + + + + public io.smallrye.mutiny.Uni<monitoring.Monitoring.KpiId> createKpi(monitoring.Monitoring.KpiDescriptor request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni<monitoring.Monitoring.KpiDescriptor> getKpiDescriptor(monitoring.Monitoring.KpiId request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni<context.ContextOuterClass.Empty> includeKpi(monitoring.Monitoring.Kpi request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni<context.ContextOuterClass.Empty> monitorKpi(monitoring.Monitoring.MonitorKpiRequest request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni<monitoring.Monitoring.Kpi> getInstantKpi(monitoring.Monitoring.KpiId request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Multi<monitoring.Monitoring.Kpi> getStreamKpi(monitoring.Monitoring.KpiId request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + monitoring.MonitoringServiceGrpc.getCreateKpiMethod(), + asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.KpiDescriptor, + monitoring.Monitoring.KpiId>( + this, METHODID_CREATE_KPI, compression))) + .addMethod( + monitoring.MonitoringServiceGrpc.getGetKpiDescriptorMethod(), + asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.KpiId, + monitoring.Monitoring.KpiDescriptor>( + this, METHODID_GET_KPI_DESCRIPTOR, compression))) + .addMethod( + monitoring.MonitoringServiceGrpc.getIncludeKpiMethod(), + asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.Kpi, + context.ContextOuterClass.Empty>( + this, METHODID_INCLUDE_KPI, compression))) + .addMethod( + monitoring.MonitoringServiceGrpc.getMonitorKpiMethod(), + asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.MonitorKpiRequest, + context.ContextOuterClass.Empty>( + this, METHODID_MONITOR_KPI, compression))) + .addMethod( + monitoring.MonitoringServiceGrpc.getGetStreamKpiMethod(), + asyncServerStreamingCall( + new MethodHandlers< + monitoring.Monitoring.KpiId, + monitoring.Monitoring.Kpi>( + this, METHODID_GET_STREAM_KPI, compression))) + .addMethod( + monitoring.MonitoringServiceGrpc.getGetInstantKpiMethod(), + asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.KpiId, + monitoring.Monitoring.Kpi>( + this, METHODID_GET_INSTANT_KPI, compression))) + .build(); + } + } + + private static final int METHODID_CREATE_KPI = 0; + private static final int METHODID_GET_KPI_DESCRIPTOR = 1; + private static final int METHODID_INCLUDE_KPI = 2; + private static final int METHODID_MONITOR_KPI = 3; + private static final int METHODID_GET_STREAM_KPI = 4; + private static final int METHODID_GET_INSTANT_KPI = 5; + + private static final class MethodHandlers<Req, Resp> implements + io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>, + io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>, + io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>, + io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> { + private final MonitoringServiceImplBase serviceImpl; + private final int methodId; + private final String compression; + + MethodHandlers(MonitoringServiceImplBase serviceImpl, int methodId, String compression) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + this.compression = compression; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) { + switch (methodId) { + case METHODID_CREATE_KPI: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((monitoring.Monitoring.KpiDescriptor) request, + (io.grpc.stub.StreamObserver<monitoring.Monitoring.KpiId>) responseObserver, + compression, + serviceImpl::createKpi); + break; + case METHODID_GET_KPI_DESCRIPTOR: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((monitoring.Monitoring.KpiId) request, + (io.grpc.stub.StreamObserver<monitoring.Monitoring.KpiDescriptor>) responseObserver, + compression, + serviceImpl::getKpiDescriptor); + break; + case METHODID_INCLUDE_KPI: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((monitoring.Monitoring.Kpi) request, + (io.grpc.stub.StreamObserver<context.ContextOuterClass.Empty>) responseObserver, + compression, + serviceImpl::includeKpi); + break; + case METHODID_MONITOR_KPI: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((monitoring.Monitoring.MonitorKpiRequest) request, + (io.grpc.stub.StreamObserver<context.ContextOuterClass.Empty>) responseObserver, + compression, + serviceImpl::monitorKpi); + break; + case METHODID_GET_STREAM_KPI: + io.quarkus.grpc.runtime.ServerCalls.oneToMany((monitoring.Monitoring.KpiId) request, + (io.grpc.stub.StreamObserver<monitoring.Monitoring.Kpi>) responseObserver, + compression, + serviceImpl::getStreamKpi); + break; + case METHODID_GET_INSTANT_KPI: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((monitoring.Monitoring.KpiId) request, + (io.grpc.stub.StreamObserver<monitoring.Monitoring.Kpi>) responseObserver, + compression, + serviceImpl::getInstantKpi); + break; + default: + throw new java.lang.AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver<Req> invoke(io.grpc.stub.StreamObserver<Resp> responseObserver) { + switch (methodId) { + default: + throw new java.lang.AssertionError(); + } + } + } + +} \ No newline at end of file diff --git a/src/policy/target/generated-sources/grpc/policy/MutinyPolicyServiceGrpc.java b/src/policy/target/generated-sources/grpc/policy/MutinyPolicyServiceGrpc.java index bad12a99d34a314f9c097ee7fda4ba7219dbb984..b9d840730272b2d6185cb2eba0c93e8cf4d11e6c 100644 --- a/src/policy/target/generated-sources/grpc/policy/MutinyPolicyServiceGrpc.java +++ b/src/policy/target/generated-sources/grpc/policy/MutinyPolicyServiceGrpc.java @@ -36,32 +36,42 @@ public final class MutinyPolicyServiceGrpc implements io.quarkus.grpc.runtime.Mu } - public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleState> policyAdd(policy.Policy.PolicyRule request) { - return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::policyAdd); + public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleState> policyAddService(policy.Policy.PolicyRuleService request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::policyAddService); } - public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleState> policyUpdate(policy.Policy.PolicyRule request) { - return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::policyUpdate); + public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleState> policyAddDevice(policy.Policy.PolicyRuleDevice request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::policyAddDevice); } - public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleState> policyDelete(policy.Policy.PolicyRule request) { + public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleState> policyUpdateService(policy.Policy.PolicyRuleService request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::policyUpdateService); + } + + + public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleState> policyUpdateDevice(policy.Policy.PolicyRuleDevice request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::policyUpdateDevice); + } + + + public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleState> policyDelete(policy.Policy.PolicyRuleId request) { return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::policyDelete); } - public io.smallrye.mutiny.Uni<policy.Policy.PolicyRule> getPolicy(policy.Policy.PolicyRuleId request) { - return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::getPolicy); + public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleService> getPolicyService(policy.Policy.PolicyRuleId request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::getPolicyService); } - public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleList> getPolicyByDeviceId(context.ContextOuterClass.DeviceId request) { - return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::getPolicyByDeviceId); + public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleDevice> getPolicyDevice(policy.Policy.PolicyRuleId request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::getPolicyDevice); } - public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleList> getPolicyByServiceId(context.ContextOuterClass.ServiceId request) { + public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleServiceList> getPolicyByServiceId(context.ContextOuterClass.ServiceId request) { return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::getPolicyByServiceId); } @@ -83,89 +93,115 @@ public final class MutinyPolicyServiceGrpc implements io.quarkus.grpc.runtime.Mu - public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleState> policyAdd(policy.Policy.PolicyRule request) { + public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleState> policyAddService(policy.Policy.PolicyRuleService request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleState> policyAddDevice(policy.Policy.PolicyRuleDevice request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleState> policyUpdateService(policy.Policy.PolicyRuleService request) { throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } - public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleState> policyUpdate(policy.Policy.PolicyRule request) { + public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleState> policyUpdateDevice(policy.Policy.PolicyRuleDevice request) { throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } - public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleState> policyDelete(policy.Policy.PolicyRule request) { + public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleState> policyDelete(policy.Policy.PolicyRuleId request) { throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } - public io.smallrye.mutiny.Uni<policy.Policy.PolicyRule> getPolicy(policy.Policy.PolicyRuleId request) { + public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleService> getPolicyService(policy.Policy.PolicyRuleId request) { throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } - public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleList> getPolicyByDeviceId(context.ContextOuterClass.DeviceId request) { + public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleDevice> getPolicyDevice(policy.Policy.PolicyRuleId request) { throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } - public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleList> getPolicyByServiceId(context.ContextOuterClass.ServiceId request) { + public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleServiceList> getPolicyByServiceId(context.ContextOuterClass.ServiceId request) { throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) .addMethod( - policy.PolicyServiceGrpc.getPolicyAddMethod(), + policy.PolicyServiceGrpc.getPolicyAddServiceMethod(), + asyncUnaryCall( + new MethodHandlers< + policy.Policy.PolicyRuleService, + policy.Policy.PolicyRuleState>( + this, METHODID_POLICY_ADD_SERVICE, compression))) + .addMethod( + policy.PolicyServiceGrpc.getPolicyAddDeviceMethod(), + asyncUnaryCall( + new MethodHandlers< + policy.Policy.PolicyRuleDevice, + policy.Policy.PolicyRuleState>( + this, METHODID_POLICY_ADD_DEVICE, compression))) + .addMethod( + policy.PolicyServiceGrpc.getPolicyUpdateServiceMethod(), asyncUnaryCall( new MethodHandlers< - policy.Policy.PolicyRule, + policy.Policy.PolicyRuleService, policy.Policy.PolicyRuleState>( - this, METHODID_POLICY_ADD, compression))) + this, METHODID_POLICY_UPDATE_SERVICE, compression))) .addMethod( - policy.PolicyServiceGrpc.getPolicyUpdateMethod(), + policy.PolicyServiceGrpc.getPolicyUpdateDeviceMethod(), asyncUnaryCall( new MethodHandlers< - policy.Policy.PolicyRule, + policy.Policy.PolicyRuleDevice, policy.Policy.PolicyRuleState>( - this, METHODID_POLICY_UPDATE, compression))) + this, METHODID_POLICY_UPDATE_DEVICE, compression))) .addMethod( policy.PolicyServiceGrpc.getPolicyDeleteMethod(), asyncUnaryCall( new MethodHandlers< - policy.Policy.PolicyRule, + policy.Policy.PolicyRuleId, policy.Policy.PolicyRuleState>( this, METHODID_POLICY_DELETE, compression))) .addMethod( - policy.PolicyServiceGrpc.getGetPolicyMethod(), + policy.PolicyServiceGrpc.getGetPolicyServiceMethod(), asyncUnaryCall( new MethodHandlers< policy.Policy.PolicyRuleId, - policy.Policy.PolicyRule>( - this, METHODID_GET_POLICY, compression))) + policy.Policy.PolicyRuleService>( + this, METHODID_GET_POLICY_SERVICE, compression))) .addMethod( - policy.PolicyServiceGrpc.getGetPolicyByDeviceIdMethod(), + policy.PolicyServiceGrpc.getGetPolicyDeviceMethod(), asyncUnaryCall( new MethodHandlers< - context.ContextOuterClass.DeviceId, - policy.Policy.PolicyRuleList>( - this, METHODID_GET_POLICY_BY_DEVICE_ID, compression))) + policy.Policy.PolicyRuleId, + policy.Policy.PolicyRuleDevice>( + this, METHODID_GET_POLICY_DEVICE, compression))) .addMethod( policy.PolicyServiceGrpc.getGetPolicyByServiceIdMethod(), asyncUnaryCall( new MethodHandlers< context.ContextOuterClass.ServiceId, - policy.Policy.PolicyRuleList>( + policy.Policy.PolicyRuleServiceList>( this, METHODID_GET_POLICY_BY_SERVICE_ID, compression))) .build(); } } - private static final int METHODID_POLICY_ADD = 0; - private static final int METHODID_POLICY_UPDATE = 1; - private static final int METHODID_POLICY_DELETE = 2; - private static final int METHODID_GET_POLICY = 3; - private static final int METHODID_GET_POLICY_BY_DEVICE_ID = 4; - private static final int METHODID_GET_POLICY_BY_SERVICE_ID = 5; + private static final int METHODID_POLICY_ADD_SERVICE = 0; + private static final int METHODID_POLICY_ADD_DEVICE = 1; + private static final int METHODID_POLICY_UPDATE_SERVICE = 2; + private static final int METHODID_POLICY_UPDATE_DEVICE = 3; + private static final int METHODID_POLICY_DELETE = 4; + private static final int METHODID_GET_POLICY_SERVICE = 5; + private static final int METHODID_GET_POLICY_DEVICE = 6; + private static final int METHODID_GET_POLICY_BY_SERVICE_ID = 7; private static final class MethodHandlers<Req, Resp> implements io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>, @@ -186,39 +222,51 @@ public final class MutinyPolicyServiceGrpc implements io.quarkus.grpc.runtime.Mu @java.lang.SuppressWarnings("unchecked") public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) { switch (methodId) { - case METHODID_POLICY_ADD: - io.quarkus.grpc.runtime.ServerCalls.oneToOne((policy.Policy.PolicyRule) request, + case METHODID_POLICY_ADD_SERVICE: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((policy.Policy.PolicyRuleService) request, (io.grpc.stub.StreamObserver<policy.Policy.PolicyRuleState>) responseObserver, compression, - serviceImpl::policyAdd); + serviceImpl::policyAddService); break; - case METHODID_POLICY_UPDATE: - io.quarkus.grpc.runtime.ServerCalls.oneToOne((policy.Policy.PolicyRule) request, + case METHODID_POLICY_ADD_DEVICE: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((policy.Policy.PolicyRuleDevice) request, (io.grpc.stub.StreamObserver<policy.Policy.PolicyRuleState>) responseObserver, compression, - serviceImpl::policyUpdate); + serviceImpl::policyAddDevice); + break; + case METHODID_POLICY_UPDATE_SERVICE: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((policy.Policy.PolicyRuleService) request, + (io.grpc.stub.StreamObserver<policy.Policy.PolicyRuleState>) responseObserver, + compression, + serviceImpl::policyUpdateService); + break; + case METHODID_POLICY_UPDATE_DEVICE: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((policy.Policy.PolicyRuleDevice) request, + (io.grpc.stub.StreamObserver<policy.Policy.PolicyRuleState>) responseObserver, + compression, + serviceImpl::policyUpdateDevice); break; case METHODID_POLICY_DELETE: - io.quarkus.grpc.runtime.ServerCalls.oneToOne((policy.Policy.PolicyRule) request, + io.quarkus.grpc.runtime.ServerCalls.oneToOne((policy.Policy.PolicyRuleId) request, (io.grpc.stub.StreamObserver<policy.Policy.PolicyRuleState>) responseObserver, compression, serviceImpl::policyDelete); break; - case METHODID_GET_POLICY: + case METHODID_GET_POLICY_SERVICE: io.quarkus.grpc.runtime.ServerCalls.oneToOne((policy.Policy.PolicyRuleId) request, - (io.grpc.stub.StreamObserver<policy.Policy.PolicyRule>) responseObserver, + (io.grpc.stub.StreamObserver<policy.Policy.PolicyRuleService>) responseObserver, compression, - serviceImpl::getPolicy); + serviceImpl::getPolicyService); break; - case METHODID_GET_POLICY_BY_DEVICE_ID: - io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.DeviceId) request, - (io.grpc.stub.StreamObserver<policy.Policy.PolicyRuleList>) responseObserver, + case METHODID_GET_POLICY_DEVICE: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((policy.Policy.PolicyRuleId) request, + (io.grpc.stub.StreamObserver<policy.Policy.PolicyRuleDevice>) responseObserver, compression, - serviceImpl::getPolicyByDeviceId); + serviceImpl::getPolicyDevice); break; case METHODID_GET_POLICY_BY_SERVICE_ID: io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.ServiceId) request, - (io.grpc.stub.StreamObserver<policy.Policy.PolicyRuleList>) responseObserver, + (io.grpc.stub.StreamObserver<policy.Policy.PolicyRuleServiceList>) responseObserver, compression, serviceImpl::getPolicyByServiceId); break; diff --git a/src/policy/target/generated-sources/grpc/policy/Policy.java b/src/policy/target/generated-sources/grpc/policy/Policy.java index 8386be80944cbbbe49d8485a1abff74fdc112d30..324f67cddbb0acf4a0d1527c4f70055caa16e50c 100644 --- a/src/policy/target/generated-sources/grpc/policy/Policy.java +++ b/src/policy/target/generated-sources/grpc/policy/Policy.java @@ -21,180 +21,183 @@ public final class Policy { implements com.google.protobuf.ProtocolMessageEnum { /** * <pre> - * Rule is currently inactive + * Undefined rule state * </pre> * - * <code>POLICY_INACTIVE = 0;</code> + * <code>POLICY_UNDEFINED = 0;</code> */ - POLICY_INACTIVE(0), + POLICY_UNDEFINED(0), /** * <pre> - * Rule installation planned + * Rule failed * </pre> * - * <code>POLICY_PLANNED = 1;</code> + * <code>POLICY_FAILED = 1;</code> */ - POLICY_PLANNED(1), + POLICY_FAILED(1), /** * <pre> - * Rule is currently active + * Rule is just inserted * </pre> * - * <code>POLICY_ACTIVE = 2;</code> + * <code>POLICY_INSERTED = 2;</code> */ - POLICY_ACTIVE(2), - UNRECOGNIZED(-1), - ; - + POLICY_INSERTED(2), /** * <pre> - * Rule is currently inactive + * Rule content is correct * </pre> * - * <code>POLICY_INACTIVE = 0;</code> + * <code>POLICY_VALIDATED = 3;</code> */ - public static final int POLICY_INACTIVE_VALUE = 0; + POLICY_VALIDATED(3), /** * <pre> - * Rule installation planned + * Rule subscribed to Monitoring * </pre> * - * <code>POLICY_PLANNED = 1;</code> + * <code>POLICY_PROVISIONED = 4;</code> */ - public static final int POLICY_PLANNED_VALUE = 1; + POLICY_PROVISIONED(4), /** * <pre> - * Rule is currently active + * Rule is currently active (alarm is just thrown by Monitoring) * </pre> * - * <code>POLICY_ACTIVE = 2;</code> + * <code>POLICY_ACTIVE = 5;</code> */ - public static final int POLICY_ACTIVE_VALUE = 2; - - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - + POLICY_ACTIVE(5), /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. + * <pre> + * Rule action is successfully enforced + * </pre> + * + * <code>POLICY_ENFORCED = 6;</code> */ - @java.lang.Deprecated - public static RuleState valueOf(int value) { - return forNumber(value); - } - + POLICY_ENFORCED(6), /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. + * <pre> + * The applied rule action did not work as expected + * </pre> + * + * <code>POLICY_INEFFECTIVE = 7;</code> */ - public static RuleState forNumber(int value) { - switch (value) { - case 0: return POLICY_INACTIVE; - case 1: return POLICY_PLANNED; - case 2: return POLICY_ACTIVE; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap<RuleState> - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - RuleState> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap<RuleState>() { - public RuleState findValueByNumber(int number) { - return RuleState.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } - return getDescriptor().getValues().get(ordinal()); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return policy.Policy.getDescriptor().getEnumTypes().get(0); - } - - private static final RuleState[] VALUES = values(); - - public static RuleState valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private RuleState(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:policy.RuleState) - } - - /** - * Protobuf enum {@code policy.PolicyRuleType} - */ - public enum PolicyRuleType - implements com.google.protobuf.ProtocolMessageEnum { + POLICY_INEFFECTIVE(7), + /** + * <pre> + * The applied rule action did work as expected + * </pre> + * + * <code>POLICY_EFFECTIVE = 8;</code> + */ + POLICY_EFFECTIVE(8), /** * <pre> - * Device-level + * Operator requires a policy to change * </pre> * - * <code>POLICYTYPE_DEVICE = 0;</code> + * <code>POLICY_UPDATED = 9;</code> */ - POLICYTYPE_DEVICE(0), + POLICY_UPDATED(9), /** * <pre> - * Network-wide + * Operator requires to remove a policy * </pre> * - * <code>POLICYTYPE_NETWORK = 1;</code> + * <code>POLICY_REMOVED = 10;</code> */ - POLICYTYPE_NETWORK(1), + POLICY_REMOVED(10), UNRECOGNIZED(-1), ; /** * <pre> - * Device-level + * Undefined rule state + * </pre> + * + * <code>POLICY_UNDEFINED = 0;</code> + */ + public static final int POLICY_UNDEFINED_VALUE = 0; + /** + * <pre> + * Rule failed + * </pre> + * + * <code>POLICY_FAILED = 1;</code> + */ + public static final int POLICY_FAILED_VALUE = 1; + /** + * <pre> + * Rule is just inserted + * </pre> + * + * <code>POLICY_INSERTED = 2;</code> + */ + public static final int POLICY_INSERTED_VALUE = 2; + /** + * <pre> + * Rule content is correct + * </pre> + * + * <code>POLICY_VALIDATED = 3;</code> + */ + public static final int POLICY_VALIDATED_VALUE = 3; + /** + * <pre> + * Rule subscribed to Monitoring + * </pre> + * + * <code>POLICY_PROVISIONED = 4;</code> + */ + public static final int POLICY_PROVISIONED_VALUE = 4; + /** + * <pre> + * Rule is currently active (alarm is just thrown by Monitoring) + * </pre> + * + * <code>POLICY_ACTIVE = 5;</code> + */ + public static final int POLICY_ACTIVE_VALUE = 5; + /** + * <pre> + * Rule action is successfully enforced + * </pre> + * + * <code>POLICY_ENFORCED = 6;</code> + */ + public static final int POLICY_ENFORCED_VALUE = 6; + /** + * <pre> + * The applied rule action did not work as expected + * </pre> + * + * <code>POLICY_INEFFECTIVE = 7;</code> + */ + public static final int POLICY_INEFFECTIVE_VALUE = 7; + /** + * <pre> + * The applied rule action did work as expected + * </pre> + * + * <code>POLICY_EFFECTIVE = 8;</code> + */ + public static final int POLICY_EFFECTIVE_VALUE = 8; + /** + * <pre> + * Operator requires a policy to change * </pre> * - * <code>POLICYTYPE_DEVICE = 0;</code> + * <code>POLICY_UPDATED = 9;</code> */ - public static final int POLICYTYPE_DEVICE_VALUE = 0; + public static final int POLICY_UPDATED_VALUE = 9; /** * <pre> - * Network-wide + * Operator requires to remove a policy * </pre> * - * <code>POLICYTYPE_NETWORK = 1;</code> + * <code>POLICY_REMOVED = 10;</code> */ - public static final int POLICYTYPE_NETWORK_VALUE = 1; + public static final int POLICY_REMOVED_VALUE = 10; public final int getNumber() { @@ -211,7 +214,7 @@ public final class Policy { * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated - public static PolicyRuleType valueOf(int value) { + public static RuleState valueOf(int value) { return forNumber(value); } @@ -219,23 +222,32 @@ public final class Policy { * @param value The numeric wire value of the corresponding enum entry. * @return The enum associated with the given numeric wire value. */ - public static PolicyRuleType forNumber(int value) { + public static RuleState forNumber(int value) { switch (value) { - case 0: return POLICYTYPE_DEVICE; - case 1: return POLICYTYPE_NETWORK; + case 0: return POLICY_UNDEFINED; + case 1: return POLICY_FAILED; + case 2: return POLICY_INSERTED; + case 3: return POLICY_VALIDATED; + case 4: return POLICY_PROVISIONED; + case 5: return POLICY_ACTIVE; + case 6: return POLICY_ENFORCED; + case 7: return POLICY_INEFFECTIVE; + case 8: return POLICY_EFFECTIVE; + case 9: return POLICY_UPDATED; + case 10: return POLICY_REMOVED; default: return null; } } - public static com.google.protobuf.Internal.EnumLiteMap<PolicyRuleType> + public static com.google.protobuf.Internal.EnumLiteMap<RuleState> internalGetValueMap() { return internalValueMap; } private static final com.google.protobuf.Internal.EnumLiteMap< - PolicyRuleType> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap<PolicyRuleType>() { - public PolicyRuleType findValueByNumber(int number) { - return PolicyRuleType.forNumber(number); + RuleState> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap<RuleState>() { + public RuleState findValueByNumber(int number) { + return RuleState.forNumber(number); } }; @@ -253,12 +265,12 @@ public final class Policy { } public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return policy.Policy.getDescriptor().getEnumTypes().get(1); + return policy.Policy.getDescriptor().getEnumTypes().get(0); } - private static final PolicyRuleType[] VALUES = values(); + private static final RuleState[] VALUES = values(); - public static PolicyRuleType valueOf( + public static RuleState valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { throw new java.lang.IllegalArgumentException( @@ -272,11 +284,11 @@ public final class Policy { private final int value; - private PolicyRuleType(int value) { + private RuleState(int value) { this.value = value; } - // @@protoc_insertion_point(enum_scope:policy.PolicyRuleType) + // @@protoc_insertion_point(enum_scope:policy.RuleState) } public interface PolicyRuleIdOrBuilder extends @@ -905,27 +917,12 @@ public final class Policy { com.google.protobuf.MessageOrBuilder { /** - * <code>.context.Uuid policyRuleId = 1;</code> - * @return Whether the policyRuleId field is set. - */ - boolean hasPolicyRuleId(); - /** - * <code>.context.Uuid policyRuleId = 1;</code> - * @return The policyRuleId. - */ - context.ContextOuterClass.Uuid getPolicyRuleId(); - /** - * <code>.context.Uuid policyRuleId = 1;</code> - */ - context.ContextOuterClass.UuidOrBuilder getPolicyRuleIdOrBuilder(); - - /** - * <code>.policy.RuleState policyRuleState = 2;</code> + * <code>.policy.RuleState policyRuleState = 1;</code> * @return The enum numeric value on the wire for policyRuleState. */ int getPolicyRuleStateValue(); /** - * <code>.policy.RuleState policyRuleState = 2;</code> + * <code>.policy.RuleState policyRuleState = 1;</code> * @return The policyRuleState. */ policy.Policy.RuleState getPolicyRuleState(); @@ -976,20 +973,7 @@ public final class Policy { case 0: done = true; break; - case 10: { - context.ContextOuterClass.Uuid.Builder subBuilder = null; - if (policyRuleId_ != null) { - subBuilder = policyRuleId_.toBuilder(); - } - policyRuleId_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(policyRuleId_); - policyRuleId_ = subBuilder.buildPartial(); - } - - break; - } - case 16: { + case 8: { int rawValue = input.readEnum(); policyRuleState_ = rawValue; @@ -1027,43 +1011,17 @@ public final class Policy { policy.Policy.PolicyRuleState.class, policy.Policy.PolicyRuleState.Builder.class); } - public static final int POLICYRULEID_FIELD_NUMBER = 1; - private context.ContextOuterClass.Uuid policyRuleId_; - /** - * <code>.context.Uuid policyRuleId = 1;</code> - * @return Whether the policyRuleId field is set. - */ - @java.lang.Override - public boolean hasPolicyRuleId() { - return policyRuleId_ != null; - } - /** - * <code>.context.Uuid policyRuleId = 1;</code> - * @return The policyRuleId. - */ - @java.lang.Override - public context.ContextOuterClass.Uuid getPolicyRuleId() { - return policyRuleId_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : policyRuleId_; - } - /** - * <code>.context.Uuid policyRuleId = 1;</code> - */ - @java.lang.Override - public context.ContextOuterClass.UuidOrBuilder getPolicyRuleIdOrBuilder() { - return getPolicyRuleId(); - } - - public static final int POLICYRULESTATE_FIELD_NUMBER = 2; + public static final int POLICYRULESTATE_FIELD_NUMBER = 1; private int policyRuleState_; /** - * <code>.policy.RuleState policyRuleState = 2;</code> + * <code>.policy.RuleState policyRuleState = 1;</code> * @return The enum numeric value on the wire for policyRuleState. */ @java.lang.Override public int getPolicyRuleStateValue() { return policyRuleState_; } /** - * <code>.policy.RuleState policyRuleState = 2;</code> + * <code>.policy.RuleState policyRuleState = 1;</code> * @return The policyRuleState. */ @java.lang.Override public policy.Policy.RuleState getPolicyRuleState() { @@ -1086,11 +1044,8 @@ public final class Policy { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (policyRuleId_ != null) { - output.writeMessage(1, getPolicyRuleId()); - } - if (policyRuleState_ != policy.Policy.RuleState.POLICY_INACTIVE.getNumber()) { - output.writeEnum(2, policyRuleState_); + if (policyRuleState_ != policy.Policy.RuleState.POLICY_UNDEFINED.getNumber()) { + output.writeEnum(1, policyRuleState_); } unknownFields.writeTo(output); } @@ -1101,13 +1056,9 @@ public final class Policy { if (size != -1) return size; size = 0; - if (policyRuleId_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getPolicyRuleId()); - } - if (policyRuleState_ != policy.Policy.RuleState.POLICY_INACTIVE.getNumber()) { + if (policyRuleState_ != policy.Policy.RuleState.POLICY_UNDEFINED.getNumber()) { size += com.google.protobuf.CodedOutputStream - .computeEnumSize(2, policyRuleState_); + .computeEnumSize(1, policyRuleState_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -1124,11 +1075,6 @@ public final class Policy { } policy.Policy.PolicyRuleState other = (policy.Policy.PolicyRuleState) obj; - if (hasPolicyRuleId() != other.hasPolicyRuleId()) return false; - if (hasPolicyRuleId()) { - if (!getPolicyRuleId() - .equals(other.getPolicyRuleId())) return false; - } if (policyRuleState_ != other.policyRuleState_) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; @@ -1141,10 +1087,6 @@ public final class Policy { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasPolicyRuleId()) { - hash = (37 * hash) + POLICYRULEID_FIELD_NUMBER; - hash = (53 * hash) + getPolicyRuleId().hashCode(); - } hash = (37 * hash) + POLICYRULESTATE_FIELD_NUMBER; hash = (53 * hash) + policyRuleState_; hash = (29 * hash) + unknownFields.hashCode(); @@ -1280,12 +1222,6 @@ public final class Policy { @java.lang.Override public Builder clear() { super.clear(); - if (policyRuleIdBuilder_ == null) { - policyRuleId_ = null; - } else { - policyRuleId_ = null; - policyRuleIdBuilder_ = null; - } policyRuleState_ = 0; return this; @@ -1314,11 +1250,6 @@ public final class Policy { @java.lang.Override public policy.Policy.PolicyRuleState buildPartial() { policy.Policy.PolicyRuleState result = new policy.Policy.PolicyRuleState(this); - if (policyRuleIdBuilder_ == null) { - result.policyRuleId_ = policyRuleId_; - } else { - result.policyRuleId_ = policyRuleIdBuilder_.build(); - } result.policyRuleState_ = policyRuleState_; onBuilt(); return result; @@ -1368,9 +1299,6 @@ public final class Policy { public Builder mergeFrom(policy.Policy.PolicyRuleState other) { if (other == policy.Policy.PolicyRuleState.getDefaultInstance()) return this; - if (other.hasPolicyRuleId()) { - mergePolicyRuleId(other.getPolicyRuleId()); - } if (other.policyRuleState_ != 0) { setPolicyRuleStateValue(other.getPolicyRuleStateValue()); } @@ -1403,146 +1331,27 @@ public final class Policy { return this; } - private context.ContextOuterClass.Uuid policyRuleId_; - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> policyRuleIdBuilder_; - /** - * <code>.context.Uuid policyRuleId = 1;</code> - * @return Whether the policyRuleId field is set. - */ - public boolean hasPolicyRuleId() { - return policyRuleIdBuilder_ != null || policyRuleId_ != null; - } + private int policyRuleState_ = 0; /** - * <code>.context.Uuid policyRuleId = 1;</code> - * @return The policyRuleId. + * <code>.policy.RuleState policyRuleState = 1;</code> + * @return The enum numeric value on the wire for policyRuleState. */ - public context.ContextOuterClass.Uuid getPolicyRuleId() { - if (policyRuleIdBuilder_ == null) { - return policyRuleId_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : policyRuleId_; - } else { - return policyRuleIdBuilder_.getMessage(); - } + @java.lang.Override public int getPolicyRuleStateValue() { + return policyRuleState_; } /** - * <code>.context.Uuid policyRuleId = 1;</code> + * <code>.policy.RuleState policyRuleState = 1;</code> + * @param value The enum numeric value on the wire for policyRuleState to set. + * @return This builder for chaining. */ - public Builder setPolicyRuleId(context.ContextOuterClass.Uuid value) { - if (policyRuleIdBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - policyRuleId_ = value; - onChanged(); - } else { - policyRuleIdBuilder_.setMessage(value); - } - + public Builder setPolicyRuleStateValue(int value) { + + policyRuleState_ = value; + onChanged(); return this; } /** - * <code>.context.Uuid policyRuleId = 1;</code> - */ - public Builder setPolicyRuleId( - context.ContextOuterClass.Uuid.Builder builderForValue) { - if (policyRuleIdBuilder_ == null) { - policyRuleId_ = builderForValue.build(); - onChanged(); - } else { - policyRuleIdBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * <code>.context.Uuid policyRuleId = 1;</code> - */ - public Builder mergePolicyRuleId(context.ContextOuterClass.Uuid value) { - if (policyRuleIdBuilder_ == null) { - if (policyRuleId_ != null) { - policyRuleId_ = - context.ContextOuterClass.Uuid.newBuilder(policyRuleId_).mergeFrom(value).buildPartial(); - } else { - policyRuleId_ = value; - } - onChanged(); - } else { - policyRuleIdBuilder_.mergeFrom(value); - } - - return this; - } - /** - * <code>.context.Uuid policyRuleId = 1;</code> - */ - public Builder clearPolicyRuleId() { - if (policyRuleIdBuilder_ == null) { - policyRuleId_ = null; - onChanged(); - } else { - policyRuleId_ = null; - policyRuleIdBuilder_ = null; - } - - return this; - } - /** - * <code>.context.Uuid policyRuleId = 1;</code> - */ - public context.ContextOuterClass.Uuid.Builder getPolicyRuleIdBuilder() { - - onChanged(); - return getPolicyRuleIdFieldBuilder().getBuilder(); - } - /** - * <code>.context.Uuid policyRuleId = 1;</code> - */ - public context.ContextOuterClass.UuidOrBuilder getPolicyRuleIdOrBuilder() { - if (policyRuleIdBuilder_ != null) { - return policyRuleIdBuilder_.getMessageOrBuilder(); - } else { - return policyRuleId_ == null ? - context.ContextOuterClass.Uuid.getDefaultInstance() : policyRuleId_; - } - } - /** - * <code>.context.Uuid policyRuleId = 1;</code> - */ - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> - getPolicyRuleIdFieldBuilder() { - if (policyRuleIdBuilder_ == null) { - policyRuleIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( - getPolicyRuleId(), - getParentForChildren(), - isClean()); - policyRuleId_ = null; - } - return policyRuleIdBuilder_; - } - - private int policyRuleState_ = 0; - /** - * <code>.policy.RuleState policyRuleState = 2;</code> - * @return The enum numeric value on the wire for policyRuleState. - */ - @java.lang.Override public int getPolicyRuleStateValue() { - return policyRuleState_; - } - /** - * <code>.policy.RuleState policyRuleState = 2;</code> - * @param value The enum numeric value on the wire for policyRuleState to set. - * @return This builder for chaining. - */ - public Builder setPolicyRuleStateValue(int value) { - - policyRuleState_ = value; - onChanged(); - return this; - } - /** - * <code>.policy.RuleState policyRuleState = 2;</code> + * <code>.policy.RuleState policyRuleState = 1;</code> * @return The policyRuleState. */ @java.lang.Override @@ -1552,7 +1361,7 @@ public final class Policy { return result == null ? policy.Policy.RuleState.UNRECOGNIZED : result; } /** - * <code>.policy.RuleState policyRuleState = 2;</code> + * <code>.policy.RuleState policyRuleState = 1;</code> * @param value The policyRuleState to set. * @return This builder for chaining. */ @@ -1566,7 +1375,7 @@ public final class Policy { return this; } /** - * <code>.policy.RuleState policyRuleState = 2;</code> + * <code>.policy.RuleState policyRuleState = 1;</code> * @return This builder for chaining. */ public Builder clearPolicyRuleState() { @@ -1628,43 +1437,180 @@ public final class Policy { } - public interface PolicyRuleVariableOrBuilder extends - // @@protoc_insertion_point(interface_extends:policy.PolicyRuleVariable) + public interface PolicyRuleBasicOrBuilder extends + // @@protoc_insertion_point(interface_extends:policy.PolicyRuleBasic) com.google.protobuf.MessageOrBuilder { /** - * <code>string policyRuleVariable = 1;</code> - * @return The policyRuleVariable. + * <code>.policy.PolicyRuleId policyRuleId = 1;</code> + * @return Whether the policyRuleId field is set. + */ + boolean hasPolicyRuleId(); + /** + * <code>.policy.PolicyRuleId policyRuleId = 1;</code> + * @return The policyRuleId. + */ + policy.Policy.PolicyRuleId getPolicyRuleId(); + /** + * <code>.policy.PolicyRuleId policyRuleId = 1;</code> + */ + policy.Policy.PolicyRuleIdOrBuilder getPolicyRuleIdOrBuilder(); + + /** + * <code>optional .policy.PolicyRuleState policyRuleState = 2;</code> + * @return Whether the policyRuleState field is set. + */ + boolean hasPolicyRuleState(); + /** + * <code>optional .policy.PolicyRuleState policyRuleState = 2;</code> + * @return The policyRuleState. + */ + policy.Policy.PolicyRuleState getPolicyRuleState(); + /** + * <code>optional .policy.PolicyRuleState policyRuleState = 2;</code> + */ + policy.Policy.PolicyRuleStateOrBuilder getPolicyRuleStateOrBuilder(); + + /** + * <code>uint32 priority = 3;</code> + * @return The priority. + */ + int getPriority(); + + /** + * <pre> + * Event-Condition-Action (ECA) model + * </pre> + * + * <code>repeated .policy.PolicyRuleCondition conditionList = 4;</code> + */ + java.util.List<policy.PolicyCondition.PolicyRuleCondition> + getConditionListList(); + /** + * <pre> + * Event-Condition-Action (ECA) model + * </pre> + * + * <code>repeated .policy.PolicyRuleCondition conditionList = 4;</code> + */ + policy.PolicyCondition.PolicyRuleCondition getConditionList(int index); + /** + * <pre> + * Event-Condition-Action (ECA) model + * </pre> + * + * <code>repeated .policy.PolicyRuleCondition conditionList = 4;</code> + */ + int getConditionListCount(); + /** + * <pre> + * Event-Condition-Action (ECA) model + * </pre> + * + * <code>repeated .policy.PolicyRuleCondition conditionList = 4;</code> + */ + java.util.List<? extends policy.PolicyCondition.PolicyRuleConditionOrBuilder> + getConditionListOrBuilderList(); + /** + * <pre> + * Event-Condition-Action (ECA) model + * </pre> + * + * <code>repeated .policy.PolicyRuleCondition conditionList = 4;</code> + */ + policy.PolicyCondition.PolicyRuleConditionOrBuilder getConditionListOrBuilder( + int index); + + /** + * <pre> + * Evaluation operator to be used + * </pre> + * + * <code>.policy.BooleanOperator booleanOperator = 5;</code> + * @return The enum numeric value on the wire for booleanOperator. + */ + int getBooleanOperatorValue(); + /** + * <pre> + * Evaluation operator to be used + * </pre> + * + * <code>.policy.BooleanOperator booleanOperator = 5;</code> + * @return The booleanOperator. + */ + policy.PolicyCondition.BooleanOperator getBooleanOperator(); + + /** + * <pre> + * One or more actions should be applied + * </pre> + * + * <code>repeated .policy.PolicyRuleAction actionList = 6;</code> + */ + java.util.List<policy.PolicyAction.PolicyRuleAction> + getActionListList(); + /** + * <pre> + * One or more actions should be applied + * </pre> + * + * <code>repeated .policy.PolicyRuleAction actionList = 6;</code> + */ + policy.PolicyAction.PolicyRuleAction getActionList(int index); + /** + * <pre> + * One or more actions should be applied + * </pre> + * + * <code>repeated .policy.PolicyRuleAction actionList = 6;</code> + */ + int getActionListCount(); + /** + * <pre> + * One or more actions should be applied + * </pre> + * + * <code>repeated .policy.PolicyRuleAction actionList = 6;</code> */ - java.lang.String getPolicyRuleVariable(); + java.util.List<? extends policy.PolicyAction.PolicyRuleActionOrBuilder> + getActionListOrBuilderList(); /** - * <code>string policyRuleVariable = 1;</code> - * @return The bytes for policyRuleVariable. + * <pre> + * One or more actions should be applied + * </pre> + * + * <code>repeated .policy.PolicyRuleAction actionList = 6;</code> */ - com.google.protobuf.ByteString - getPolicyRuleVariableBytes(); + policy.PolicyAction.PolicyRuleActionOrBuilder getActionListOrBuilder( + int index); } /** - * Protobuf type {@code policy.PolicyRuleVariable} + * <pre> + * Basic policy rule attributes + * </pre> + * + * Protobuf type {@code policy.PolicyRuleBasic} */ - public static final class PolicyRuleVariable extends + public static final class PolicyRuleBasic extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:policy.PolicyRuleVariable) - PolicyRuleVariableOrBuilder { + // @@protoc_insertion_point(message_implements:policy.PolicyRuleBasic) + PolicyRuleBasicOrBuilder { private static final long serialVersionUID = 0L; - // Use PolicyRuleVariable.newBuilder() to construct. - private PolicyRuleVariable(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + // Use PolicyRuleBasic.newBuilder() to construct. + private PolicyRuleBasic(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } - private PolicyRuleVariable() { - policyRuleVariable_ = ""; + private PolicyRuleBasic() { + conditionList_ = java.util.Collections.emptyList(); + booleanOperator_ = 0; + actionList_ = java.util.Collections.emptyList(); } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new PolicyRuleVariable(); + return new PolicyRuleBasic(); } @java.lang.Override @@ -1672,7 +1618,7 @@ public final class Policy { getUnknownFields() { return this.unknownFields; } - private PolicyRuleVariable( + private PolicyRuleBasic( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -1680,6 +1626,7 @@ public final class Policy { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } + int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -1691,9 +1638,58 @@ public final class Policy { done = true; break; case 10: { - java.lang.String s = input.readStringRequireUtf8(); + policy.Policy.PolicyRuleId.Builder subBuilder = null; + if (policyRuleId_ != null) { + subBuilder = policyRuleId_.toBuilder(); + } + policyRuleId_ = input.readMessage(policy.Policy.PolicyRuleId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(policyRuleId_); + policyRuleId_ = subBuilder.buildPartial(); + } - policyRuleVariable_ = s; + break; + } + case 18: { + policy.Policy.PolicyRuleState.Builder subBuilder = null; + if (((bitField0_ & 0x00000001) != 0)) { + subBuilder = policyRuleState_.toBuilder(); + } + policyRuleState_ = input.readMessage(policy.Policy.PolicyRuleState.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(policyRuleState_); + policyRuleState_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000001; + break; + } + case 24: { + + priority_ = input.readUInt32(); + break; + } + case 34: { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + conditionList_ = new java.util.ArrayList<policy.PolicyCondition.PolicyRuleCondition>(); + mutable_bitField0_ |= 0x00000002; + } + conditionList_.add( + input.readMessage(policy.PolicyCondition.PolicyRuleCondition.parser(), extensionRegistry)); + break; + } + case 40: { + int rawValue = input.readEnum(); + + booleanOperator_ = rawValue; + break; + } + case 50: { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + actionList_ = new java.util.ArrayList<policy.PolicyAction.PolicyRuleAction>(); + mutable_bitField0_ |= 0x00000004; + } + actionList_.add( + input.readMessage(policy.PolicyAction.PolicyRuleAction.parser(), extensionRegistry)); break; } default: { @@ -1711,89 +1707,304 @@ public final class Policy { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { + if (((mutable_bitField0_ & 0x00000002) != 0)) { + conditionList_ = java.util.Collections.unmodifiableList(conditionList_); + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + actionList_ = java.util.Collections.unmodifiableList(actionList_); + } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return policy.Policy.internal_static_policy_PolicyRuleVariable_descriptor; + return policy.Policy.internal_static_policy_PolicyRuleBasic_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return policy.Policy.internal_static_policy_PolicyRuleVariable_fieldAccessorTable + return policy.Policy.internal_static_policy_PolicyRuleBasic_fieldAccessorTable .ensureFieldAccessorsInitialized( - policy.Policy.PolicyRuleVariable.class, policy.Policy.PolicyRuleVariable.Builder.class); + policy.Policy.PolicyRuleBasic.class, policy.Policy.PolicyRuleBasic.Builder.class); } - public static final int POLICYRULEVARIABLE_FIELD_NUMBER = 1; - private volatile java.lang.Object policyRuleVariable_; + private int bitField0_; + public static final int POLICYRULEID_FIELD_NUMBER = 1; + private policy.Policy.PolicyRuleId policyRuleId_; /** - * <code>string policyRuleVariable = 1;</code> - * @return The policyRuleVariable. + * <code>.policy.PolicyRuleId policyRuleId = 1;</code> + * @return Whether the policyRuleId field is set. */ @java.lang.Override - public java.lang.String getPolicyRuleVariable() { - java.lang.Object ref = policyRuleVariable_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - policyRuleVariable_ = s; - return s; - } + public boolean hasPolicyRuleId() { + return policyRuleId_ != null; } /** - * <code>string policyRuleVariable = 1;</code> - * @return The bytes for policyRuleVariable. + * <code>.policy.PolicyRuleId policyRuleId = 1;</code> + * @return The policyRuleId. */ @java.lang.Override - public com.google.protobuf.ByteString - getPolicyRuleVariableBytes() { - java.lang.Object ref = policyRuleVariable_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - policyRuleVariable_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public policy.Policy.PolicyRuleId getPolicyRuleId() { + return policyRuleId_ == null ? policy.Policy.PolicyRuleId.getDefaultInstance() : policyRuleId_; } - - private byte memoizedIsInitialized = -1; + /** + * <code>.policy.PolicyRuleId policyRuleId = 1;</code> + */ @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; + public policy.Policy.PolicyRuleIdOrBuilder getPolicyRuleIdOrBuilder() { + return getPolicyRuleId(); } + public static final int POLICYRULESTATE_FIELD_NUMBER = 2; + private policy.Policy.PolicyRuleState policyRuleState_; + /** + * <code>optional .policy.PolicyRuleState policyRuleState = 2;</code> + * @return Whether the policyRuleState field is set. + */ @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getPolicyRuleVariableBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, policyRuleVariable_); - } - unknownFields.writeTo(output); + public boolean hasPolicyRuleState() { + return ((bitField0_ & 0x00000001) != 0); } - + /** + * <code>optional .policy.PolicyRuleState policyRuleState = 2;</code> + * @return The policyRuleState. + */ + @java.lang.Override + public policy.Policy.PolicyRuleState getPolicyRuleState() { + return policyRuleState_ == null ? policy.Policy.PolicyRuleState.getDefaultInstance() : policyRuleState_; + } + /** + * <code>optional .policy.PolicyRuleState policyRuleState = 2;</code> + */ + @java.lang.Override + public policy.Policy.PolicyRuleStateOrBuilder getPolicyRuleStateOrBuilder() { + return policyRuleState_ == null ? policy.Policy.PolicyRuleState.getDefaultInstance() : policyRuleState_; + } + + public static final int PRIORITY_FIELD_NUMBER = 3; + private int priority_; + /** + * <code>uint32 priority = 3;</code> + * @return The priority. + */ + @java.lang.Override + public int getPriority() { + return priority_; + } + + public static final int CONDITIONLIST_FIELD_NUMBER = 4; + private java.util.List<policy.PolicyCondition.PolicyRuleCondition> conditionList_; + /** + * <pre> + * Event-Condition-Action (ECA) model + * </pre> + * + * <code>repeated .policy.PolicyRuleCondition conditionList = 4;</code> + */ + @java.lang.Override + public java.util.List<policy.PolicyCondition.PolicyRuleCondition> getConditionListList() { + return conditionList_; + } + /** + * <pre> + * Event-Condition-Action (ECA) model + * </pre> + * + * <code>repeated .policy.PolicyRuleCondition conditionList = 4;</code> + */ + @java.lang.Override + public java.util.List<? extends policy.PolicyCondition.PolicyRuleConditionOrBuilder> + getConditionListOrBuilderList() { + return conditionList_; + } + /** + * <pre> + * Event-Condition-Action (ECA) model + * </pre> + * + * <code>repeated .policy.PolicyRuleCondition conditionList = 4;</code> + */ + @java.lang.Override + public int getConditionListCount() { + return conditionList_.size(); + } + /** + * <pre> + * Event-Condition-Action (ECA) model + * </pre> + * + * <code>repeated .policy.PolicyRuleCondition conditionList = 4;</code> + */ + @java.lang.Override + public policy.PolicyCondition.PolicyRuleCondition getConditionList(int index) { + return conditionList_.get(index); + } + /** + * <pre> + * Event-Condition-Action (ECA) model + * </pre> + * + * <code>repeated .policy.PolicyRuleCondition conditionList = 4;</code> + */ + @java.lang.Override + public policy.PolicyCondition.PolicyRuleConditionOrBuilder getConditionListOrBuilder( + int index) { + return conditionList_.get(index); + } + + public static final int BOOLEANOPERATOR_FIELD_NUMBER = 5; + private int booleanOperator_; + /** + * <pre> + * Evaluation operator to be used + * </pre> + * + * <code>.policy.BooleanOperator booleanOperator = 5;</code> + * @return The enum numeric value on the wire for booleanOperator. + */ + @java.lang.Override public int getBooleanOperatorValue() { + return booleanOperator_; + } + /** + * <pre> + * Evaluation operator to be used + * </pre> + * + * <code>.policy.BooleanOperator booleanOperator = 5;</code> + * @return The booleanOperator. + */ + @java.lang.Override public policy.PolicyCondition.BooleanOperator getBooleanOperator() { + @SuppressWarnings("deprecation") + policy.PolicyCondition.BooleanOperator result = policy.PolicyCondition.BooleanOperator.valueOf(booleanOperator_); + return result == null ? policy.PolicyCondition.BooleanOperator.UNRECOGNIZED : result; + } + + public static final int ACTIONLIST_FIELD_NUMBER = 6; + private java.util.List<policy.PolicyAction.PolicyRuleAction> actionList_; + /** + * <pre> + * One or more actions should be applied + * </pre> + * + * <code>repeated .policy.PolicyRuleAction actionList = 6;</code> + */ + @java.lang.Override + public java.util.List<policy.PolicyAction.PolicyRuleAction> getActionListList() { + return actionList_; + } + /** + * <pre> + * One or more actions should be applied + * </pre> + * + * <code>repeated .policy.PolicyRuleAction actionList = 6;</code> + */ + @java.lang.Override + public java.util.List<? extends policy.PolicyAction.PolicyRuleActionOrBuilder> + getActionListOrBuilderList() { + return actionList_; + } + /** + * <pre> + * One or more actions should be applied + * </pre> + * + * <code>repeated .policy.PolicyRuleAction actionList = 6;</code> + */ + @java.lang.Override + public int getActionListCount() { + return actionList_.size(); + } + /** + * <pre> + * One or more actions should be applied + * </pre> + * + * <code>repeated .policy.PolicyRuleAction actionList = 6;</code> + */ + @java.lang.Override + public policy.PolicyAction.PolicyRuleAction getActionList(int index) { + return actionList_.get(index); + } + /** + * <pre> + * One or more actions should be applied + * </pre> + * + * <code>repeated .policy.PolicyRuleAction actionList = 6;</code> + */ + @java.lang.Override + public policy.PolicyAction.PolicyRuleActionOrBuilder getActionListOrBuilder( + int index) { + return actionList_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (policyRuleId_ != null) { + output.writeMessage(1, getPolicyRuleId()); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getPolicyRuleState()); + } + if (priority_ != 0) { + output.writeUInt32(3, priority_); + } + for (int i = 0; i < conditionList_.size(); i++) { + output.writeMessage(4, conditionList_.get(i)); + } + if (booleanOperator_ != policy.PolicyCondition.BooleanOperator.POLICYRULE_CONDITION_BOOLEAN_UNDEFINED.getNumber()) { + output.writeEnum(5, booleanOperator_); + } + for (int i = 0; i < actionList_.size(); i++) { + output.writeMessage(6, actionList_.get(i)); + } + unknownFields.writeTo(output); + } + @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; - if (!getPolicyRuleVariableBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, policyRuleVariable_); + if (policyRuleId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getPolicyRuleId()); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getPolicyRuleState()); + } + if (priority_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(3, priority_); + } + for (int i = 0; i < conditionList_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, conditionList_.get(i)); + } + if (booleanOperator_ != policy.PolicyCondition.BooleanOperator.POLICYRULE_CONDITION_BOOLEAN_UNDEFINED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(5, booleanOperator_); + } + for (int i = 0; i < actionList_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, actionList_.get(i)); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -1805,13 +2016,28 @@ public final class Policy { if (obj == this) { return true; } - if (!(obj instanceof policy.Policy.PolicyRuleVariable)) { + if (!(obj instanceof policy.Policy.PolicyRuleBasic)) { return super.equals(obj); } - policy.Policy.PolicyRuleVariable other = (policy.Policy.PolicyRuleVariable) obj; + policy.Policy.PolicyRuleBasic other = (policy.Policy.PolicyRuleBasic) obj; - if (!getPolicyRuleVariable() - .equals(other.getPolicyRuleVariable())) return false; + if (hasPolicyRuleId() != other.hasPolicyRuleId()) return false; + if (hasPolicyRuleId()) { + if (!getPolicyRuleId() + .equals(other.getPolicyRuleId())) return false; + } + if (hasPolicyRuleState() != other.hasPolicyRuleState()) return false; + if (hasPolicyRuleState()) { + if (!getPolicyRuleState() + .equals(other.getPolicyRuleState())) return false; + } + if (getPriority() + != other.getPriority()) return false; + if (!getConditionListList() + .equals(other.getConditionListList())) return false; + if (booleanOperator_ != other.booleanOperator_) return false; + if (!getActionListList() + .equals(other.getActionListList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -1823,76 +2049,94 @@ public final class Policy { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + POLICYRULEVARIABLE_FIELD_NUMBER; - hash = (53 * hash) + getPolicyRuleVariable().hashCode(); + if (hasPolicyRuleId()) { + hash = (37 * hash) + POLICYRULEID_FIELD_NUMBER; + hash = (53 * hash) + getPolicyRuleId().hashCode(); + } + if (hasPolicyRuleState()) { + hash = (37 * hash) + POLICYRULESTATE_FIELD_NUMBER; + hash = (53 * hash) + getPolicyRuleState().hashCode(); + } + hash = (37 * hash) + PRIORITY_FIELD_NUMBER; + hash = (53 * hash) + getPriority(); + if (getConditionListCount() > 0) { + hash = (37 * hash) + CONDITIONLIST_FIELD_NUMBER; + hash = (53 * hash) + getConditionListList().hashCode(); + } + hash = (37 * hash) + BOOLEANOPERATOR_FIELD_NUMBER; + hash = (53 * hash) + booleanOperator_; + if (getActionListCount() > 0) { + hash = (37 * hash) + ACTIONLIST_FIELD_NUMBER; + hash = (53 * hash) + getActionListList().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static policy.Policy.PolicyRuleVariable parseFrom( + public static policy.Policy.PolicyRuleBasic parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static policy.Policy.PolicyRuleVariable parseFrom( + public static policy.Policy.PolicyRuleBasic parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static policy.Policy.PolicyRuleVariable parseFrom( + public static policy.Policy.PolicyRuleBasic parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static policy.Policy.PolicyRuleVariable parseFrom( + public static policy.Policy.PolicyRuleBasic parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static policy.Policy.PolicyRuleVariable parseFrom(byte[] data) + public static policy.Policy.PolicyRuleBasic parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static policy.Policy.PolicyRuleVariable parseFrom( + public static policy.Policy.PolicyRuleBasic parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static policy.Policy.PolicyRuleVariable parseFrom(java.io.InputStream input) + public static policy.Policy.PolicyRuleBasic parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static policy.Policy.PolicyRuleVariable parseFrom( + public static policy.Policy.PolicyRuleBasic parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } - public static policy.Policy.PolicyRuleVariable parseDelimitedFrom(java.io.InputStream input) + public static policy.Policy.PolicyRuleBasic parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static policy.Policy.PolicyRuleVariable parseDelimitedFrom( + public static policy.Policy.PolicyRuleBasic parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static policy.Policy.PolicyRuleVariable parseFrom( + public static policy.Policy.PolicyRuleBasic parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static policy.Policy.PolicyRuleVariable parseFrom( + public static policy.Policy.PolicyRuleBasic parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -1905,7 +2149,7 @@ public final class Policy { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(policy.Policy.PolicyRuleVariable prototype) { + public static Builder newBuilder(policy.Policy.PolicyRuleBasic prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -1921,26 +2165,30 @@ public final class Policy { return builder; } /** - * Protobuf type {@code policy.PolicyRuleVariable} + * <pre> + * Basic policy rule attributes + * </pre> + * + * Protobuf type {@code policy.PolicyRuleBasic} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements - // @@protoc_insertion_point(builder_implements:policy.PolicyRuleVariable) - policy.Policy.PolicyRuleVariableOrBuilder { + // @@protoc_insertion_point(builder_implements:policy.PolicyRuleBasic) + policy.Policy.PolicyRuleBasicOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return policy.Policy.internal_static_policy_PolicyRuleVariable_descriptor; + return policy.Policy.internal_static_policy_PolicyRuleBasic_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return policy.Policy.internal_static_policy_PolicyRuleVariable_fieldAccessorTable + return policy.Policy.internal_static_policy_PolicyRuleBasic_fieldAccessorTable .ensureFieldAccessorsInitialized( - policy.Policy.PolicyRuleVariable.class, policy.Policy.PolicyRuleVariable.Builder.class); + policy.Policy.PolicyRuleBasic.class, policy.Policy.PolicyRuleBasic.Builder.class); } - // Construct using policy.Policy.PolicyRuleVariable.newBuilder() + // Construct using policy.Policy.PolicyRuleBasic.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -1953,30 +2201,59 @@ public final class Policy { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { + getPolicyRuleStateFieldBuilder(); + getConditionListFieldBuilder(); + getActionListFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - policyRuleVariable_ = ""; + if (policyRuleIdBuilder_ == null) { + policyRuleId_ = null; + } else { + policyRuleId_ = null; + policyRuleIdBuilder_ = null; + } + if (policyRuleStateBuilder_ == null) { + policyRuleState_ = null; + } else { + policyRuleStateBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + priority_ = 0; + + if (conditionListBuilder_ == null) { + conditionList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + conditionListBuilder_.clear(); + } + booleanOperator_ = 0; + if (actionListBuilder_ == null) { + actionList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + actionListBuilder_.clear(); + } return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return policy.Policy.internal_static_policy_PolicyRuleVariable_descriptor; + return policy.Policy.internal_static_policy_PolicyRuleBasic_descriptor; } @java.lang.Override - public policy.Policy.PolicyRuleVariable getDefaultInstanceForType() { - return policy.Policy.PolicyRuleVariable.getDefaultInstance(); + public policy.Policy.PolicyRuleBasic getDefaultInstanceForType() { + return policy.Policy.PolicyRuleBasic.getDefaultInstance(); } @java.lang.Override - public policy.Policy.PolicyRuleVariable build() { - policy.Policy.PolicyRuleVariable result = buildPartial(); + public policy.Policy.PolicyRuleBasic build() { + policy.Policy.PolicyRuleBasic result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -1984,9 +2261,44 @@ public final class Policy { } @java.lang.Override - public policy.Policy.PolicyRuleVariable buildPartial() { - policy.Policy.PolicyRuleVariable result = new policy.Policy.PolicyRuleVariable(this); - result.policyRuleVariable_ = policyRuleVariable_; + public policy.Policy.PolicyRuleBasic buildPartial() { + policy.Policy.PolicyRuleBasic result = new policy.Policy.PolicyRuleBasic(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (policyRuleIdBuilder_ == null) { + result.policyRuleId_ = policyRuleId_; + } else { + result.policyRuleId_ = policyRuleIdBuilder_.build(); + } + if (((from_bitField0_ & 0x00000001) != 0)) { + if (policyRuleStateBuilder_ == null) { + result.policyRuleState_ = policyRuleState_; + } else { + result.policyRuleState_ = policyRuleStateBuilder_.build(); + } + to_bitField0_ |= 0x00000001; + } + result.priority_ = priority_; + if (conditionListBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + conditionList_ = java.util.Collections.unmodifiableList(conditionList_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.conditionList_ = conditionList_; + } else { + result.conditionList_ = conditionListBuilder_.build(); + } + result.booleanOperator_ = booleanOperator_; + if (actionListBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + actionList_ = java.util.Collections.unmodifiableList(actionList_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.actionList_ = actionList_; + } else { + result.actionList_ = actionListBuilder_.build(); + } + result.bitField0_ = to_bitField0_; onBuilt(); return result; } @@ -2025,19 +2337,79 @@ public final class Policy { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof policy.Policy.PolicyRuleVariable) { - return mergeFrom((policy.Policy.PolicyRuleVariable)other); + if (other instanceof policy.Policy.PolicyRuleBasic) { + return mergeFrom((policy.Policy.PolicyRuleBasic)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(policy.Policy.PolicyRuleVariable other) { - if (other == policy.Policy.PolicyRuleVariable.getDefaultInstance()) return this; - if (!other.getPolicyRuleVariable().isEmpty()) { - policyRuleVariable_ = other.policyRuleVariable_; - onChanged(); + public Builder mergeFrom(policy.Policy.PolicyRuleBasic other) { + if (other == policy.Policy.PolicyRuleBasic.getDefaultInstance()) return this; + if (other.hasPolicyRuleId()) { + mergePolicyRuleId(other.getPolicyRuleId()); + } + if (other.hasPolicyRuleState()) { + mergePolicyRuleState(other.getPolicyRuleState()); + } + if (other.getPriority() != 0) { + setPriority(other.getPriority()); + } + if (conditionListBuilder_ == null) { + if (!other.conditionList_.isEmpty()) { + if (conditionList_.isEmpty()) { + conditionList_ = other.conditionList_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureConditionListIsMutable(); + conditionList_.addAll(other.conditionList_); + } + onChanged(); + } + } else { + if (!other.conditionList_.isEmpty()) { + if (conditionListBuilder_.isEmpty()) { + conditionListBuilder_.dispose(); + conditionListBuilder_ = null; + conditionList_ = other.conditionList_; + bitField0_ = (bitField0_ & ~0x00000002); + conditionListBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getConditionListFieldBuilder() : null; + } else { + conditionListBuilder_.addAllMessages(other.conditionList_); + } + } + } + if (other.booleanOperator_ != 0) { + setBooleanOperatorValue(other.getBooleanOperatorValue()); + } + if (actionListBuilder_ == null) { + if (!other.actionList_.isEmpty()) { + if (actionList_.isEmpty()) { + actionList_ = other.actionList_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureActionListIsMutable(); + actionList_.addAll(other.actionList_); + } + onChanged(); + } + } else { + if (!other.actionList_.isEmpty()) { + if (actionListBuilder_.isEmpty()) { + actionListBuilder_.dispose(); + actionListBuilder_ = null; + actionList_ = other.actionList_; + bitField0_ = (bitField0_ & ~0x00000004); + actionListBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getActionListFieldBuilder() : null; + } else { + actionListBuilder_.addAllMessages(other.actionList_); + } + } } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -2054,11 +2426,11 @@ public final class Policy { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - policy.Policy.PolicyRuleVariable parsedMessage = null; + policy.Policy.PolicyRuleBasic parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (policy.Policy.PolicyRuleVariable) e.getUnfinishedMessage(); + parsedMessage = (policy.Policy.PolicyRuleBasic) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -2067,2114 +2439,974 @@ public final class Policy { } return this; } + private int bitField0_; - private java.lang.Object policyRuleVariable_ = ""; + private policy.Policy.PolicyRuleId policyRuleId_; + private com.google.protobuf.SingleFieldBuilderV3< + policy.Policy.PolicyRuleId, policy.Policy.PolicyRuleId.Builder, policy.Policy.PolicyRuleIdOrBuilder> policyRuleIdBuilder_; + /** + * <code>.policy.PolicyRuleId policyRuleId = 1;</code> + * @return Whether the policyRuleId field is set. + */ + public boolean hasPolicyRuleId() { + return policyRuleIdBuilder_ != null || policyRuleId_ != null; + } /** - * <code>string policyRuleVariable = 1;</code> - * @return The policyRuleVariable. + * <code>.policy.PolicyRuleId policyRuleId = 1;</code> + * @return The policyRuleId. */ - public java.lang.String getPolicyRuleVariable() { - java.lang.Object ref = policyRuleVariable_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - policyRuleVariable_ = s; - return s; + public policy.Policy.PolicyRuleId getPolicyRuleId() { + if (policyRuleIdBuilder_ == null) { + return policyRuleId_ == null ? policy.Policy.PolicyRuleId.getDefaultInstance() : policyRuleId_; } else { - return (java.lang.String) ref; + return policyRuleIdBuilder_.getMessage(); } } /** - * <code>string policyRuleVariable = 1;</code> - * @return The bytes for policyRuleVariable. + * <code>.policy.PolicyRuleId policyRuleId = 1;</code> */ - public com.google.protobuf.ByteString - getPolicyRuleVariableBytes() { - java.lang.Object ref = policyRuleVariable_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - policyRuleVariable_ = b; - return b; + public Builder setPolicyRuleId(policy.Policy.PolicyRuleId value) { + if (policyRuleIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + policyRuleId_ = value; + onChanged(); } else { - return (com.google.protobuf.ByteString) ref; + policyRuleIdBuilder_.setMessage(value); } + + return this; } /** - * <code>string policyRuleVariable = 1;</code> - * @param value The policyRuleVariable to set. - * @return This builder for chaining. + * <code>.policy.PolicyRuleId policyRuleId = 1;</code> */ - public Builder setPolicyRuleVariable( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - policyRuleVariable_ = value; - onChanged(); + public Builder setPolicyRuleId( + policy.Policy.PolicyRuleId.Builder builderForValue) { + if (policyRuleIdBuilder_ == null) { + policyRuleId_ = builderForValue.build(); + onChanged(); + } else { + policyRuleIdBuilder_.setMessage(builderForValue.build()); + } + return this; } /** - * <code>string policyRuleVariable = 1;</code> - * @return This builder for chaining. + * <code>.policy.PolicyRuleId policyRuleId = 1;</code> */ - public Builder clearPolicyRuleVariable() { - - policyRuleVariable_ = getDefaultInstance().getPolicyRuleVariable(); - onChanged(); + public Builder mergePolicyRuleId(policy.Policy.PolicyRuleId value) { + if (policyRuleIdBuilder_ == null) { + if (policyRuleId_ != null) { + policyRuleId_ = + policy.Policy.PolicyRuleId.newBuilder(policyRuleId_).mergeFrom(value).buildPartial(); + } else { + policyRuleId_ = value; + } + onChanged(); + } else { + policyRuleIdBuilder_.mergeFrom(value); + } + return this; } /** - * <code>string policyRuleVariable = 1;</code> - * @param value The bytes for policyRuleVariable to set. - * @return This builder for chaining. + * <code>.policy.PolicyRuleId policyRuleId = 1;</code> */ - public Builder setPolicyRuleVariableBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); + public Builder clearPolicyRuleId() { + if (policyRuleIdBuilder_ == null) { + policyRuleId_ = null; + onChanged(); + } else { + policyRuleId_ = null; + policyRuleIdBuilder_ = null; + } + + return this; + } + /** + * <code>.policy.PolicyRuleId policyRuleId = 1;</code> + */ + public policy.Policy.PolicyRuleId.Builder getPolicyRuleIdBuilder() { - policyRuleVariable_ = value; onChanged(); - return this; + return getPolicyRuleIdFieldBuilder().getBuilder(); } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + /** + * <code>.policy.PolicyRuleId policyRuleId = 1;</code> + */ + public policy.Policy.PolicyRuleIdOrBuilder getPolicyRuleIdOrBuilder() { + if (policyRuleIdBuilder_ != null) { + return policyRuleIdBuilder_.getMessageOrBuilder(); + } else { + return policyRuleId_ == null ? + policy.Policy.PolicyRuleId.getDefaultInstance() : policyRuleId_; + } } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + /** + * <code>.policy.PolicyRuleId policyRuleId = 1;</code> + */ + private com.google.protobuf.SingleFieldBuilderV3< + policy.Policy.PolicyRuleId, policy.Policy.PolicyRuleId.Builder, policy.Policy.PolicyRuleIdOrBuilder> + getPolicyRuleIdFieldBuilder() { + if (policyRuleIdBuilder_ == null) { + policyRuleIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + policy.Policy.PolicyRuleId, policy.Policy.PolicyRuleId.Builder, policy.Policy.PolicyRuleIdOrBuilder>( + getPolicyRuleId(), + getParentForChildren(), + isClean()); + policyRuleId_ = null; + } + return policyRuleIdBuilder_; } - - // @@protoc_insertion_point(builder_scope:policy.PolicyRuleVariable) - } - - // @@protoc_insertion_point(class_scope:policy.PolicyRuleVariable) - private static final policy.Policy.PolicyRuleVariable DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new policy.Policy.PolicyRuleVariable(); - } - - public static policy.Policy.PolicyRuleVariable getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser<PolicyRuleVariable> - PARSER = new com.google.protobuf.AbstractParser<PolicyRuleVariable>() { - @java.lang.Override - public PolicyRuleVariable parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new PolicyRuleVariable(input, extensionRegistry); + private policy.Policy.PolicyRuleState policyRuleState_; + private com.google.protobuf.SingleFieldBuilderV3< + policy.Policy.PolicyRuleState, policy.Policy.PolicyRuleState.Builder, policy.Policy.PolicyRuleStateOrBuilder> policyRuleStateBuilder_; + /** + * <code>optional .policy.PolicyRuleState policyRuleState = 2;</code> + * @return Whether the policyRuleState field is set. + */ + public boolean hasPolicyRuleState() { + return ((bitField0_ & 0x00000001) != 0); } - }; - - public static com.google.protobuf.Parser<PolicyRuleVariable> parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser<PolicyRuleVariable> getParserForType() { - return PARSER; - } - - @java.lang.Override - public policy.Policy.PolicyRuleVariable getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface PolicyRuleValueOrBuilder extends - // @@protoc_insertion_point(interface_extends:policy.PolicyRuleValue) - com.google.protobuf.MessageOrBuilder { - - /** - * <code>string policyRuleValue = 1;</code> - * @return The policyRuleValue. - */ - java.lang.String getPolicyRuleValue(); - /** - * <code>string policyRuleValue = 1;</code> - * @return The bytes for policyRuleValue. - */ - com.google.protobuf.ByteString - getPolicyRuleValueBytes(); - } - /** - * Protobuf type {@code policy.PolicyRuleValue} - */ - public static final class PolicyRuleValue extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:policy.PolicyRuleValue) - PolicyRuleValueOrBuilder { - private static final long serialVersionUID = 0L; - // Use PolicyRuleValue.newBuilder() to construct. - private PolicyRuleValue(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { - super(builder); - } - private PolicyRuleValue() { - policyRuleValue_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new PolicyRuleValue(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private PolicyRuleValue( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); + /** + * <code>optional .policy.PolicyRuleState policyRuleState = 2;</code> + * @return The policyRuleState. + */ + public policy.Policy.PolicyRuleState getPolicyRuleState() { + if (policyRuleStateBuilder_ == null) { + return policyRuleState_ == null ? policy.Policy.PolicyRuleState.getDefaultInstance() : policyRuleState_; + } else { + return policyRuleStateBuilder_.getMessage(); + } } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - policyRuleValue_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } + /** + * <code>optional .policy.PolicyRuleState policyRuleState = 2;</code> + */ + public Builder setPolicyRuleState(policy.Policy.PolicyRuleState value) { + if (policyRuleStateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); } + policyRuleState_ = value; + onChanged(); + } else { + policyRuleStateBuilder_.setMessage(value); } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); + bitField0_ |= 0x00000001; + return this; } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return policy.Policy.internal_static_policy_PolicyRuleValue_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return policy.Policy.internal_static_policy_PolicyRuleValue_fieldAccessorTable - .ensureFieldAccessorsInitialized( - policy.Policy.PolicyRuleValue.class, policy.Policy.PolicyRuleValue.Builder.class); - } - - public static final int POLICYRULEVALUE_FIELD_NUMBER = 1; - private volatile java.lang.Object policyRuleValue_; - /** - * <code>string policyRuleValue = 1;</code> - * @return The policyRuleValue. - */ - @java.lang.Override - public java.lang.String getPolicyRuleValue() { - java.lang.Object ref = policyRuleValue_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - policyRuleValue_ = s; - return s; + /** + * <code>optional .policy.PolicyRuleState policyRuleState = 2;</code> + */ + public Builder setPolicyRuleState( + policy.Policy.PolicyRuleState.Builder builderForValue) { + if (policyRuleStateBuilder_ == null) { + policyRuleState_ = builderForValue.build(); + onChanged(); + } else { + policyRuleStateBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + return this; } - } - /** - * <code>string policyRuleValue = 1;</code> - * @return The bytes for policyRuleValue. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getPolicyRuleValueBytes() { - java.lang.Object ref = policyRuleValue_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - policyRuleValue_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; + /** + * <code>optional .policy.PolicyRuleState policyRuleState = 2;</code> + */ + public Builder mergePolicyRuleState(policy.Policy.PolicyRuleState value) { + if (policyRuleStateBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + policyRuleState_ != null && + policyRuleState_ != policy.Policy.PolicyRuleState.getDefaultInstance()) { + policyRuleState_ = + policy.Policy.PolicyRuleState.newBuilder(policyRuleState_).mergeFrom(value).buildPartial(); + } else { + policyRuleState_ = value; + } + onChanged(); + } else { + policyRuleStateBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + return this; } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getPolicyRuleValueBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, policyRuleValue_); + /** + * <code>optional .policy.PolicyRuleState policyRuleState = 2;</code> + */ + public Builder clearPolicyRuleState() { + if (policyRuleStateBuilder_ == null) { + policyRuleState_ = null; + onChanged(); + } else { + policyRuleStateBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getPolicyRuleValueBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, policyRuleValue_); + /** + * <code>optional .policy.PolicyRuleState policyRuleState = 2;</code> + */ + public policy.Policy.PolicyRuleState.Builder getPolicyRuleStateBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getPolicyRuleStateFieldBuilder().getBuilder(); } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof policy.Policy.PolicyRuleValue)) { - return super.equals(obj); - } - policy.Policy.PolicyRuleValue other = (policy.Policy.PolicyRuleValue) obj; - - if (!getPolicyRuleValue() - .equals(other.getPolicyRuleValue())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + POLICYRULEVALUE_FIELD_NUMBER; - hash = (53 * hash) + getPolicyRuleValue().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static policy.Policy.PolicyRuleValue parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static policy.Policy.PolicyRuleValue parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static policy.Policy.PolicyRuleValue parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static policy.Policy.PolicyRuleValue parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static policy.Policy.PolicyRuleValue parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static policy.Policy.PolicyRuleValue parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static policy.Policy.PolicyRuleValue parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static policy.Policy.PolicyRuleValue parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static policy.Policy.PolicyRuleValue parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static policy.Policy.PolicyRuleValue parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static policy.Policy.PolicyRuleValue parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static policy.Policy.PolicyRuleValue parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(policy.Policy.PolicyRuleValue prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code policy.PolicyRuleValue} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements - // @@protoc_insertion_point(builder_implements:policy.PolicyRuleValue) - policy.Policy.PolicyRuleValueOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return policy.Policy.internal_static_policy_PolicyRuleValue_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return policy.Policy.internal_static_policy_PolicyRuleValue_fieldAccessorTable - .ensureFieldAccessorsInitialized( - policy.Policy.PolicyRuleValue.class, policy.Policy.PolicyRuleValue.Builder.class); - } - - // Construct using policy.Policy.PolicyRuleValue.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - policyRuleValue_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return policy.Policy.internal_static_policy_PolicyRuleValue_descriptor; - } - - @java.lang.Override - public policy.Policy.PolicyRuleValue getDefaultInstanceForType() { - return policy.Policy.PolicyRuleValue.getDefaultInstance(); - } - - @java.lang.Override - public policy.Policy.PolicyRuleValue build() { - policy.Policy.PolicyRuleValue result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public policy.Policy.PolicyRuleValue buildPartial() { - policy.Policy.PolicyRuleValue result = new policy.Policy.PolicyRuleValue(this); - result.policyRuleValue_ = policyRuleValue_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof policy.Policy.PolicyRuleValue) { - return mergeFrom((policy.Policy.PolicyRuleValue)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(policy.Policy.PolicyRuleValue other) { - if (other == policy.Policy.PolicyRuleValue.getDefaultInstance()) return this; - if (!other.getPolicyRuleValue().isEmpty()) { - policyRuleValue_ = other.policyRuleValue_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - policy.Policy.PolicyRuleValue parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (policy.Policy.PolicyRuleValue) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object policyRuleValue_ = ""; /** - * <code>string policyRuleValue = 1;</code> - * @return The policyRuleValue. + * <code>optional .policy.PolicyRuleState policyRuleState = 2;</code> */ - public java.lang.String getPolicyRuleValue() { - java.lang.Object ref = policyRuleValue_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - policyRuleValue_ = s; - return s; + public policy.Policy.PolicyRuleStateOrBuilder getPolicyRuleStateOrBuilder() { + if (policyRuleStateBuilder_ != null) { + return policyRuleStateBuilder_.getMessageOrBuilder(); } else { - return (java.lang.String) ref; + return policyRuleState_ == null ? + policy.Policy.PolicyRuleState.getDefaultInstance() : policyRuleState_; } } /** - * <code>string policyRuleValue = 1;</code> - * @return The bytes for policyRuleValue. + * <code>optional .policy.PolicyRuleState policyRuleState = 2;</code> */ - public com.google.protobuf.ByteString - getPolicyRuleValueBytes() { - java.lang.Object ref = policyRuleValue_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - policyRuleValue_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; + private com.google.protobuf.SingleFieldBuilderV3< + policy.Policy.PolicyRuleState, policy.Policy.PolicyRuleState.Builder, policy.Policy.PolicyRuleStateOrBuilder> + getPolicyRuleStateFieldBuilder() { + if (policyRuleStateBuilder_ == null) { + policyRuleStateBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + policy.Policy.PolicyRuleState, policy.Policy.PolicyRuleState.Builder, policy.Policy.PolicyRuleStateOrBuilder>( + getPolicyRuleState(), + getParentForChildren(), + isClean()); + policyRuleState_ = null; } + return policyRuleStateBuilder_; } + + private int priority_ ; /** - * <code>string policyRuleValue = 1;</code> - * @param value The policyRuleValue to set. - * @return This builder for chaining. + * <code>uint32 priority = 3;</code> + * @return The priority. */ - public Builder setPolicyRuleValue( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - policyRuleValue_ = value; - onChanged(); - return this; + @java.lang.Override + public int getPriority() { + return priority_; } /** - * <code>string policyRuleValue = 1;</code> + * <code>uint32 priority = 3;</code> + * @param value The priority to set. * @return This builder for chaining. */ - public Builder clearPolicyRuleValue() { + public Builder setPriority(int value) { - policyRuleValue_ = getDefaultInstance().getPolicyRuleValue(); + priority_ = value; onChanged(); return this; } /** - * <code>string policyRuleValue = 1;</code> - * @param value The bytes for policyRuleValue to set. + * <code>uint32 priority = 3;</code> * @return This builder for chaining. */ - public Builder setPolicyRuleValueBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); + public Builder clearPriority() { - policyRuleValue_ = value; + priority_ = 0; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + private java.util.List<policy.PolicyCondition.PolicyRuleCondition> conditionList_ = + java.util.Collections.emptyList(); + private void ensureConditionListIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + conditionList_ = new java.util.ArrayList<policy.PolicyCondition.PolicyRuleCondition>(conditionList_); + bitField0_ |= 0x00000002; + } } + private com.google.protobuf.RepeatedFieldBuilderV3< + policy.PolicyCondition.PolicyRuleCondition, policy.PolicyCondition.PolicyRuleCondition.Builder, policy.PolicyCondition.PolicyRuleConditionOrBuilder> conditionListBuilder_; - // @@protoc_insertion_point(builder_scope:policy.PolicyRuleValue) - } - - // @@protoc_insertion_point(class_scope:policy.PolicyRuleValue) - private static final policy.Policy.PolicyRuleValue DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new policy.Policy.PolicyRuleValue(); - } - - public static policy.Policy.PolicyRuleValue getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser<PolicyRuleValue> - PARSER = new com.google.protobuf.AbstractParser<PolicyRuleValue>() { - @java.lang.Override - public PolicyRuleValue parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new PolicyRuleValue(input, extensionRegistry); + /** + * <pre> + * Event-Condition-Action (ECA) model + * </pre> + * + * <code>repeated .policy.PolicyRuleCondition conditionList = 4;</code> + */ + public java.util.List<policy.PolicyCondition.PolicyRuleCondition> getConditionListList() { + if (conditionListBuilder_ == null) { + return java.util.Collections.unmodifiableList(conditionList_); + } else { + return conditionListBuilder_.getMessageList(); + } } - }; - - public static com.google.protobuf.Parser<PolicyRuleValue> parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser<PolicyRuleValue> getParserForType() { - return PARSER; - } - - @java.lang.Override - public policy.Policy.PolicyRuleValue getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface PolicyRuleEventOrBuilder extends - // @@protoc_insertion_point(interface_extends:policy.PolicyRuleEvent) - com.google.protobuf.MessageOrBuilder { - - /** - * <code>.context.Event event = 1;</code> - * @return Whether the event field is set. - */ - boolean hasEvent(); - /** - * <code>.context.Event event = 1;</code> - * @return The event. - */ - context.ContextOuterClass.Event getEvent(); - /** - * <code>.context.Event event = 1;</code> - */ - context.ContextOuterClass.EventOrBuilder getEventOrBuilder(); - } - /** - * <pre> - * 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 - * </pre> - * - * Protobuf type {@code policy.PolicyRuleEvent} - */ - public static final class PolicyRuleEvent extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:policy.PolicyRuleEvent) - PolicyRuleEventOrBuilder { - private static final long serialVersionUID = 0L; - // Use PolicyRuleEvent.newBuilder() to construct. - private PolicyRuleEvent(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { - super(builder); - } - private PolicyRuleEvent() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new PolicyRuleEvent(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private PolicyRuleEvent( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); + /** + * <pre> + * Event-Condition-Action (ECA) model + * </pre> + * + * <code>repeated .policy.PolicyRuleCondition conditionList = 4;</code> + */ + public int getConditionListCount() { + if (conditionListBuilder_ == null) { + return conditionList_.size(); + } else { + return conditionListBuilder_.getCount(); + } } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - context.ContextOuterClass.Event.Builder subBuilder = null; - if (event_ != null) { - subBuilder = event_.toBuilder(); - } - event_ = input.readMessage(context.ContextOuterClass.Event.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(event_); - event_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } + /** + * <pre> + * Event-Condition-Action (ECA) model + * </pre> + * + * <code>repeated .policy.PolicyRuleCondition conditionList = 4;</code> + */ + public policy.PolicyCondition.PolicyRuleCondition getConditionList(int index) { + if (conditionListBuilder_ == null) { + return conditionList_.get(index); + } else { + return conditionListBuilder_.getMessage(index); + } + } + /** + * <pre> + * Event-Condition-Action (ECA) model + * </pre> + * + * <code>repeated .policy.PolicyRuleCondition conditionList = 4;</code> + */ + public Builder setConditionList( + int index, policy.PolicyCondition.PolicyRuleCondition value) { + if (conditionListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); } + ensureConditionListIsMutable(); + conditionList_.set(index, value); + onChanged(); + } else { + conditionListBuilder_.setMessage(index, value); } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); + return this; } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return policy.Policy.internal_static_policy_PolicyRuleEvent_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return policy.Policy.internal_static_policy_PolicyRuleEvent_fieldAccessorTable - .ensureFieldAccessorsInitialized( - policy.Policy.PolicyRuleEvent.class, policy.Policy.PolicyRuleEvent.Builder.class); - } - - public static final int EVENT_FIELD_NUMBER = 1; - private context.ContextOuterClass.Event event_; - /** - * <code>.context.Event event = 1;</code> - * @return Whether the event field is set. - */ - @java.lang.Override - public boolean hasEvent() { - return event_ != null; - } - /** - * <code>.context.Event event = 1;</code> - * @return The event. - */ - @java.lang.Override - public context.ContextOuterClass.Event getEvent() { - return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; - } - /** - * <code>.context.Event event = 1;</code> - */ - @java.lang.Override - public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { - return getEvent(); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (event_ != null) { - output.writeMessage(1, getEvent()); + /** + * <pre> + * Event-Condition-Action (ECA) model + * </pre> + * + * <code>repeated .policy.PolicyRuleCondition conditionList = 4;</code> + */ + public Builder setConditionList( + int index, policy.PolicyCondition.PolicyRuleCondition.Builder builderForValue) { + if (conditionListBuilder_ == null) { + ensureConditionListIsMutable(); + conditionList_.set(index, builderForValue.build()); + onChanged(); + } else { + conditionListBuilder_.setMessage(index, builderForValue.build()); + } + return this; } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (event_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getEvent()); + /** + * <pre> + * Event-Condition-Action (ECA) model + * </pre> + * + * <code>repeated .policy.PolicyRuleCondition conditionList = 4;</code> + */ + public Builder addConditionList(policy.PolicyCondition.PolicyRuleCondition value) { + if (conditionListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConditionListIsMutable(); + conditionList_.add(value); + onChanged(); + } else { + conditionListBuilder_.addMessage(value); + } + return this; } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; + /** + * <pre> + * Event-Condition-Action (ECA) model + * </pre> + * + * <code>repeated .policy.PolicyRuleCondition conditionList = 4;</code> + */ + public Builder addConditionList( + int index, policy.PolicyCondition.PolicyRuleCondition value) { + if (conditionListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConditionListIsMutable(); + conditionList_.add(index, value); + onChanged(); + } else { + conditionListBuilder_.addMessage(index, value); + } + return this; } - if (!(obj instanceof policy.Policy.PolicyRuleEvent)) { - return super.equals(obj); + /** + * <pre> + * Event-Condition-Action (ECA) model + * </pre> + * + * <code>repeated .policy.PolicyRuleCondition conditionList = 4;</code> + */ + public Builder addConditionList( + policy.PolicyCondition.PolicyRuleCondition.Builder builderForValue) { + if (conditionListBuilder_ == null) { + ensureConditionListIsMutable(); + conditionList_.add(builderForValue.build()); + onChanged(); + } else { + conditionListBuilder_.addMessage(builderForValue.build()); + } + return this; } - policy.Policy.PolicyRuleEvent other = (policy.Policy.PolicyRuleEvent) obj; - - if (hasEvent() != other.hasEvent()) return false; - if (hasEvent()) { - if (!getEvent() - .equals(other.getEvent())) return false; + /** + * <pre> + * Event-Condition-Action (ECA) model + * </pre> + * + * <code>repeated .policy.PolicyRuleCondition conditionList = 4;</code> + */ + public Builder addConditionList( + int index, policy.PolicyCondition.PolicyRuleCondition.Builder builderForValue) { + if (conditionListBuilder_ == null) { + ensureConditionListIsMutable(); + conditionList_.add(index, builderForValue.build()); + onChanged(); + } else { + conditionListBuilder_.addMessage(index, builderForValue.build()); + } + return this; } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasEvent()) { - hash = (37 * hash) + EVENT_FIELD_NUMBER; - hash = (53 * hash) + getEvent().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static policy.Policy.PolicyRuleEvent parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static policy.Policy.PolicyRuleEvent parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static policy.Policy.PolicyRuleEvent parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static policy.Policy.PolicyRuleEvent parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static policy.Policy.PolicyRuleEvent parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static policy.Policy.PolicyRuleEvent parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static policy.Policy.PolicyRuleEvent parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static policy.Policy.PolicyRuleEvent parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static policy.Policy.PolicyRuleEvent parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static policy.Policy.PolicyRuleEvent parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static policy.Policy.PolicyRuleEvent parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static policy.Policy.PolicyRuleEvent parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(policy.Policy.PolicyRuleEvent prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * <pre> - * 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 - * </pre> - * - * Protobuf type {@code policy.PolicyRuleEvent} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements - // @@protoc_insertion_point(builder_implements:policy.PolicyRuleEvent) - policy.Policy.PolicyRuleEventOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return policy.Policy.internal_static_policy_PolicyRuleEvent_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return policy.Policy.internal_static_policy_PolicyRuleEvent_fieldAccessorTable - .ensureFieldAccessorsInitialized( - policy.Policy.PolicyRuleEvent.class, policy.Policy.PolicyRuleEvent.Builder.class); - } - - // Construct using policy.Policy.PolicyRuleEvent.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (eventBuilder_ == null) { - event_ = null; - } else { - event_ = null; - eventBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return policy.Policy.internal_static_policy_PolicyRuleEvent_descriptor; - } - - @java.lang.Override - public policy.Policy.PolicyRuleEvent getDefaultInstanceForType() { - return policy.Policy.PolicyRuleEvent.getDefaultInstance(); - } - - @java.lang.Override - public policy.Policy.PolicyRuleEvent build() { - policy.Policy.PolicyRuleEvent result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public policy.Policy.PolicyRuleEvent buildPartial() { - policy.Policy.PolicyRuleEvent result = new policy.Policy.PolicyRuleEvent(this); - if (eventBuilder_ == null) { - result.event_ = event_; - } else { - result.event_ = eventBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof policy.Policy.PolicyRuleEvent) { - return mergeFrom((policy.Policy.PolicyRuleEvent)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(policy.Policy.PolicyRuleEvent other) { - if (other == policy.Policy.PolicyRuleEvent.getDefaultInstance()) return this; - if (other.hasEvent()) { - mergeEvent(other.getEvent()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - policy.Policy.PolicyRuleEvent parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (policy.Policy.PolicyRuleEvent) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private context.ContextOuterClass.Event event_; - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> eventBuilder_; - /** - * <code>.context.Event event = 1;</code> - * @return Whether the event field is set. - */ - public boolean hasEvent() { - return eventBuilder_ != null || event_ != null; + /** + * <pre> + * Event-Condition-Action (ECA) model + * </pre> + * + * <code>repeated .policy.PolicyRuleCondition conditionList = 4;</code> + */ + public Builder addAllConditionList( + java.lang.Iterable<? extends policy.PolicyCondition.PolicyRuleCondition> values) { + if (conditionListBuilder_ == null) { + ensureConditionListIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, conditionList_); + onChanged(); + } else { + conditionListBuilder_.addAllMessages(values); + } + return this; } /** - * <code>.context.Event event = 1;</code> - * @return The event. + * <pre> + * Event-Condition-Action (ECA) model + * </pre> + * + * <code>repeated .policy.PolicyRuleCondition conditionList = 4;</code> */ - public context.ContextOuterClass.Event getEvent() { - if (eventBuilder_ == null) { - return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; + public Builder clearConditionList() { + if (conditionListBuilder_ == null) { + conditionList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); } else { - return eventBuilder_.getMessage(); + conditionListBuilder_.clear(); } + return this; } /** - * <code>.context.Event event = 1;</code> + * <pre> + * Event-Condition-Action (ECA) model + * </pre> + * + * <code>repeated .policy.PolicyRuleCondition conditionList = 4;</code> */ - public Builder setEvent(context.ContextOuterClass.Event value) { - if (eventBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - event_ = value; + public Builder removeConditionList(int index) { + if (conditionListBuilder_ == null) { + ensureConditionListIsMutable(); + conditionList_.remove(index); onChanged(); } else { - eventBuilder_.setMessage(value); + conditionListBuilder_.remove(index); } - return this; } /** - * <code>.context.Event event = 1;</code> + * <pre> + * Event-Condition-Action (ECA) model + * </pre> + * + * <code>repeated .policy.PolicyRuleCondition conditionList = 4;</code> */ - public Builder setEvent( - context.ContextOuterClass.Event.Builder builderForValue) { - if (eventBuilder_ == null) { - event_ = builderForValue.build(); - onChanged(); - } else { - eventBuilder_.setMessage(builderForValue.build()); - } - - return this; + public policy.PolicyCondition.PolicyRuleCondition.Builder getConditionListBuilder( + int index) { + return getConditionListFieldBuilder().getBuilder(index); } /** - * <code>.context.Event event = 1;</code> + * <pre> + * Event-Condition-Action (ECA) model + * </pre> + * + * <code>repeated .policy.PolicyRuleCondition conditionList = 4;</code> */ - public Builder mergeEvent(context.ContextOuterClass.Event value) { - if (eventBuilder_ == null) { - if (event_ != null) { - event_ = - context.ContextOuterClass.Event.newBuilder(event_).mergeFrom(value).buildPartial(); - } else { - event_ = value; - } - onChanged(); - } else { - eventBuilder_.mergeFrom(value); + public policy.PolicyCondition.PolicyRuleConditionOrBuilder getConditionListOrBuilder( + int index) { + if (conditionListBuilder_ == null) { + return conditionList_.get(index); } else { + return conditionListBuilder_.getMessageOrBuilder(index); } - - return this; } /** - * <code>.context.Event event = 1;</code> + * <pre> + * Event-Condition-Action (ECA) model + * </pre> + * + * <code>repeated .policy.PolicyRuleCondition conditionList = 4;</code> */ - public Builder clearEvent() { - if (eventBuilder_ == null) { - event_ = null; - onChanged(); + public java.util.List<? extends policy.PolicyCondition.PolicyRuleConditionOrBuilder> + getConditionListOrBuilderList() { + if (conditionListBuilder_ != null) { + return conditionListBuilder_.getMessageOrBuilderList(); } else { - event_ = null; - eventBuilder_ = null; + return java.util.Collections.unmodifiableList(conditionList_); } - - return this; } /** - * <code>.context.Event event = 1;</code> + * <pre> + * Event-Condition-Action (ECA) model + * </pre> + * + * <code>repeated .policy.PolicyRuleCondition conditionList = 4;</code> */ - public context.ContextOuterClass.Event.Builder getEventBuilder() { - - onChanged(); - return getEventFieldBuilder().getBuilder(); + public policy.PolicyCondition.PolicyRuleCondition.Builder addConditionListBuilder() { + return getConditionListFieldBuilder().addBuilder( + policy.PolicyCondition.PolicyRuleCondition.getDefaultInstance()); } /** - * <code>.context.Event event = 1;</code> + * <pre> + * Event-Condition-Action (ECA) model + * </pre> + * + * <code>repeated .policy.PolicyRuleCondition conditionList = 4;</code> */ - public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { - if (eventBuilder_ != null) { - return eventBuilder_.getMessageOrBuilder(); - } else { - return event_ == null ? - context.ContextOuterClass.Event.getDefaultInstance() : event_; - } + public policy.PolicyCondition.PolicyRuleCondition.Builder addConditionListBuilder( + int index) { + return getConditionListFieldBuilder().addBuilder( + index, policy.PolicyCondition.PolicyRuleCondition.getDefaultInstance()); } /** - * <code>.context.Event event = 1;</code> + * <pre> + * Event-Condition-Action (ECA) model + * </pre> + * + * <code>repeated .policy.PolicyRuleCondition conditionList = 4;</code> */ - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> - getEventFieldBuilder() { - if (eventBuilder_ == null) { - eventBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder>( - getEvent(), + public java.util.List<policy.PolicyCondition.PolicyRuleCondition.Builder> + getConditionListBuilderList() { + return getConditionListFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + policy.PolicyCondition.PolicyRuleCondition, policy.PolicyCondition.PolicyRuleCondition.Builder, policy.PolicyCondition.PolicyRuleConditionOrBuilder> + getConditionListFieldBuilder() { + if (conditionListBuilder_ == null) { + conditionListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + policy.PolicyCondition.PolicyRuleCondition, policy.PolicyCondition.PolicyRuleCondition.Builder, policy.PolicyCondition.PolicyRuleConditionOrBuilder>( + conditionList_, + ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); - event_ = null; + conditionList_ = null; } - return eventBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + return conditionListBuilder_; } - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + private int booleanOperator_ = 0; + /** + * <pre> + * Evaluation operator to be used + * </pre> + * + * <code>.policy.BooleanOperator booleanOperator = 5;</code> + * @return The enum numeric value on the wire for booleanOperator. + */ + @java.lang.Override public int getBooleanOperatorValue() { + return booleanOperator_; } - - - // @@protoc_insertion_point(builder_scope:policy.PolicyRuleEvent) - } - - // @@protoc_insertion_point(class_scope:policy.PolicyRuleEvent) - private static final policy.Policy.PolicyRuleEvent DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new policy.Policy.PolicyRuleEvent(); - } - - public static policy.Policy.PolicyRuleEvent getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser<PolicyRuleEvent> - PARSER = new com.google.protobuf.AbstractParser<PolicyRuleEvent>() { - @java.lang.Override - public PolicyRuleEvent parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new PolicyRuleEvent(input, extensionRegistry); + /** + * <pre> + * Evaluation operator to be used + * </pre> + * + * <code>.policy.BooleanOperator booleanOperator = 5;</code> + * @param value The enum numeric value on the wire for booleanOperator to set. + * @return This builder for chaining. + */ + public Builder setBooleanOperatorValue(int value) { + + booleanOperator_ = value; + onChanged(); + return this; } - }; - - public static com.google.protobuf.Parser<PolicyRuleEvent> parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser<PolicyRuleEvent> getParserForType() { - return PARSER; - } - - @java.lang.Override - public policy.Policy.PolicyRuleEvent getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface PolicyRuleConditionOrBuilder extends - // @@protoc_insertion_point(interface_extends:policy.PolicyRuleCondition) - com.google.protobuf.MessageOrBuilder { - - /** - * <code>.policy.PolicyRuleVariable polRuleConditionVar = 1;</code> - * @return Whether the polRuleConditionVar field is set. - */ - boolean hasPolRuleConditionVar(); - /** - * <code>.policy.PolicyRuleVariable polRuleConditionVar = 1;</code> - * @return The polRuleConditionVar. - */ - policy.Policy.PolicyRuleVariable getPolRuleConditionVar(); - /** - * <code>.policy.PolicyRuleVariable polRuleConditionVar = 1;</code> - */ - policy.Policy.PolicyRuleVariableOrBuilder getPolRuleConditionVarOrBuilder(); - - /** - * <code>.policy.PolicyRuleValue polRuleConditionVal = 2;</code> - * @return Whether the polRuleConditionVal field is set. - */ - boolean hasPolRuleConditionVal(); - /** - * <code>.policy.PolicyRuleValue polRuleConditionVal = 2;</code> - * @return The polRuleConditionVal. - */ - policy.Policy.PolicyRuleValue getPolRuleConditionVal(); - /** - * <code>.policy.PolicyRuleValue polRuleConditionVal = 2;</code> - */ - policy.Policy.PolicyRuleValueOrBuilder getPolRuleConditionValOrBuilder(); - } - /** - * <pre> - * Condition - * </pre> - * - * Protobuf type {@code policy.PolicyRuleCondition} - */ - public static final class PolicyRuleCondition extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:policy.PolicyRuleCondition) - PolicyRuleConditionOrBuilder { - private static final long serialVersionUID = 0L; - // Use PolicyRuleCondition.newBuilder() to construct. - private PolicyRuleCondition(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { - super(builder); - } - private PolicyRuleCondition() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new PolicyRuleCondition(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private PolicyRuleCondition( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); + /** + * <pre> + * Evaluation operator to be used + * </pre> + * + * <code>.policy.BooleanOperator booleanOperator = 5;</code> + * @return The booleanOperator. + */ + @java.lang.Override + public policy.PolicyCondition.BooleanOperator getBooleanOperator() { + @SuppressWarnings("deprecation") + policy.PolicyCondition.BooleanOperator result = policy.PolicyCondition.BooleanOperator.valueOf(booleanOperator_); + return result == null ? policy.PolicyCondition.BooleanOperator.UNRECOGNIZED : result; } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - policy.Policy.PolicyRuleVariable.Builder subBuilder = null; - if (polRuleConditionVar_ != null) { - subBuilder = polRuleConditionVar_.toBuilder(); - } - polRuleConditionVar_ = input.readMessage(policy.Policy.PolicyRuleVariable.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(polRuleConditionVar_); - polRuleConditionVar_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - policy.Policy.PolicyRuleValue.Builder subBuilder = null; - if (polRuleConditionVal_ != null) { - subBuilder = polRuleConditionVal_.toBuilder(); - } - polRuleConditionVal_ = input.readMessage(policy.Policy.PolicyRuleValue.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(polRuleConditionVal_); - polRuleConditionVal_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } + /** + * <pre> + * Evaluation operator to be used + * </pre> + * + * <code>.policy.BooleanOperator booleanOperator = 5;</code> + * @param value The booleanOperator to set. + * @return This builder for chaining. + */ + public Builder setBooleanOperator(policy.PolicyCondition.BooleanOperator value) { + if (value == null) { + throw new NullPointerException(); } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); + + booleanOperator_ = value.getNumber(); + onChanged(); + return this; } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return policy.Policy.internal_static_policy_PolicyRuleCondition_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return policy.Policy.internal_static_policy_PolicyRuleCondition_fieldAccessorTable - .ensureFieldAccessorsInitialized( - policy.Policy.PolicyRuleCondition.class, policy.Policy.PolicyRuleCondition.Builder.class); - } - - public static final int POLRULECONDITIONVAR_FIELD_NUMBER = 1; - private policy.Policy.PolicyRuleVariable polRuleConditionVar_; - /** - * <code>.policy.PolicyRuleVariable polRuleConditionVar = 1;</code> - * @return Whether the polRuleConditionVar field is set. - */ - @java.lang.Override - public boolean hasPolRuleConditionVar() { - return polRuleConditionVar_ != null; - } - /** - * <code>.policy.PolicyRuleVariable polRuleConditionVar = 1;</code> - * @return The polRuleConditionVar. - */ - @java.lang.Override - public policy.Policy.PolicyRuleVariable getPolRuleConditionVar() { - return polRuleConditionVar_ == null ? policy.Policy.PolicyRuleVariable.getDefaultInstance() : polRuleConditionVar_; - } - /** - * <code>.policy.PolicyRuleVariable polRuleConditionVar = 1;</code> - */ - @java.lang.Override - public policy.Policy.PolicyRuleVariableOrBuilder getPolRuleConditionVarOrBuilder() { - return getPolRuleConditionVar(); - } - - public static final int POLRULECONDITIONVAL_FIELD_NUMBER = 2; - private policy.Policy.PolicyRuleValue polRuleConditionVal_; - /** - * <code>.policy.PolicyRuleValue polRuleConditionVal = 2;</code> - * @return Whether the polRuleConditionVal field is set. - */ - @java.lang.Override - public boolean hasPolRuleConditionVal() { - return polRuleConditionVal_ != null; - } - /** - * <code>.policy.PolicyRuleValue polRuleConditionVal = 2;</code> - * @return The polRuleConditionVal. - */ - @java.lang.Override - public policy.Policy.PolicyRuleValue getPolRuleConditionVal() { - return polRuleConditionVal_ == null ? policy.Policy.PolicyRuleValue.getDefaultInstance() : polRuleConditionVal_; - } - /** - * <code>.policy.PolicyRuleValue polRuleConditionVal = 2;</code> - */ - @java.lang.Override - public policy.Policy.PolicyRuleValueOrBuilder getPolRuleConditionValOrBuilder() { - return getPolRuleConditionVal(); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (polRuleConditionVar_ != null) { - output.writeMessage(1, getPolRuleConditionVar()); + /** + * <pre> + * Evaluation operator to be used + * </pre> + * + * <code>.policy.BooleanOperator booleanOperator = 5;</code> + * @return This builder for chaining. + */ + public Builder clearBooleanOperator() { + + booleanOperator_ = 0; + onChanged(); + return this; } - if (polRuleConditionVal_ != null) { - output.writeMessage(2, getPolRuleConditionVal()); + + private java.util.List<policy.PolicyAction.PolicyRuleAction> actionList_ = + java.util.Collections.emptyList(); + private void ensureActionListIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + actionList_ = new java.util.ArrayList<policy.PolicyAction.PolicyRuleAction>(actionList_); + bitField0_ |= 0x00000004; + } } - unknownFields.writeTo(output); - } - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; + private com.google.protobuf.RepeatedFieldBuilderV3< + policy.PolicyAction.PolicyRuleAction, policy.PolicyAction.PolicyRuleAction.Builder, policy.PolicyAction.PolicyRuleActionOrBuilder> actionListBuilder_; - size = 0; - if (polRuleConditionVar_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getPolRuleConditionVar()); - } - if (polRuleConditionVal_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getPolRuleConditionVal()); + /** + * <pre> + * One or more actions should be applied + * </pre> + * + * <code>repeated .policy.PolicyRuleAction actionList = 6;</code> + */ + public java.util.List<policy.PolicyAction.PolicyRuleAction> getActionListList() { + if (actionListBuilder_ == null) { + return java.util.Collections.unmodifiableList(actionList_); + } else { + return actionListBuilder_.getMessageList(); + } } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof policy.Policy.PolicyRuleCondition)) { - return super.equals(obj); - } - policy.Policy.PolicyRuleCondition other = (policy.Policy.PolicyRuleCondition) obj; - - if (hasPolRuleConditionVar() != other.hasPolRuleConditionVar()) return false; - if (hasPolRuleConditionVar()) { - if (!getPolRuleConditionVar() - .equals(other.getPolRuleConditionVar())) return false; - } - if (hasPolRuleConditionVal() != other.hasPolRuleConditionVal()) return false; - if (hasPolRuleConditionVal()) { - if (!getPolRuleConditionVal() - .equals(other.getPolRuleConditionVal())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasPolRuleConditionVar()) { - hash = (37 * hash) + POLRULECONDITIONVAR_FIELD_NUMBER; - hash = (53 * hash) + getPolRuleConditionVar().hashCode(); - } - if (hasPolRuleConditionVal()) { - hash = (37 * hash) + POLRULECONDITIONVAL_FIELD_NUMBER; - hash = (53 * hash) + getPolRuleConditionVal().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static policy.Policy.PolicyRuleCondition parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static policy.Policy.PolicyRuleCondition parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static policy.Policy.PolicyRuleCondition parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static policy.Policy.PolicyRuleCondition parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static policy.Policy.PolicyRuleCondition parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static policy.Policy.PolicyRuleCondition parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static policy.Policy.PolicyRuleCondition parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static policy.Policy.PolicyRuleCondition parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static policy.Policy.PolicyRuleCondition parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static policy.Policy.PolicyRuleCondition parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static policy.Policy.PolicyRuleCondition parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static policy.Policy.PolicyRuleCondition parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(policy.Policy.PolicyRuleCondition prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * <pre> - * Condition - * </pre> - * - * Protobuf type {@code policy.PolicyRuleCondition} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements - // @@protoc_insertion_point(builder_implements:policy.PolicyRuleCondition) - policy.Policy.PolicyRuleConditionOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return policy.Policy.internal_static_policy_PolicyRuleCondition_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return policy.Policy.internal_static_policy_PolicyRuleCondition_fieldAccessorTable - .ensureFieldAccessorsInitialized( - policy.Policy.PolicyRuleCondition.class, policy.Policy.PolicyRuleCondition.Builder.class); - } - - // Construct using policy.Policy.PolicyRuleCondition.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); + /** + * <pre> + * One or more actions should be applied + * </pre> + * + * <code>repeated .policy.PolicyRuleAction actionList = 6;</code> + */ + public int getActionListCount() { + if (actionListBuilder_ == null) { + return actionList_.size(); + } else { + return actionListBuilder_.getCount(); + } } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); + /** + * <pre> + * One or more actions should be applied + * </pre> + * + * <code>repeated .policy.PolicyRuleAction actionList = 6;</code> + */ + public policy.PolicyAction.PolicyRuleAction getActionList(int index) { + if (actionListBuilder_ == null) { + return actionList_.get(index); + } else { + return actionListBuilder_.getMessage(index); + } } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { + /** + * <pre> + * One or more actions should be applied + * </pre> + * + * <code>repeated .policy.PolicyRuleAction actionList = 6;</code> + */ + public Builder setActionList( + int index, policy.PolicyAction.PolicyRuleAction value) { + if (actionListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureActionListIsMutable(); + actionList_.set(index, value); + onChanged(); + } else { + actionListBuilder_.setMessage(index, value); } + return this; } - @java.lang.Override - public Builder clear() { - super.clear(); - if (polRuleConditionVarBuilder_ == null) { - polRuleConditionVar_ = null; + /** + * <pre> + * One or more actions should be applied + * </pre> + * + * <code>repeated .policy.PolicyRuleAction actionList = 6;</code> + */ + public Builder setActionList( + int index, policy.PolicyAction.PolicyRuleAction.Builder builderForValue) { + if (actionListBuilder_ == null) { + ensureActionListIsMutable(); + actionList_.set(index, builderForValue.build()); + onChanged(); } else { - polRuleConditionVar_ = null; - polRuleConditionVarBuilder_ = null; + actionListBuilder_.setMessage(index, builderForValue.build()); } - if (polRuleConditionValBuilder_ == null) { - polRuleConditionVal_ = null; + return this; + } + /** + * <pre> + * One or more actions should be applied + * </pre> + * + * <code>repeated .policy.PolicyRuleAction actionList = 6;</code> + */ + public Builder addActionList(policy.PolicyAction.PolicyRuleAction value) { + if (actionListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureActionListIsMutable(); + actionList_.add(value); + onChanged(); } else { - polRuleConditionVal_ = null; - polRuleConditionValBuilder_ = null; + actionListBuilder_.addMessage(value); } return this; } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return policy.Policy.internal_static_policy_PolicyRuleCondition_descriptor; + /** + * <pre> + * One or more actions should be applied + * </pre> + * + * <code>repeated .policy.PolicyRuleAction actionList = 6;</code> + */ + public Builder addActionList( + int index, policy.PolicyAction.PolicyRuleAction value) { + if (actionListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureActionListIsMutable(); + actionList_.add(index, value); + onChanged(); + } else { + actionListBuilder_.addMessage(index, value); + } + return this; } - - @java.lang.Override - public policy.Policy.PolicyRuleCondition getDefaultInstanceForType() { - return policy.Policy.PolicyRuleCondition.getDefaultInstance(); + /** + * <pre> + * One or more actions should be applied + * </pre> + * + * <code>repeated .policy.PolicyRuleAction actionList = 6;</code> + */ + public Builder addActionList( + policy.PolicyAction.PolicyRuleAction.Builder builderForValue) { + if (actionListBuilder_ == null) { + ensureActionListIsMutable(); + actionList_.add(builderForValue.build()); + onChanged(); + } else { + actionListBuilder_.addMessage(builderForValue.build()); + } + return this; } - - @java.lang.Override - public policy.Policy.PolicyRuleCondition build() { - policy.Policy.PolicyRuleCondition result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); + /** + * <pre> + * One or more actions should be applied + * </pre> + * + * <code>repeated .policy.PolicyRuleAction actionList = 6;</code> + */ + public Builder addActionList( + int index, policy.PolicyAction.PolicyRuleAction.Builder builderForValue) { + if (actionListBuilder_ == null) { + ensureActionListIsMutable(); + actionList_.add(index, builderForValue.build()); + onChanged(); + } else { + actionListBuilder_.addMessage(index, builderForValue.build()); } - return result; + return this; } - - @java.lang.Override - public policy.Policy.PolicyRuleCondition buildPartial() { - policy.Policy.PolicyRuleCondition result = new policy.Policy.PolicyRuleCondition(this); - if (polRuleConditionVarBuilder_ == null) { - result.polRuleConditionVar_ = polRuleConditionVar_; + /** + * <pre> + * One or more actions should be applied + * </pre> + * + * <code>repeated .policy.PolicyRuleAction actionList = 6;</code> + */ + public Builder addAllActionList( + java.lang.Iterable<? extends policy.PolicyAction.PolicyRuleAction> values) { + if (actionListBuilder_ == null) { + ensureActionListIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, actionList_); + onChanged(); } else { - result.polRuleConditionVar_ = polRuleConditionVarBuilder_.build(); + actionListBuilder_.addAllMessages(values); } - if (polRuleConditionValBuilder_ == null) { - result.polRuleConditionVal_ = polRuleConditionVal_; + return this; + } + /** + * <pre> + * One or more actions should be applied + * </pre> + * + * <code>repeated .policy.PolicyRuleAction actionList = 6;</code> + */ + public Builder clearActionList() { + if (actionListBuilder_ == null) { + actionList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); } else { - result.polRuleConditionVal_ = polRuleConditionValBuilder_.build(); + actionListBuilder_.clear(); } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof policy.Policy.PolicyRuleCondition) { - return mergeFrom((policy.Policy.PolicyRuleCondition)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(policy.Policy.PolicyRuleCondition other) { - if (other == policy.Policy.PolicyRuleCondition.getDefaultInstance()) return this; - if (other.hasPolRuleConditionVar()) { - mergePolRuleConditionVar(other.getPolRuleConditionVar()); - } - if (other.hasPolRuleConditionVal()) { - mergePolRuleConditionVal(other.getPolRuleConditionVal()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - policy.Policy.PolicyRuleCondition parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (policy.Policy.PolicyRuleCondition) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private policy.Policy.PolicyRuleVariable polRuleConditionVar_; - private com.google.protobuf.SingleFieldBuilderV3< - policy.Policy.PolicyRuleVariable, policy.Policy.PolicyRuleVariable.Builder, policy.Policy.PolicyRuleVariableOrBuilder> polRuleConditionVarBuilder_; - /** - * <code>.policy.PolicyRuleVariable polRuleConditionVar = 1;</code> - * @return Whether the polRuleConditionVar field is set. - */ - public boolean hasPolRuleConditionVar() { - return polRuleConditionVarBuilder_ != null || polRuleConditionVar_ != null; - } - /** - * <code>.policy.PolicyRuleVariable polRuleConditionVar = 1;</code> - * @return The polRuleConditionVar. - */ - public policy.Policy.PolicyRuleVariable getPolRuleConditionVar() { - if (polRuleConditionVarBuilder_ == null) { - return polRuleConditionVar_ == null ? policy.Policy.PolicyRuleVariable.getDefaultInstance() : polRuleConditionVar_; - } else { - return polRuleConditionVarBuilder_.getMessage(); - } - } - /** - * <code>.policy.PolicyRuleVariable polRuleConditionVar = 1;</code> - */ - public Builder setPolRuleConditionVar(policy.Policy.PolicyRuleVariable value) { - if (polRuleConditionVarBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - polRuleConditionVar_ = value; - onChanged(); - } else { - polRuleConditionVarBuilder_.setMessage(value); - } - - return this; - } - /** - * <code>.policy.PolicyRuleVariable polRuleConditionVar = 1;</code> - */ - public Builder setPolRuleConditionVar( - policy.Policy.PolicyRuleVariable.Builder builderForValue) { - if (polRuleConditionVarBuilder_ == null) { - polRuleConditionVar_ = builderForValue.build(); - onChanged(); - } else { - polRuleConditionVarBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * <code>.policy.PolicyRuleVariable polRuleConditionVar = 1;</code> - */ - public Builder mergePolRuleConditionVar(policy.Policy.PolicyRuleVariable value) { - if (polRuleConditionVarBuilder_ == null) { - if (polRuleConditionVar_ != null) { - polRuleConditionVar_ = - policy.Policy.PolicyRuleVariable.newBuilder(polRuleConditionVar_).mergeFrom(value).buildPartial(); - } else { - polRuleConditionVar_ = value; - } - onChanged(); - } else { - polRuleConditionVarBuilder_.mergeFrom(value); - } - - return this; + return this; } /** - * <code>.policy.PolicyRuleVariable polRuleConditionVar = 1;</code> + * <pre> + * One or more actions should be applied + * </pre> + * + * <code>repeated .policy.PolicyRuleAction actionList = 6;</code> */ - public Builder clearPolRuleConditionVar() { - if (polRuleConditionVarBuilder_ == null) { - polRuleConditionVar_ = null; + public Builder removeActionList(int index) { + if (actionListBuilder_ == null) { + ensureActionListIsMutable(); + actionList_.remove(index); onChanged(); } else { - polRuleConditionVar_ = null; - polRuleConditionVarBuilder_ = null; + actionListBuilder_.remove(index); } - return this; } /** - * <code>.policy.PolicyRuleVariable polRuleConditionVar = 1;</code> - */ - public policy.Policy.PolicyRuleVariable.Builder getPolRuleConditionVarBuilder() { - - onChanged(); - return getPolRuleConditionVarFieldBuilder().getBuilder(); - } - /** - * <code>.policy.PolicyRuleVariable polRuleConditionVar = 1;</code> - */ - public policy.Policy.PolicyRuleVariableOrBuilder getPolRuleConditionVarOrBuilder() { - if (polRuleConditionVarBuilder_ != null) { - return polRuleConditionVarBuilder_.getMessageOrBuilder(); - } else { - return polRuleConditionVar_ == null ? - policy.Policy.PolicyRuleVariable.getDefaultInstance() : polRuleConditionVar_; - } - } - /** - * <code>.policy.PolicyRuleVariable polRuleConditionVar = 1;</code> - */ - private com.google.protobuf.SingleFieldBuilderV3< - policy.Policy.PolicyRuleVariable, policy.Policy.PolicyRuleVariable.Builder, policy.Policy.PolicyRuleVariableOrBuilder> - getPolRuleConditionVarFieldBuilder() { - if (polRuleConditionVarBuilder_ == null) { - polRuleConditionVarBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - policy.Policy.PolicyRuleVariable, policy.Policy.PolicyRuleVariable.Builder, policy.Policy.PolicyRuleVariableOrBuilder>( - getPolRuleConditionVar(), - getParentForChildren(), - isClean()); - polRuleConditionVar_ = null; - } - return polRuleConditionVarBuilder_; - } - - private policy.Policy.PolicyRuleValue polRuleConditionVal_; - private com.google.protobuf.SingleFieldBuilderV3< - policy.Policy.PolicyRuleValue, policy.Policy.PolicyRuleValue.Builder, policy.Policy.PolicyRuleValueOrBuilder> polRuleConditionValBuilder_; - /** - * <code>.policy.PolicyRuleValue polRuleConditionVal = 2;</code> - * @return Whether the polRuleConditionVal field is set. - */ - public boolean hasPolRuleConditionVal() { - return polRuleConditionValBuilder_ != null || polRuleConditionVal_ != null; - } - /** - * <code>.policy.PolicyRuleValue polRuleConditionVal = 2;</code> - * @return The polRuleConditionVal. - */ - public policy.Policy.PolicyRuleValue getPolRuleConditionVal() { - if (polRuleConditionValBuilder_ == null) { - return polRuleConditionVal_ == null ? policy.Policy.PolicyRuleValue.getDefaultInstance() : polRuleConditionVal_; - } else { - return polRuleConditionValBuilder_.getMessage(); - } - } - /** - * <code>.policy.PolicyRuleValue polRuleConditionVal = 2;</code> + * <pre> + * One or more actions should be applied + * </pre> + * + * <code>repeated .policy.PolicyRuleAction actionList = 6;</code> */ - public Builder setPolRuleConditionVal(policy.Policy.PolicyRuleValue value) { - if (polRuleConditionValBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - polRuleConditionVal_ = value; - onChanged(); - } else { - polRuleConditionValBuilder_.setMessage(value); - } - - return this; + public policy.PolicyAction.PolicyRuleAction.Builder getActionListBuilder( + int index) { + return getActionListFieldBuilder().getBuilder(index); } /** - * <code>.policy.PolicyRuleValue polRuleConditionVal = 2;</code> + * <pre> + * One or more actions should be applied + * </pre> + * + * <code>repeated .policy.PolicyRuleAction actionList = 6;</code> */ - public Builder setPolRuleConditionVal( - policy.Policy.PolicyRuleValue.Builder builderForValue) { - if (polRuleConditionValBuilder_ == null) { - polRuleConditionVal_ = builderForValue.build(); - onChanged(); - } else { - polRuleConditionValBuilder_.setMessage(builderForValue.build()); + public policy.PolicyAction.PolicyRuleActionOrBuilder getActionListOrBuilder( + int index) { + if (actionListBuilder_ == null) { + return actionList_.get(index); } else { + return actionListBuilder_.getMessageOrBuilder(index); } - - return this; } /** - * <code>.policy.PolicyRuleValue polRuleConditionVal = 2;</code> + * <pre> + * One or more actions should be applied + * </pre> + * + * <code>repeated .policy.PolicyRuleAction actionList = 6;</code> */ - public Builder mergePolRuleConditionVal(policy.Policy.PolicyRuleValue value) { - if (polRuleConditionValBuilder_ == null) { - if (polRuleConditionVal_ != null) { - polRuleConditionVal_ = - policy.Policy.PolicyRuleValue.newBuilder(polRuleConditionVal_).mergeFrom(value).buildPartial(); - } else { - polRuleConditionVal_ = value; - } - onChanged(); + public java.util.List<? extends policy.PolicyAction.PolicyRuleActionOrBuilder> + getActionListOrBuilderList() { + if (actionListBuilder_ != null) { + return actionListBuilder_.getMessageOrBuilderList(); } else { - polRuleConditionValBuilder_.mergeFrom(value); + return java.util.Collections.unmodifiableList(actionList_); } - - return this; } /** - * <code>.policy.PolicyRuleValue polRuleConditionVal = 2;</code> + * <pre> + * One or more actions should be applied + * </pre> + * + * <code>repeated .policy.PolicyRuleAction actionList = 6;</code> */ - public Builder clearPolRuleConditionVal() { - if (polRuleConditionValBuilder_ == null) { - polRuleConditionVal_ = null; - onChanged(); - } else { - polRuleConditionVal_ = null; - polRuleConditionValBuilder_ = null; - } - - return this; + public policy.PolicyAction.PolicyRuleAction.Builder addActionListBuilder() { + return getActionListFieldBuilder().addBuilder( + policy.PolicyAction.PolicyRuleAction.getDefaultInstance()); } /** - * <code>.policy.PolicyRuleValue polRuleConditionVal = 2;</code> + * <pre> + * One or more actions should be applied + * </pre> + * + * <code>repeated .policy.PolicyRuleAction actionList = 6;</code> */ - public policy.Policy.PolicyRuleValue.Builder getPolRuleConditionValBuilder() { - - onChanged(); - return getPolRuleConditionValFieldBuilder().getBuilder(); + public policy.PolicyAction.PolicyRuleAction.Builder addActionListBuilder( + int index) { + return getActionListFieldBuilder().addBuilder( + index, policy.PolicyAction.PolicyRuleAction.getDefaultInstance()); } /** - * <code>.policy.PolicyRuleValue polRuleConditionVal = 2;</code> + * <pre> + * One or more actions should be applied + * </pre> + * + * <code>repeated .policy.PolicyRuleAction actionList = 6;</code> */ - public policy.Policy.PolicyRuleValueOrBuilder getPolRuleConditionValOrBuilder() { - if (polRuleConditionValBuilder_ != null) { - return polRuleConditionValBuilder_.getMessageOrBuilder(); - } else { - return polRuleConditionVal_ == null ? - policy.Policy.PolicyRuleValue.getDefaultInstance() : polRuleConditionVal_; - } + public java.util.List<policy.PolicyAction.PolicyRuleAction.Builder> + getActionListBuilderList() { + return getActionListFieldBuilder().getBuilderList(); } - /** - * <code>.policy.PolicyRuleValue polRuleConditionVal = 2;</code> - */ - private com.google.protobuf.SingleFieldBuilderV3< - policy.Policy.PolicyRuleValue, policy.Policy.PolicyRuleValue.Builder, policy.Policy.PolicyRuleValueOrBuilder> - getPolRuleConditionValFieldBuilder() { - if (polRuleConditionValBuilder_ == null) { - polRuleConditionValBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - policy.Policy.PolicyRuleValue, policy.Policy.PolicyRuleValue.Builder, policy.Policy.PolicyRuleValueOrBuilder>( - getPolRuleConditionVal(), + private com.google.protobuf.RepeatedFieldBuilderV3< + policy.PolicyAction.PolicyRuleAction, policy.PolicyAction.PolicyRuleAction.Builder, policy.PolicyAction.PolicyRuleActionOrBuilder> + getActionListFieldBuilder() { + if (actionListBuilder_ == null) { + actionListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + policy.PolicyAction.PolicyRuleAction, policy.PolicyAction.PolicyRuleAction.Builder, policy.PolicyAction.PolicyRuleActionOrBuilder>( + actionList_, + ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); - polRuleConditionVal_ = null; + actionList_ = null; } - return polRuleConditionValBuilder_; + return actionListBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -4189,104 +3421,173 @@ public final class Policy { } - // @@protoc_insertion_point(builder_scope:policy.PolicyRuleCondition) + // @@protoc_insertion_point(builder_scope:policy.PolicyRuleBasic) } - // @@protoc_insertion_point(class_scope:policy.PolicyRuleCondition) - private static final policy.Policy.PolicyRuleCondition DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:policy.PolicyRuleBasic) + private static final policy.Policy.PolicyRuleBasic DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new policy.Policy.PolicyRuleCondition(); + DEFAULT_INSTANCE = new policy.Policy.PolicyRuleBasic(); } - public static policy.Policy.PolicyRuleCondition getDefaultInstance() { + public static policy.Policy.PolicyRuleBasic getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser<PolicyRuleCondition> - PARSER = new com.google.protobuf.AbstractParser<PolicyRuleCondition>() { + private static final com.google.protobuf.Parser<PolicyRuleBasic> + PARSER = new com.google.protobuf.AbstractParser<PolicyRuleBasic>() { @java.lang.Override - public PolicyRuleCondition parsePartialFrom( + public PolicyRuleBasic parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new PolicyRuleCondition(input, extensionRegistry); + return new PolicyRuleBasic(input, extensionRegistry); } }; - public static com.google.protobuf.Parser<PolicyRuleCondition> parser() { + public static com.google.protobuf.Parser<PolicyRuleBasic> parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser<PolicyRuleCondition> getParserForType() { + public com.google.protobuf.Parser<PolicyRuleBasic> getParserForType() { return PARSER; } @java.lang.Override - public policy.Policy.PolicyRuleCondition getDefaultInstanceForType() { + public policy.Policy.PolicyRuleBasic getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface PolicyRuleActionOrBuilder extends - // @@protoc_insertion_point(interface_extends:policy.PolicyRuleAction) + public interface PolicyRuleServiceOrBuilder extends + // @@protoc_insertion_point(interface_extends:policy.PolicyRuleService) com.google.protobuf.MessageOrBuilder { /** - * <code>.policy.PolicyRuleVariable polRuleActionVar = 1;</code> - * @return Whether the polRuleActionVar field is set. + * <pre> + * Basic policy rule attributes + * </pre> + * + * <code>.policy.PolicyRuleBasic policyRuleBasic = 1;</code> + * @return Whether the policyRuleBasic field is set. + */ + boolean hasPolicyRuleBasic(); + /** + * <pre> + * Basic policy rule attributes + * </pre> + * + * <code>.policy.PolicyRuleBasic policyRuleBasic = 1;</code> + * @return The policyRuleBasic. + */ + policy.Policy.PolicyRuleBasic getPolicyRuleBasic(); + /** + * <pre> + * Basic policy rule attributes + * </pre> + * + * <code>.policy.PolicyRuleBasic policyRuleBasic = 1;</code> + */ + policy.Policy.PolicyRuleBasicOrBuilder getPolicyRuleBasicOrBuilder(); + + /** + * <pre> + * Affected service and (some of) its device(s) + * </pre> + * + * <code>.context.ServiceId serviceId = 2;</code> + * @return Whether the serviceId field is set. */ - boolean hasPolRuleActionVar(); + boolean hasServiceId(); /** - * <code>.policy.PolicyRuleVariable polRuleActionVar = 1;</code> - * @return The polRuleActionVar. + * <pre> + * Affected service and (some of) its device(s) + * </pre> + * + * <code>.context.ServiceId serviceId = 2;</code> + * @return The serviceId. */ - policy.Policy.PolicyRuleVariable getPolRuleActionVar(); + context.ContextOuterClass.ServiceId getServiceId(); /** - * <code>.policy.PolicyRuleVariable polRuleActionVar = 1;</code> + * <pre> + * Affected service and (some of) its device(s) + * </pre> + * + * <code>.context.ServiceId serviceId = 2;</code> */ - policy.Policy.PolicyRuleVariableOrBuilder getPolRuleActionVarOrBuilder(); + context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder(); /** - * <code>.policy.PolicyRuleValue polRuleActionVal = 2;</code> - * @return Whether the polRuleActionVal field is set. + * <pre> + * List of devices this service is traversing (not exhaustive) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 3;</code> + */ + java.util.List<context.ContextOuterClass.DeviceId> + getDeviceListList(); + /** + * <pre> + * List of devices this service is traversing (not exhaustive) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 3;</code> + */ + context.ContextOuterClass.DeviceId getDeviceList(int index); + /** + * <pre> + * List of devices this service is traversing (not exhaustive) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 3;</code> */ - boolean hasPolRuleActionVal(); + int getDeviceListCount(); /** - * <code>.policy.PolicyRuleValue polRuleActionVal = 2;</code> - * @return The polRuleActionVal. + * <pre> + * List of devices this service is traversing (not exhaustive) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 3;</code> */ - policy.Policy.PolicyRuleValue getPolRuleActionVal(); + java.util.List<? extends context.ContextOuterClass.DeviceIdOrBuilder> + getDeviceListOrBuilderList(); /** - * <code>.policy.PolicyRuleValue polRuleActionVal = 2;</code> + * <pre> + * List of devices this service is traversing (not exhaustive) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 3;</code> */ - policy.Policy.PolicyRuleValueOrBuilder getPolRuleActionValOrBuilder(); + context.ContextOuterClass.DeviceIdOrBuilder getDeviceListOrBuilder( + int index); } /** * <pre> - * Action + * Service-oriented policy rule * </pre> * - * Protobuf type {@code policy.PolicyRuleAction} + * Protobuf type {@code policy.PolicyRuleService} */ - public static final class PolicyRuleAction extends + public static final class PolicyRuleService extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:policy.PolicyRuleAction) - PolicyRuleActionOrBuilder { + // @@protoc_insertion_point(message_implements:policy.PolicyRuleService) + PolicyRuleServiceOrBuilder { private static final long serialVersionUID = 0L; - // Use PolicyRuleAction.newBuilder() to construct. - private PolicyRuleAction(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + // Use PolicyRuleService.newBuilder() to construct. + private PolicyRuleService(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } - private PolicyRuleAction() { + private PolicyRuleService() { + deviceList_ = java.util.Collections.emptyList(); } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new PolicyRuleAction(); + return new PolicyRuleService(); } @java.lang.Override @@ -4294,7 +3595,7 @@ public final class Policy { getUnknownFields() { return this.unknownFields; } - private PolicyRuleAction( + private PolicyRuleService( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -4302,6 +3603,7 @@ public final class Policy { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } + int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -4313,35 +3615,44 @@ public final class Policy { done = true; break; case 10: { - policy.Policy.PolicyRuleVariable.Builder subBuilder = null; - if (polRuleActionVar_ != null) { - subBuilder = polRuleActionVar_.toBuilder(); + policy.Policy.PolicyRuleBasic.Builder subBuilder = null; + if (policyRuleBasic_ != null) { + subBuilder = policyRuleBasic_.toBuilder(); } - polRuleActionVar_ = input.readMessage(policy.Policy.PolicyRuleVariable.parser(), extensionRegistry); + policyRuleBasic_ = input.readMessage(policy.Policy.PolicyRuleBasic.parser(), extensionRegistry); if (subBuilder != null) { - subBuilder.mergeFrom(polRuleActionVar_); - polRuleActionVar_ = subBuilder.buildPartial(); + subBuilder.mergeFrom(policyRuleBasic_); + policyRuleBasic_ = subBuilder.buildPartial(); } break; } case 18: { - policy.Policy.PolicyRuleValue.Builder subBuilder = null; - if (polRuleActionVal_ != null) { - subBuilder = polRuleActionVal_.toBuilder(); + context.ContextOuterClass.ServiceId.Builder subBuilder = null; + if (serviceId_ != null) { + subBuilder = serviceId_.toBuilder(); } - polRuleActionVal_ = input.readMessage(policy.Policy.PolicyRuleValue.parser(), extensionRegistry); + serviceId_ = input.readMessage(context.ContextOuterClass.ServiceId.parser(), extensionRegistry); if (subBuilder != null) { - subBuilder.mergeFrom(polRuleActionVal_); - polRuleActionVal_ = subBuilder.buildPartial(); + subBuilder.mergeFrom(serviceId_); + serviceId_ = subBuilder.buildPartial(); } break; } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; + case 26: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + deviceList_ = new java.util.ArrayList<context.ContextOuterClass.DeviceId>(); + mutable_bitField0_ |= 0x00000001; + } + deviceList_.add( + input.readMessage(context.ContextOuterClass.DeviceId.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; } break; } @@ -4353,73 +3664,160 @@ public final class Policy { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + deviceList_ = java.util.Collections.unmodifiableList(deviceList_); + } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return policy.Policy.internal_static_policy_PolicyRuleAction_descriptor; + return policy.Policy.internal_static_policy_PolicyRuleService_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return policy.Policy.internal_static_policy_PolicyRuleAction_fieldAccessorTable + return policy.Policy.internal_static_policy_PolicyRuleService_fieldAccessorTable .ensureFieldAccessorsInitialized( - policy.Policy.PolicyRuleAction.class, policy.Policy.PolicyRuleAction.Builder.class); + policy.Policy.PolicyRuleService.class, policy.Policy.PolicyRuleService.Builder.class); + } + + public static final int POLICYRULEBASIC_FIELD_NUMBER = 1; + private policy.Policy.PolicyRuleBasic policyRuleBasic_; + /** + * <pre> + * Basic policy rule attributes + * </pre> + * + * <code>.policy.PolicyRuleBasic policyRuleBasic = 1;</code> + * @return Whether the policyRuleBasic field is set. + */ + @java.lang.Override + public boolean hasPolicyRuleBasic() { + return policyRuleBasic_ != null; + } + /** + * <pre> + * Basic policy rule attributes + * </pre> + * + * <code>.policy.PolicyRuleBasic policyRuleBasic = 1;</code> + * @return The policyRuleBasic. + */ + @java.lang.Override + public policy.Policy.PolicyRuleBasic getPolicyRuleBasic() { + return policyRuleBasic_ == null ? policy.Policy.PolicyRuleBasic.getDefaultInstance() : policyRuleBasic_; + } + /** + * <pre> + * Basic policy rule attributes + * </pre> + * + * <code>.policy.PolicyRuleBasic policyRuleBasic = 1;</code> + */ + @java.lang.Override + public policy.Policy.PolicyRuleBasicOrBuilder getPolicyRuleBasicOrBuilder() { + return getPolicyRuleBasic(); } - public static final int POLRULEACTIONVAR_FIELD_NUMBER = 1; - private policy.Policy.PolicyRuleVariable polRuleActionVar_; + public static final int SERVICEID_FIELD_NUMBER = 2; + private context.ContextOuterClass.ServiceId serviceId_; /** - * <code>.policy.PolicyRuleVariable polRuleActionVar = 1;</code> - * @return Whether the polRuleActionVar field is set. + * <pre> + * Affected service and (some of) its device(s) + * </pre> + * + * <code>.context.ServiceId serviceId = 2;</code> + * @return Whether the serviceId field is set. */ @java.lang.Override - public boolean hasPolRuleActionVar() { - return polRuleActionVar_ != null; + public boolean hasServiceId() { + return serviceId_ != null; } /** - * <code>.policy.PolicyRuleVariable polRuleActionVar = 1;</code> - * @return The polRuleActionVar. + * <pre> + * Affected service and (some of) its device(s) + * </pre> + * + * <code>.context.ServiceId serviceId = 2;</code> + * @return The serviceId. */ @java.lang.Override - public policy.Policy.PolicyRuleVariable getPolRuleActionVar() { - return polRuleActionVar_ == null ? policy.Policy.PolicyRuleVariable.getDefaultInstance() : polRuleActionVar_; + public context.ContextOuterClass.ServiceId getServiceId() { + return serviceId_ == null ? context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; } /** - * <code>.policy.PolicyRuleVariable polRuleActionVar = 1;</code> + * <pre> + * Affected service and (some of) its device(s) + * </pre> + * + * <code>.context.ServiceId serviceId = 2;</code> */ @java.lang.Override - public policy.Policy.PolicyRuleVariableOrBuilder getPolRuleActionVarOrBuilder() { - return getPolRuleActionVar(); + public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder() { + return getServiceId(); } - public static final int POLRULEACTIONVAL_FIELD_NUMBER = 2; - private policy.Policy.PolicyRuleValue polRuleActionVal_; + public static final int DEVICELIST_FIELD_NUMBER = 3; + private java.util.List<context.ContextOuterClass.DeviceId> deviceList_; + /** + * <pre> + * List of devices this service is traversing (not exhaustive) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 3;</code> + */ + @java.lang.Override + public java.util.List<context.ContextOuterClass.DeviceId> getDeviceListList() { + return deviceList_; + } + /** + * <pre> + * List of devices this service is traversing (not exhaustive) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 3;</code> + */ + @java.lang.Override + public java.util.List<? extends context.ContextOuterClass.DeviceIdOrBuilder> + getDeviceListOrBuilderList() { + return deviceList_; + } /** - * <code>.policy.PolicyRuleValue polRuleActionVal = 2;</code> - * @return Whether the polRuleActionVal field is set. + * <pre> + * List of devices this service is traversing (not exhaustive) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 3;</code> */ @java.lang.Override - public boolean hasPolRuleActionVal() { - return polRuleActionVal_ != null; + public int getDeviceListCount() { + return deviceList_.size(); } /** - * <code>.policy.PolicyRuleValue polRuleActionVal = 2;</code> - * @return The polRuleActionVal. + * <pre> + * List of devices this service is traversing (not exhaustive) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 3;</code> */ @java.lang.Override - public policy.Policy.PolicyRuleValue getPolRuleActionVal() { - return polRuleActionVal_ == null ? policy.Policy.PolicyRuleValue.getDefaultInstance() : polRuleActionVal_; + public context.ContextOuterClass.DeviceId getDeviceList(int index) { + return deviceList_.get(index); } /** - * <code>.policy.PolicyRuleValue polRuleActionVal = 2;</code> + * <pre> + * List of devices this service is traversing (not exhaustive) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 3;</code> */ @java.lang.Override - public policy.Policy.PolicyRuleValueOrBuilder getPolRuleActionValOrBuilder() { - return getPolRuleActionVal(); + public context.ContextOuterClass.DeviceIdOrBuilder getDeviceListOrBuilder( + int index) { + return deviceList_.get(index); } private byte memoizedIsInitialized = -1; @@ -4436,11 +3834,14 @@ public final class Policy { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (polRuleActionVar_ != null) { - output.writeMessage(1, getPolRuleActionVar()); + if (policyRuleBasic_ != null) { + output.writeMessage(1, getPolicyRuleBasic()); + } + if (serviceId_ != null) { + output.writeMessage(2, getServiceId()); } - if (polRuleActionVal_ != null) { - output.writeMessage(2, getPolRuleActionVal()); + for (int i = 0; i < deviceList_.size(); i++) { + output.writeMessage(3, deviceList_.get(i)); } unknownFields.writeTo(output); } @@ -4451,13 +3852,17 @@ public final class Policy { if (size != -1) return size; size = 0; - if (polRuleActionVar_ != null) { + if (policyRuleBasic_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getPolicyRuleBasic()); + } + if (serviceId_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getPolRuleActionVar()); + .computeMessageSize(2, getServiceId()); } - if (polRuleActionVal_ != null) { + for (int i = 0; i < deviceList_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getPolRuleActionVal()); + .computeMessageSize(3, deviceList_.get(i)); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -4469,21 +3874,23 @@ public final class Policy { if (obj == this) { return true; } - if (!(obj instanceof policy.Policy.PolicyRuleAction)) { + if (!(obj instanceof policy.Policy.PolicyRuleService)) { return super.equals(obj); } - policy.Policy.PolicyRuleAction other = (policy.Policy.PolicyRuleAction) obj; + policy.Policy.PolicyRuleService other = (policy.Policy.PolicyRuleService) obj; - if (hasPolRuleActionVar() != other.hasPolRuleActionVar()) return false; - if (hasPolRuleActionVar()) { - if (!getPolRuleActionVar() - .equals(other.getPolRuleActionVar())) return false; + if (hasPolicyRuleBasic() != other.hasPolicyRuleBasic()) return false; + if (hasPolicyRuleBasic()) { + if (!getPolicyRuleBasic() + .equals(other.getPolicyRuleBasic())) return false; } - if (hasPolRuleActionVal() != other.hasPolRuleActionVal()) return false; - if (hasPolRuleActionVal()) { - if (!getPolRuleActionVal() - .equals(other.getPolRuleActionVal())) return false; + if (hasServiceId() != other.hasServiceId()) return false; + if (hasServiceId()) { + if (!getServiceId() + .equals(other.getServiceId())) return false; } + if (!getDeviceListList() + .equals(other.getDeviceListList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -4495,82 +3902,86 @@ public final class Policy { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasPolRuleActionVar()) { - hash = (37 * hash) + POLRULEACTIONVAR_FIELD_NUMBER; - hash = (53 * hash) + getPolRuleActionVar().hashCode(); + if (hasPolicyRuleBasic()) { + hash = (37 * hash) + POLICYRULEBASIC_FIELD_NUMBER; + hash = (53 * hash) + getPolicyRuleBasic().hashCode(); } - if (hasPolRuleActionVal()) { - hash = (37 * hash) + POLRULEACTIONVAL_FIELD_NUMBER; - hash = (53 * hash) + getPolRuleActionVal().hashCode(); + if (hasServiceId()) { + hash = (37 * hash) + SERVICEID_FIELD_NUMBER; + hash = (53 * hash) + getServiceId().hashCode(); + } + if (getDeviceListCount() > 0) { + hash = (37 * hash) + DEVICELIST_FIELD_NUMBER; + hash = (53 * hash) + getDeviceListList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static policy.Policy.PolicyRuleAction parseFrom( + public static policy.Policy.PolicyRuleService parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static policy.Policy.PolicyRuleAction parseFrom( + public static policy.Policy.PolicyRuleService parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static policy.Policy.PolicyRuleAction parseFrom( + public static policy.Policy.PolicyRuleService parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static policy.Policy.PolicyRuleAction parseFrom( + public static policy.Policy.PolicyRuleService parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static policy.Policy.PolicyRuleAction parseFrom(byte[] data) + public static policy.Policy.PolicyRuleService parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static policy.Policy.PolicyRuleAction parseFrom( + public static policy.Policy.PolicyRuleService parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static policy.Policy.PolicyRuleAction parseFrom(java.io.InputStream input) + public static policy.Policy.PolicyRuleService parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static policy.Policy.PolicyRuleAction parseFrom( + public static policy.Policy.PolicyRuleService parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } - public static policy.Policy.PolicyRuleAction parseDelimitedFrom(java.io.InputStream input) + public static policy.Policy.PolicyRuleService parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static policy.Policy.PolicyRuleAction parseDelimitedFrom( + public static policy.Policy.PolicyRuleService parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static policy.Policy.PolicyRuleAction parseFrom( + public static policy.Policy.PolicyRuleService parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static policy.Policy.PolicyRuleAction parseFrom( + public static policy.Policy.PolicyRuleService parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -4583,7 +3994,7 @@ public final class Policy { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(policy.Policy.PolicyRuleAction prototype) { + public static Builder newBuilder(policy.Policy.PolicyRuleService prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -4600,29 +4011,29 @@ public final class Policy { } /** * <pre> - * Action + * Service-oriented policy rule * </pre> * - * Protobuf type {@code policy.PolicyRuleAction} + * Protobuf type {@code policy.PolicyRuleService} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements - // @@protoc_insertion_point(builder_implements:policy.PolicyRuleAction) - policy.Policy.PolicyRuleActionOrBuilder { + // @@protoc_insertion_point(builder_implements:policy.PolicyRuleService) + policy.Policy.PolicyRuleServiceOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return policy.Policy.internal_static_policy_PolicyRuleAction_descriptor; + return policy.Policy.internal_static_policy_PolicyRuleService_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return policy.Policy.internal_static_policy_PolicyRuleAction_fieldAccessorTable + return policy.Policy.internal_static_policy_PolicyRuleService_fieldAccessorTable .ensureFieldAccessorsInitialized( - policy.Policy.PolicyRuleAction.class, policy.Policy.PolicyRuleAction.Builder.class); + policy.Policy.PolicyRuleService.class, policy.Policy.PolicyRuleService.Builder.class); } - // Construct using policy.Policy.PolicyRuleAction.newBuilder() + // Construct using policy.Policy.PolicyRuleService.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -4635,22 +4046,29 @@ public final class Policy { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { + getDeviceListFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (polRuleActionVarBuilder_ == null) { - polRuleActionVar_ = null; + if (policyRuleBasicBuilder_ == null) { + policyRuleBasic_ = null; + } else { + policyRuleBasic_ = null; + policyRuleBasicBuilder_ = null; + } + if (serviceIdBuilder_ == null) { + serviceId_ = null; } else { - polRuleActionVar_ = null; - polRuleActionVarBuilder_ = null; + serviceId_ = null; + serviceIdBuilder_ = null; } - if (polRuleActionValBuilder_ == null) { - polRuleActionVal_ = null; + if (deviceListBuilder_ == null) { + deviceList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); } else { - polRuleActionVal_ = null; - polRuleActionValBuilder_ = null; + deviceListBuilder_.clear(); } return this; } @@ -4658,17 +4076,17 @@ public final class Policy { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return policy.Policy.internal_static_policy_PolicyRuleAction_descriptor; + return policy.Policy.internal_static_policy_PolicyRuleService_descriptor; } @java.lang.Override - public policy.Policy.PolicyRuleAction getDefaultInstanceForType() { - return policy.Policy.PolicyRuleAction.getDefaultInstance(); + public policy.Policy.PolicyRuleService getDefaultInstanceForType() { + return policy.Policy.PolicyRuleService.getDefaultInstance(); } @java.lang.Override - public policy.Policy.PolicyRuleAction build() { - policy.Policy.PolicyRuleAction result = buildPartial(); + public policy.Policy.PolicyRuleService build() { + policy.Policy.PolicyRuleService result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -4676,17 +4094,27 @@ public final class Policy { } @java.lang.Override - public policy.Policy.PolicyRuleAction buildPartial() { - policy.Policy.PolicyRuleAction result = new policy.Policy.PolicyRuleAction(this); - if (polRuleActionVarBuilder_ == null) { - result.polRuleActionVar_ = polRuleActionVar_; + public policy.Policy.PolicyRuleService buildPartial() { + policy.Policy.PolicyRuleService result = new policy.Policy.PolicyRuleService(this); + int from_bitField0_ = bitField0_; + if (policyRuleBasicBuilder_ == null) { + result.policyRuleBasic_ = policyRuleBasic_; } else { - result.polRuleActionVar_ = polRuleActionVarBuilder_.build(); + result.policyRuleBasic_ = policyRuleBasicBuilder_.build(); } - if (polRuleActionValBuilder_ == null) { - result.polRuleActionVal_ = polRuleActionVal_; + if (serviceIdBuilder_ == null) { + result.serviceId_ = serviceId_; + } else { + result.serviceId_ = serviceIdBuilder_.build(); + } + if (deviceListBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + deviceList_ = java.util.Collections.unmodifiableList(deviceList_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.deviceList_ = deviceList_; } else { - result.polRuleActionVal_ = polRuleActionValBuilder_.build(); + result.deviceList_ = deviceListBuilder_.build(); } onBuilt(); return result; @@ -4726,21 +4154,47 @@ public final class Policy { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof policy.Policy.PolicyRuleAction) { - return mergeFrom((policy.Policy.PolicyRuleAction)other); + if (other instanceof policy.Policy.PolicyRuleService) { + return mergeFrom((policy.Policy.PolicyRuleService)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(policy.Policy.PolicyRuleAction other) { - if (other == policy.Policy.PolicyRuleAction.getDefaultInstance()) return this; - if (other.hasPolRuleActionVar()) { - mergePolRuleActionVar(other.getPolRuleActionVar()); + public Builder mergeFrom(policy.Policy.PolicyRuleService other) { + if (other == policy.Policy.PolicyRuleService.getDefaultInstance()) return this; + if (other.hasPolicyRuleBasic()) { + mergePolicyRuleBasic(other.getPolicyRuleBasic()); + } + if (other.hasServiceId()) { + mergeServiceId(other.getServiceId()); } - if (other.hasPolRuleActionVal()) { - mergePolRuleActionVal(other.getPolRuleActionVal()); + if (deviceListBuilder_ == null) { + if (!other.deviceList_.isEmpty()) { + if (deviceList_.isEmpty()) { + deviceList_ = other.deviceList_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDeviceListIsMutable(); + deviceList_.addAll(other.deviceList_); + } + onChanged(); + } + } else { + if (!other.deviceList_.isEmpty()) { + if (deviceListBuilder_.isEmpty()) { + deviceListBuilder_.dispose(); + deviceListBuilder_ = null; + deviceList_ = other.deviceList_; + bitField0_ = (bitField0_ & ~0x00000001); + deviceListBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getDeviceListFieldBuilder() : null; + } else { + deviceListBuilder_.addAllMessages(other.deviceList_); + } + } } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -4757,11 +4211,11 @@ public final class Policy { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - policy.Policy.PolicyRuleAction parsedMessage = null; + policy.Policy.PolicyRuleService parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (policy.Policy.PolicyRuleAction) e.getUnfinishedMessage(); + parsedMessage = (policy.Policy.PolicyRuleService) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -4770,1000 +4224,922 @@ public final class Policy { } return this; } + private int bitField0_; - private policy.Policy.PolicyRuleVariable polRuleActionVar_; + private policy.Policy.PolicyRuleBasic policyRuleBasic_; private com.google.protobuf.SingleFieldBuilderV3< - policy.Policy.PolicyRuleVariable, policy.Policy.PolicyRuleVariable.Builder, policy.Policy.PolicyRuleVariableOrBuilder> polRuleActionVarBuilder_; + policy.Policy.PolicyRuleBasic, policy.Policy.PolicyRuleBasic.Builder, policy.Policy.PolicyRuleBasicOrBuilder> policyRuleBasicBuilder_; /** - * <code>.policy.PolicyRuleVariable polRuleActionVar = 1;</code> - * @return Whether the polRuleActionVar field is set. + * <pre> + * Basic policy rule attributes + * </pre> + * + * <code>.policy.PolicyRuleBasic policyRuleBasic = 1;</code> + * @return Whether the policyRuleBasic field is set. */ - public boolean hasPolRuleActionVar() { - return polRuleActionVarBuilder_ != null || polRuleActionVar_ != null; + public boolean hasPolicyRuleBasic() { + return policyRuleBasicBuilder_ != null || policyRuleBasic_ != null; } /** - * <code>.policy.PolicyRuleVariable polRuleActionVar = 1;</code> - * @return The polRuleActionVar. + * <pre> + * Basic policy rule attributes + * </pre> + * + * <code>.policy.PolicyRuleBasic policyRuleBasic = 1;</code> + * @return The policyRuleBasic. */ - public policy.Policy.PolicyRuleVariable getPolRuleActionVar() { - if (polRuleActionVarBuilder_ == null) { - return polRuleActionVar_ == null ? policy.Policy.PolicyRuleVariable.getDefaultInstance() : polRuleActionVar_; + public policy.Policy.PolicyRuleBasic getPolicyRuleBasic() { + if (policyRuleBasicBuilder_ == null) { + return policyRuleBasic_ == null ? policy.Policy.PolicyRuleBasic.getDefaultInstance() : policyRuleBasic_; } else { - return polRuleActionVarBuilder_.getMessage(); + return policyRuleBasicBuilder_.getMessage(); } } /** - * <code>.policy.PolicyRuleVariable polRuleActionVar = 1;</code> + * <pre> + * Basic policy rule attributes + * </pre> + * + * <code>.policy.PolicyRuleBasic policyRuleBasic = 1;</code> */ - public Builder setPolRuleActionVar(policy.Policy.PolicyRuleVariable value) { - if (polRuleActionVarBuilder_ == null) { + public Builder setPolicyRuleBasic(policy.Policy.PolicyRuleBasic value) { + if (policyRuleBasicBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - polRuleActionVar_ = value; + policyRuleBasic_ = value; onChanged(); } else { - polRuleActionVarBuilder_.setMessage(value); + policyRuleBasicBuilder_.setMessage(value); } return this; } /** - * <code>.policy.PolicyRuleVariable polRuleActionVar = 1;</code> + * <pre> + * Basic policy rule attributes + * </pre> + * + * <code>.policy.PolicyRuleBasic policyRuleBasic = 1;</code> */ - public Builder setPolRuleActionVar( - policy.Policy.PolicyRuleVariable.Builder builderForValue) { - if (polRuleActionVarBuilder_ == null) { - polRuleActionVar_ = builderForValue.build(); + public Builder setPolicyRuleBasic( + policy.Policy.PolicyRuleBasic.Builder builderForValue) { + if (policyRuleBasicBuilder_ == null) { + policyRuleBasic_ = builderForValue.build(); onChanged(); } else { - polRuleActionVarBuilder_.setMessage(builderForValue.build()); + policyRuleBasicBuilder_.setMessage(builderForValue.build()); } return this; } /** - * <code>.policy.PolicyRuleVariable polRuleActionVar = 1;</code> + * <pre> + * Basic policy rule attributes + * </pre> + * + * <code>.policy.PolicyRuleBasic policyRuleBasic = 1;</code> */ - public Builder mergePolRuleActionVar(policy.Policy.PolicyRuleVariable value) { - if (polRuleActionVarBuilder_ == null) { - if (polRuleActionVar_ != null) { - polRuleActionVar_ = - policy.Policy.PolicyRuleVariable.newBuilder(polRuleActionVar_).mergeFrom(value).buildPartial(); + public Builder mergePolicyRuleBasic(policy.Policy.PolicyRuleBasic value) { + if (policyRuleBasicBuilder_ == null) { + if (policyRuleBasic_ != null) { + policyRuleBasic_ = + policy.Policy.PolicyRuleBasic.newBuilder(policyRuleBasic_).mergeFrom(value).buildPartial(); } else { - polRuleActionVar_ = value; + policyRuleBasic_ = value; } onChanged(); } else { - polRuleActionVarBuilder_.mergeFrom(value); + policyRuleBasicBuilder_.mergeFrom(value); } return this; } /** - * <code>.policy.PolicyRuleVariable polRuleActionVar = 1;</code> + * <pre> + * Basic policy rule attributes + * </pre> + * + * <code>.policy.PolicyRuleBasic policyRuleBasic = 1;</code> */ - public Builder clearPolRuleActionVar() { - if (polRuleActionVarBuilder_ == null) { - polRuleActionVar_ = null; + public Builder clearPolicyRuleBasic() { + if (policyRuleBasicBuilder_ == null) { + policyRuleBasic_ = null; onChanged(); } else { - polRuleActionVar_ = null; - polRuleActionVarBuilder_ = null; + policyRuleBasic_ = null; + policyRuleBasicBuilder_ = null; } return this; } /** - * <code>.policy.PolicyRuleVariable polRuleActionVar = 1;</code> + * <pre> + * Basic policy rule attributes + * </pre> + * + * <code>.policy.PolicyRuleBasic policyRuleBasic = 1;</code> */ - public policy.Policy.PolicyRuleVariable.Builder getPolRuleActionVarBuilder() { + public policy.Policy.PolicyRuleBasic.Builder getPolicyRuleBasicBuilder() { onChanged(); - return getPolRuleActionVarFieldBuilder().getBuilder(); + return getPolicyRuleBasicFieldBuilder().getBuilder(); } /** - * <code>.policy.PolicyRuleVariable polRuleActionVar = 1;</code> + * <pre> + * Basic policy rule attributes + * </pre> + * + * <code>.policy.PolicyRuleBasic policyRuleBasic = 1;</code> */ - public policy.Policy.PolicyRuleVariableOrBuilder getPolRuleActionVarOrBuilder() { - if (polRuleActionVarBuilder_ != null) { - return polRuleActionVarBuilder_.getMessageOrBuilder(); + public policy.Policy.PolicyRuleBasicOrBuilder getPolicyRuleBasicOrBuilder() { + if (policyRuleBasicBuilder_ != null) { + return policyRuleBasicBuilder_.getMessageOrBuilder(); } else { - return polRuleActionVar_ == null ? - policy.Policy.PolicyRuleVariable.getDefaultInstance() : polRuleActionVar_; + return policyRuleBasic_ == null ? + policy.Policy.PolicyRuleBasic.getDefaultInstance() : policyRuleBasic_; } } /** - * <code>.policy.PolicyRuleVariable polRuleActionVar = 1;</code> + * <pre> + * Basic policy rule attributes + * </pre> + * + * <code>.policy.PolicyRuleBasic policyRuleBasic = 1;</code> */ private com.google.protobuf.SingleFieldBuilderV3< - policy.Policy.PolicyRuleVariable, policy.Policy.PolicyRuleVariable.Builder, policy.Policy.PolicyRuleVariableOrBuilder> - getPolRuleActionVarFieldBuilder() { - if (polRuleActionVarBuilder_ == null) { - polRuleActionVarBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - policy.Policy.PolicyRuleVariable, policy.Policy.PolicyRuleVariable.Builder, policy.Policy.PolicyRuleVariableOrBuilder>( - getPolRuleActionVar(), + policy.Policy.PolicyRuleBasic, policy.Policy.PolicyRuleBasic.Builder, policy.Policy.PolicyRuleBasicOrBuilder> + getPolicyRuleBasicFieldBuilder() { + if (policyRuleBasicBuilder_ == null) { + policyRuleBasicBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + policy.Policy.PolicyRuleBasic, policy.Policy.PolicyRuleBasic.Builder, policy.Policy.PolicyRuleBasicOrBuilder>( + getPolicyRuleBasic(), getParentForChildren(), isClean()); - polRuleActionVar_ = null; + policyRuleBasic_ = null; } - return polRuleActionVarBuilder_; + return policyRuleBasicBuilder_; } - private policy.Policy.PolicyRuleValue polRuleActionVal_; + private context.ContextOuterClass.ServiceId serviceId_; private com.google.protobuf.SingleFieldBuilderV3< - policy.Policy.PolicyRuleValue, policy.Policy.PolicyRuleValue.Builder, policy.Policy.PolicyRuleValueOrBuilder> polRuleActionValBuilder_; + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> serviceIdBuilder_; /** - * <code>.policy.PolicyRuleValue polRuleActionVal = 2;</code> - * @return Whether the polRuleActionVal field is set. + * <pre> + * Affected service and (some of) its device(s) + * </pre> + * + * <code>.context.ServiceId serviceId = 2;</code> + * @return Whether the serviceId field is set. */ - public boolean hasPolRuleActionVal() { - return polRuleActionValBuilder_ != null || polRuleActionVal_ != null; + public boolean hasServiceId() { + return serviceIdBuilder_ != null || serviceId_ != null; } /** - * <code>.policy.PolicyRuleValue polRuleActionVal = 2;</code> - * @return The polRuleActionVal. + * <pre> + * Affected service and (some of) its device(s) + * </pre> + * + * <code>.context.ServiceId serviceId = 2;</code> + * @return The serviceId. */ - public policy.Policy.PolicyRuleValue getPolRuleActionVal() { - if (polRuleActionValBuilder_ == null) { - return polRuleActionVal_ == null ? policy.Policy.PolicyRuleValue.getDefaultInstance() : polRuleActionVal_; + public context.ContextOuterClass.ServiceId getServiceId() { + if (serviceIdBuilder_ == null) { + return serviceId_ == null ? context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; } else { - return polRuleActionValBuilder_.getMessage(); + return serviceIdBuilder_.getMessage(); } } /** - * <code>.policy.PolicyRuleValue polRuleActionVal = 2;</code> + * <pre> + * Affected service and (some of) its device(s) + * </pre> + * + * <code>.context.ServiceId serviceId = 2;</code> */ - public Builder setPolRuleActionVal(policy.Policy.PolicyRuleValue value) { - if (polRuleActionValBuilder_ == null) { + public Builder setServiceId(context.ContextOuterClass.ServiceId value) { + if (serviceIdBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - polRuleActionVal_ = value; + serviceId_ = value; onChanged(); } else { - polRuleActionValBuilder_.setMessage(value); + serviceIdBuilder_.setMessage(value); } return this; } /** - * <code>.policy.PolicyRuleValue polRuleActionVal = 2;</code> + * <pre> + * Affected service and (some of) its device(s) + * </pre> + * + * <code>.context.ServiceId serviceId = 2;</code> */ - public Builder setPolRuleActionVal( - policy.Policy.PolicyRuleValue.Builder builderForValue) { - if (polRuleActionValBuilder_ == null) { - polRuleActionVal_ = builderForValue.build(); + public Builder setServiceId( + context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (serviceIdBuilder_ == null) { + serviceId_ = builderForValue.build(); onChanged(); } else { - polRuleActionValBuilder_.setMessage(builderForValue.build()); + serviceIdBuilder_.setMessage(builderForValue.build()); } return this; } /** - * <code>.policy.PolicyRuleValue polRuleActionVal = 2;</code> + * <pre> + * Affected service and (some of) its device(s) + * </pre> + * + * <code>.context.ServiceId serviceId = 2;</code> */ - public Builder mergePolRuleActionVal(policy.Policy.PolicyRuleValue value) { - if (polRuleActionValBuilder_ == null) { - if (polRuleActionVal_ != null) { - polRuleActionVal_ = - policy.Policy.PolicyRuleValue.newBuilder(polRuleActionVal_).mergeFrom(value).buildPartial(); + public Builder mergeServiceId(context.ContextOuterClass.ServiceId value) { + if (serviceIdBuilder_ == null) { + if (serviceId_ != null) { + serviceId_ = + context.ContextOuterClass.ServiceId.newBuilder(serviceId_).mergeFrom(value).buildPartial(); } else { - polRuleActionVal_ = value; + serviceId_ = value; } onChanged(); } else { - polRuleActionValBuilder_.mergeFrom(value); + serviceIdBuilder_.mergeFrom(value); } return this; } /** - * <code>.policy.PolicyRuleValue polRuleActionVal = 2;</code> + * <pre> + * Affected service and (some of) its device(s) + * </pre> + * + * <code>.context.ServiceId serviceId = 2;</code> */ - public Builder clearPolRuleActionVal() { - if (polRuleActionValBuilder_ == null) { - polRuleActionVal_ = null; + public Builder clearServiceId() { + if (serviceIdBuilder_ == null) { + serviceId_ = null; onChanged(); } else { - polRuleActionVal_ = null; - polRuleActionValBuilder_ = null; + serviceId_ = null; + serviceIdBuilder_ = null; } return this; } /** - * <code>.policy.PolicyRuleValue polRuleActionVal = 2;</code> + * <pre> + * Affected service and (some of) its device(s) + * </pre> + * + * <code>.context.ServiceId serviceId = 2;</code> */ - public policy.Policy.PolicyRuleValue.Builder getPolRuleActionValBuilder() { + public context.ContextOuterClass.ServiceId.Builder getServiceIdBuilder() { onChanged(); - return getPolRuleActionValFieldBuilder().getBuilder(); + return getServiceIdFieldBuilder().getBuilder(); } /** - * <code>.policy.PolicyRuleValue polRuleActionVal = 2;</code> + * <pre> + * Affected service and (some of) its device(s) + * </pre> + * + * <code>.context.ServiceId serviceId = 2;</code> */ - public policy.Policy.PolicyRuleValueOrBuilder getPolRuleActionValOrBuilder() { - if (polRuleActionValBuilder_ != null) { - return polRuleActionValBuilder_.getMessageOrBuilder(); + public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder() { + if (serviceIdBuilder_ != null) { + return serviceIdBuilder_.getMessageOrBuilder(); } else { - return polRuleActionVal_ == null ? - policy.Policy.PolicyRuleValue.getDefaultInstance() : polRuleActionVal_; + return serviceId_ == null ? + context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; } } /** - * <code>.policy.PolicyRuleValue polRuleActionVal = 2;</code> + * <pre> + * Affected service and (some of) its device(s) + * </pre> + * + * <code>.context.ServiceId serviceId = 2;</code> */ private com.google.protobuf.SingleFieldBuilderV3< - policy.Policy.PolicyRuleValue, policy.Policy.PolicyRuleValue.Builder, policy.Policy.PolicyRuleValueOrBuilder> - getPolRuleActionValFieldBuilder() { - if (polRuleActionValBuilder_ == null) { - polRuleActionValBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - policy.Policy.PolicyRuleValue, policy.Policy.PolicyRuleValue.Builder, policy.Policy.PolicyRuleValueOrBuilder>( - getPolRuleActionVal(), + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> + getServiceIdFieldBuilder() { + if (serviceIdBuilder_ == null) { + serviceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder>( + getServiceId(), getParentForChildren(), isClean()); - polRuleActionVal_ = null; + serviceId_ = null; } - return polRuleActionValBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + return serviceIdBuilder_; } - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + private java.util.List<context.ContextOuterClass.DeviceId> deviceList_ = + java.util.Collections.emptyList(); + private void ensureDeviceListIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + deviceList_ = new java.util.ArrayList<context.ContextOuterClass.DeviceId>(deviceList_); + bitField0_ |= 0x00000001; + } } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> deviceListBuilder_; - // @@protoc_insertion_point(builder_scope:policy.PolicyRuleAction) - } - - // @@protoc_insertion_point(class_scope:policy.PolicyRuleAction) - private static final policy.Policy.PolicyRuleAction DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new policy.Policy.PolicyRuleAction(); - } - - public static policy.Policy.PolicyRuleAction getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser<PolicyRuleAction> - PARSER = new com.google.protobuf.AbstractParser<PolicyRuleAction>() { - @java.lang.Override - public PolicyRuleAction parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new PolicyRuleAction(input, extensionRegistry); + /** + * <pre> + * List of devices this service is traversing (not exhaustive) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 3;</code> + */ + public java.util.List<context.ContextOuterClass.DeviceId> getDeviceListList() { + if (deviceListBuilder_ == null) { + return java.util.Collections.unmodifiableList(deviceList_); + } else { + return deviceListBuilder_.getMessageList(); + } } - }; - - public static com.google.protobuf.Parser<PolicyRuleAction> parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser<PolicyRuleAction> getParserForType() { - return PARSER; - } - - @java.lang.Override - public policy.Policy.PolicyRuleAction getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface PolicyRuleOrBuilder extends - // @@protoc_insertion_point(interface_extends:policy.PolicyRule) - com.google.protobuf.MessageOrBuilder { - - /** - * <pre> - * Basic policy rule attributes - * </pre> - * - * <code>.policy.PolicyRuleId policyRuleId = 1;</code> - * @return Whether the policyRuleId field is set. - */ - boolean hasPolicyRuleId(); - /** - * <pre> - * Basic policy rule attributes - * </pre> - * - * <code>.policy.PolicyRuleId policyRuleId = 1;</code> - * @return The policyRuleId. - */ - policy.Policy.PolicyRuleId getPolicyRuleId(); - /** - * <pre> - * Basic policy rule attributes - * </pre> - * - * <code>.policy.PolicyRuleId policyRuleId = 1;</code> - */ - policy.Policy.PolicyRuleIdOrBuilder getPolicyRuleIdOrBuilder(); - - /** - * <code>.policy.PolicyRuleType policyRuleType = 2;</code> - * @return The enum numeric value on the wire for policyRuleType. - */ - int getPolicyRuleTypeValue(); - /** - * <code>.policy.PolicyRuleType policyRuleType = 2;</code> - * @return The policyRuleType. - */ - policy.Policy.PolicyRuleType getPolicyRuleType(); - - /** - * <code>uint32 PolicyRulePriority = 3;</code> - * @return The policyRulePriority. - */ - int getPolicyRulePriority(); - - /** - * <pre> - * Event-Condition-Action model - * </pre> - * - * <code>.policy.PolicyRuleEvent event = 4;</code> - * @return Whether the event field is set. - */ - boolean hasEvent(); - /** - * <pre> - * Event-Condition-Action model - * </pre> - * - * <code>.policy.PolicyRuleEvent event = 4;</code> - * @return The event. - */ - policy.Policy.PolicyRuleEvent getEvent(); - /** - * <pre> - * Event-Condition-Action model - * </pre> - * - * <code>.policy.PolicyRuleEvent event = 4;</code> - */ - policy.Policy.PolicyRuleEventOrBuilder getEventOrBuilder(); - - /** - * <pre> - * One or more conditions must be met - * </pre> - * - * <code>repeated .policy.PolicyRuleCondition polRuleConditionList = 5;</code> - */ - java.util.List<policy.Policy.PolicyRuleCondition> - getPolRuleConditionListList(); - /** - * <pre> - * One or more conditions must be met - * </pre> - * - * <code>repeated .policy.PolicyRuleCondition polRuleConditionList = 5;</code> - */ - policy.Policy.PolicyRuleCondition getPolRuleConditionList(int index); - /** - * <pre> - * One or more conditions must be met - * </pre> - * - * <code>repeated .policy.PolicyRuleCondition polRuleConditionList = 5;</code> - */ - int getPolRuleConditionListCount(); - /** - * <pre> - * One or more conditions must be met - * </pre> - * - * <code>repeated .policy.PolicyRuleCondition polRuleConditionList = 5;</code> - */ - java.util.List<? extends policy.Policy.PolicyRuleConditionOrBuilder> - getPolRuleConditionListOrBuilderList(); - /** - * <pre> - * One or more conditions must be met - * </pre> - * - * <code>repeated .policy.PolicyRuleCondition polRuleConditionList = 5;</code> - */ - policy.Policy.PolicyRuleConditionOrBuilder getPolRuleConditionListOrBuilder( - int index); - - /** - * <pre> - * One or more actions should be applied - * </pre> - * - * <code>repeated .policy.PolicyRuleAction polRuleActionList = 6;</code> - */ - java.util.List<policy.Policy.PolicyRuleAction> - getPolRuleActionListList(); - /** - * <pre> - * One or more actions should be applied - * </pre> - * - * <code>repeated .policy.PolicyRuleAction polRuleActionList = 6;</code> - */ - policy.Policy.PolicyRuleAction getPolRuleActionList(int index); - /** - * <pre> - * One or more actions should be applied - * </pre> - * - * <code>repeated .policy.PolicyRuleAction polRuleActionList = 6;</code> - */ - int getPolRuleActionListCount(); - /** - * <pre> - * One or more actions should be applied - * </pre> - * - * <code>repeated .policy.PolicyRuleAction polRuleActionList = 6;</code> - */ - java.util.List<? extends policy.Policy.PolicyRuleActionOrBuilder> - getPolRuleActionListOrBuilderList(); - /** - * <pre> - * One or more actions should be applied - * </pre> - * - * <code>repeated .policy.PolicyRuleAction polRuleActionList = 6;</code> - */ - policy.Policy.PolicyRuleActionOrBuilder getPolRuleActionListOrBuilder( - int index); - - /** - * <pre> - * Affected services and devices - * </pre> - * - * <code>repeated .context.ServiceId serviceList = 7;</code> - */ - java.util.List<context.ContextOuterClass.ServiceId> - getServiceListList(); - /** - * <pre> - * Affected services and devices - * </pre> - * - * <code>repeated .context.ServiceId serviceList = 7;</code> - */ - context.ContextOuterClass.ServiceId getServiceList(int index); - /** - * <pre> - * Affected services and devices - * </pre> - * - * <code>repeated .context.ServiceId serviceList = 7;</code> - */ - int getServiceListCount(); - /** - * <pre> - * Affected services and devices - * </pre> - * - * <code>repeated .context.ServiceId serviceList = 7;</code> - */ - java.util.List<? extends context.ContextOuterClass.ServiceIdOrBuilder> - getServiceListOrBuilderList(); - /** - * <pre> - * Affected services and devices - * </pre> - * - * <code>repeated .context.ServiceId serviceList = 7;</code> - */ - context.ContextOuterClass.ServiceIdOrBuilder getServiceListOrBuilder( - int index); - - /** - * <code>repeated .context.DeviceId deviceList = 8;</code> - */ - java.util.List<context.ContextOuterClass.DeviceId> - getDeviceListList(); - /** - * <code>repeated .context.DeviceId deviceList = 8;</code> - */ - context.ContextOuterClass.DeviceId getDeviceList(int index); - /** - * <code>repeated .context.DeviceId deviceList = 8;</code> - */ - int getDeviceListCount(); - /** - * <code>repeated .context.DeviceId deviceList = 8;</code> - */ - java.util.List<? extends context.ContextOuterClass.DeviceIdOrBuilder> - getDeviceListOrBuilderList(); - /** - * <code>repeated .context.DeviceId deviceList = 8;</code> - */ - context.ContextOuterClass.DeviceIdOrBuilder getDeviceListOrBuilder( - int index); - } - /** - * <pre> - * 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 - * </pre> - * - * Protobuf type {@code policy.PolicyRule} - */ - public static final class PolicyRule extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:policy.PolicyRule) - PolicyRuleOrBuilder { - private static final long serialVersionUID = 0L; - // Use PolicyRule.newBuilder() to construct. - private PolicyRule(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { - super(builder); - } - private PolicyRule() { - policyRuleType_ = 0; - polRuleConditionList_ = java.util.Collections.emptyList(); - polRuleActionList_ = java.util.Collections.emptyList(); - serviceList_ = java.util.Collections.emptyList(); - deviceList_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new PolicyRule(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private PolicyRule( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); + /** + * <pre> + * List of devices this service is traversing (not exhaustive) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 3;</code> + */ + public int getDeviceListCount() { + if (deviceListBuilder_ == null) { + return deviceList_.size(); + } else { + return deviceListBuilder_.getCount(); + } } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - policy.Policy.PolicyRuleId.Builder subBuilder = null; - if (policyRuleId_ != null) { - subBuilder = policyRuleId_.toBuilder(); - } - policyRuleId_ = input.readMessage(policy.Policy.PolicyRuleId.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(policyRuleId_); - policyRuleId_ = subBuilder.buildPartial(); - } - - break; - } - case 16: { - int rawValue = input.readEnum(); - - policyRuleType_ = rawValue; - break; - } - case 24: { - - policyRulePriority_ = input.readUInt32(); - break; - } - case 34: { - policy.Policy.PolicyRuleEvent.Builder subBuilder = null; - if (event_ != null) { - subBuilder = event_.toBuilder(); - } - event_ = input.readMessage(policy.Policy.PolicyRuleEvent.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(event_); - event_ = subBuilder.buildPartial(); - } - - break; - } - case 42: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - polRuleConditionList_ = new java.util.ArrayList<policy.Policy.PolicyRuleCondition>(); - mutable_bitField0_ |= 0x00000001; - } - polRuleConditionList_.add( - input.readMessage(policy.Policy.PolicyRuleCondition.parser(), extensionRegistry)); - break; - } - case 50: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - polRuleActionList_ = new java.util.ArrayList<policy.Policy.PolicyRuleAction>(); - mutable_bitField0_ |= 0x00000002; - } - polRuleActionList_.add( - input.readMessage(policy.Policy.PolicyRuleAction.parser(), extensionRegistry)); - break; - } - case 58: { - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - serviceList_ = new java.util.ArrayList<context.ContextOuterClass.ServiceId>(); - mutable_bitField0_ |= 0x00000004; - } - serviceList_.add( - input.readMessage(context.ContextOuterClass.ServiceId.parser(), extensionRegistry)); - break; - } - case 66: { - if (!((mutable_bitField0_ & 0x00000008) != 0)) { - deviceList_ = new java.util.ArrayList<context.ContextOuterClass.DeviceId>(); - mutable_bitField0_ |= 0x00000008; - } - deviceList_.add( - input.readMessage(context.ContextOuterClass.DeviceId.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } + /** + * <pre> + * List of devices this service is traversing (not exhaustive) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 3;</code> + */ + public context.ContextOuterClass.DeviceId getDeviceList(int index) { + if (deviceListBuilder_ == null) { + return deviceList_.get(index); + } else { + return deviceListBuilder_.getMessage(index); + } + } + /** + * <pre> + * List of devices this service is traversing (not exhaustive) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 3;</code> + */ + public Builder setDeviceList( + int index, context.ContextOuterClass.DeviceId value) { + if (deviceListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); } + ensureDeviceListIsMutable(); + deviceList_.set(index, value); + onChanged(); + } else { + deviceListBuilder_.setMessage(index, value); + } + return this; + } + /** + * <pre> + * List of devices this service is traversing (not exhaustive) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 3;</code> + */ + public Builder setDeviceList( + int index, context.ContextOuterClass.DeviceId.Builder builderForValue) { + if (deviceListBuilder_ == null) { + ensureDeviceListIsMutable(); + deviceList_.set(index, builderForValue.build()); + onChanged(); + } else { + deviceListBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * <pre> + * List of devices this service is traversing (not exhaustive) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 3;</code> + */ + public Builder addDeviceList(context.ContextOuterClass.DeviceId value) { + if (deviceListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeviceListIsMutable(); + deviceList_.add(value); + onChanged(); + } else { + deviceListBuilder_.addMessage(value); + } + return this; + } + /** + * <pre> + * List of devices this service is traversing (not exhaustive) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 3;</code> + */ + public Builder addDeviceList( + int index, context.ContextOuterClass.DeviceId value) { + if (deviceListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeviceListIsMutable(); + deviceList_.add(index, value); + onChanged(); + } else { + deviceListBuilder_.addMessage(index, value); + } + return this; + } + /** + * <pre> + * List of devices this service is traversing (not exhaustive) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 3;</code> + */ + public Builder addDeviceList( + context.ContextOuterClass.DeviceId.Builder builderForValue) { + if (deviceListBuilder_ == null) { + ensureDeviceListIsMutable(); + deviceList_.add(builderForValue.build()); + onChanged(); + } else { + deviceListBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * <pre> + * List of devices this service is traversing (not exhaustive) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 3;</code> + */ + public Builder addDeviceList( + int index, context.ContextOuterClass.DeviceId.Builder builderForValue) { + if (deviceListBuilder_ == null) { + ensureDeviceListIsMutable(); + deviceList_.add(index, builderForValue.build()); + onChanged(); + } else { + deviceListBuilder_.addMessage(index, builderForValue.build()); } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - polRuleConditionList_ = java.util.Collections.unmodifiableList(polRuleConditionList_); + return this; + } + /** + * <pre> + * List of devices this service is traversing (not exhaustive) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 3;</code> + */ + public Builder addAllDeviceList( + java.lang.Iterable<? extends context.ContextOuterClass.DeviceId> values) { + if (deviceListBuilder_ == null) { + ensureDeviceListIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, deviceList_); + onChanged(); + } else { + deviceListBuilder_.addAllMessages(values); } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - polRuleActionList_ = java.util.Collections.unmodifiableList(polRuleActionList_); + return this; + } + /** + * <pre> + * List of devices this service is traversing (not exhaustive) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 3;</code> + */ + public Builder clearDeviceList() { + if (deviceListBuilder_ == null) { + deviceList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + deviceListBuilder_.clear(); } - if (((mutable_bitField0_ & 0x00000004) != 0)) { - serviceList_ = java.util.Collections.unmodifiableList(serviceList_); + return this; + } + /** + * <pre> + * List of devices this service is traversing (not exhaustive) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 3;</code> + */ + public Builder removeDeviceList(int index) { + if (deviceListBuilder_ == null) { + ensureDeviceListIsMutable(); + deviceList_.remove(index); + onChanged(); + } else { + deviceListBuilder_.remove(index); } - if (((mutable_bitField0_ & 0x00000008) != 0)) { - deviceList_ = java.util.Collections.unmodifiableList(deviceList_); + return this; + } + /** + * <pre> + * List of devices this service is traversing (not exhaustive) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 3;</code> + */ + public context.ContextOuterClass.DeviceId.Builder getDeviceListBuilder( + int index) { + return getDeviceListFieldBuilder().getBuilder(index); + } + /** + * <pre> + * List of devices this service is traversing (not exhaustive) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 3;</code> + */ + public context.ContextOuterClass.DeviceIdOrBuilder getDeviceListOrBuilder( + int index) { + if (deviceListBuilder_ == null) { + return deviceList_.get(index); } else { + return deviceListBuilder_.getMessageOrBuilder(index); } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return policy.Policy.internal_static_policy_PolicyRule_descriptor; - } + /** + * <pre> + * List of devices this service is traversing (not exhaustive) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 3;</code> + */ + public java.util.List<? extends context.ContextOuterClass.DeviceIdOrBuilder> + getDeviceListOrBuilderList() { + if (deviceListBuilder_ != null) { + return deviceListBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(deviceList_); + } + } + /** + * <pre> + * List of devices this service is traversing (not exhaustive) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 3;</code> + */ + public context.ContextOuterClass.DeviceId.Builder addDeviceListBuilder() { + return getDeviceListFieldBuilder().addBuilder( + context.ContextOuterClass.DeviceId.getDefaultInstance()); + } + /** + * <pre> + * List of devices this service is traversing (not exhaustive) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 3;</code> + */ + public context.ContextOuterClass.DeviceId.Builder addDeviceListBuilder( + int index) { + return getDeviceListFieldBuilder().addBuilder( + index, context.ContextOuterClass.DeviceId.getDefaultInstance()); + } + /** + * <pre> + * List of devices this service is traversing (not exhaustive) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 3;</code> + */ + public java.util.List<context.ContextOuterClass.DeviceId.Builder> + getDeviceListBuilderList() { + return getDeviceListFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> + getDeviceListFieldBuilder() { + if (deviceListBuilder_ == null) { + deviceListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder>( + deviceList_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + deviceList_ = null; + } + return deviceListBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return policy.Policy.internal_static_policy_PolicyRule_fieldAccessorTable - .ensureFieldAccessorsInitialized( - policy.Policy.PolicyRule.class, policy.Policy.PolicyRule.Builder.class); - } + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } - public static final int POLICYRULEID_FIELD_NUMBER = 1; - private policy.Policy.PolicyRuleId policyRuleId_; - /** - * <pre> - * Basic policy rule attributes - * </pre> - * - * <code>.policy.PolicyRuleId policyRuleId = 1;</code> - * @return Whether the policyRuleId field is set. - */ - @java.lang.Override - public boolean hasPolicyRuleId() { - return policyRuleId_ != null; - } - /** - * <pre> - * Basic policy rule attributes - * </pre> - * - * <code>.policy.PolicyRuleId policyRuleId = 1;</code> - * @return The policyRuleId. - */ - @java.lang.Override - public policy.Policy.PolicyRuleId getPolicyRuleId() { - return policyRuleId_ == null ? policy.Policy.PolicyRuleId.getDefaultInstance() : policyRuleId_; - } - /** - * <pre> - * Basic policy rule attributes - * </pre> - * - * <code>.policy.PolicyRuleId policyRuleId = 1;</code> - */ - @java.lang.Override - public policy.Policy.PolicyRuleIdOrBuilder getPolicyRuleIdOrBuilder() { - return getPolicyRuleId(); - } - public static final int POLICYRULETYPE_FIELD_NUMBER = 2; - private int policyRuleType_; - /** - * <code>.policy.PolicyRuleType policyRuleType = 2;</code> - * @return The enum numeric value on the wire for policyRuleType. - */ - @java.lang.Override public int getPolicyRuleTypeValue() { - return policyRuleType_; - } - /** - * <code>.policy.PolicyRuleType policyRuleType = 2;</code> - * @return The policyRuleType. - */ - @java.lang.Override public policy.Policy.PolicyRuleType getPolicyRuleType() { - @SuppressWarnings("deprecation") - policy.Policy.PolicyRuleType result = policy.Policy.PolicyRuleType.valueOf(policyRuleType_); - return result == null ? policy.Policy.PolicyRuleType.UNRECOGNIZED : result; + // @@protoc_insertion_point(builder_scope:policy.PolicyRuleService) } - public static final int POLICYRULEPRIORITY_FIELD_NUMBER = 3; - private int policyRulePriority_; - /** - * <code>uint32 PolicyRulePriority = 3;</code> - * @return The policyRulePriority. - */ - @java.lang.Override - public int getPolicyRulePriority() { - return policyRulePriority_; + // @@protoc_insertion_point(class_scope:policy.PolicyRuleService) + private static final policy.Policy.PolicyRuleService DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new policy.Policy.PolicyRuleService(); } - public static final int EVENT_FIELD_NUMBER = 4; - private policy.Policy.PolicyRuleEvent event_; - /** - * <pre> - * Event-Condition-Action model - * </pre> - * - * <code>.policy.PolicyRuleEvent event = 4;</code> - * @return Whether the event field is set. - */ - @java.lang.Override - public boolean hasEvent() { - return event_ != null; - } - /** - * <pre> - * Event-Condition-Action model - * </pre> - * - * <code>.policy.PolicyRuleEvent event = 4;</code> - * @return The event. - */ - @java.lang.Override - public policy.Policy.PolicyRuleEvent getEvent() { - return event_ == null ? policy.Policy.PolicyRuleEvent.getDefaultInstance() : event_; + public static policy.Policy.PolicyRuleService getDefaultInstance() { + return DEFAULT_INSTANCE; } - /** - * <pre> - * Event-Condition-Action model - * </pre> - * - * <code>.policy.PolicyRuleEvent event = 4;</code> - */ - @java.lang.Override - public policy.Policy.PolicyRuleEventOrBuilder getEventOrBuilder() { - return getEvent(); + + private static final com.google.protobuf.Parser<PolicyRuleService> + PARSER = new com.google.protobuf.AbstractParser<PolicyRuleService>() { + @java.lang.Override + public PolicyRuleService parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PolicyRuleService(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<PolicyRuleService> parser() { + return PARSER; } - public static final int POLRULECONDITIONLIST_FIELD_NUMBER = 5; - private java.util.List<policy.Policy.PolicyRuleCondition> polRuleConditionList_; - /** - * <pre> - * One or more conditions must be met - * </pre> - * - * <code>repeated .policy.PolicyRuleCondition polRuleConditionList = 5;</code> - */ @java.lang.Override - public java.util.List<policy.Policy.PolicyRuleCondition> getPolRuleConditionListList() { - return polRuleConditionList_; + public com.google.protobuf.Parser<PolicyRuleService> getParserForType() { + return PARSER; } - /** - * <pre> - * One or more conditions must be met - * </pre> - * - * <code>repeated .policy.PolicyRuleCondition polRuleConditionList = 5;</code> - */ + @java.lang.Override - public java.util.List<? extends policy.Policy.PolicyRuleConditionOrBuilder> - getPolRuleConditionListOrBuilderList() { - return polRuleConditionList_; + public policy.Policy.PolicyRuleService getDefaultInstanceForType() { + return DEFAULT_INSTANCE; } + + } + + public interface PolicyRuleDeviceOrBuilder extends + // @@protoc_insertion_point(interface_extends:policy.PolicyRuleDevice) + com.google.protobuf.MessageOrBuilder { + /** * <pre> - * One or more conditions must be met + * Basic policy rule attributes * </pre> * - * <code>repeated .policy.PolicyRuleCondition polRuleConditionList = 5;</code> + * <code>.policy.PolicyRuleBasic policyRuleBasic = 1;</code> + * @return Whether the policyRuleBasic field is set. */ - @java.lang.Override - public int getPolRuleConditionListCount() { - return polRuleConditionList_.size(); - } + boolean hasPolicyRuleBasic(); /** * <pre> - * One or more conditions must be met + * Basic policy rule attributes * </pre> * - * <code>repeated .policy.PolicyRuleCondition polRuleConditionList = 5;</code> + * <code>.policy.PolicyRuleBasic policyRuleBasic = 1;</code> + * @return The policyRuleBasic. */ - @java.lang.Override - public policy.Policy.PolicyRuleCondition getPolRuleConditionList(int index) { - return polRuleConditionList_.get(index); - } + policy.Policy.PolicyRuleBasic getPolicyRuleBasic(); /** * <pre> - * One or more conditions must be met + * Basic policy rule attributes * </pre> * - * <code>repeated .policy.PolicyRuleCondition polRuleConditionList = 5;</code> + * <code>.policy.PolicyRuleBasic policyRuleBasic = 1;</code> */ - @java.lang.Override - public policy.Policy.PolicyRuleConditionOrBuilder getPolRuleConditionListOrBuilder( - int index) { - return polRuleConditionList_.get(index); - } + policy.Policy.PolicyRuleBasicOrBuilder getPolicyRuleBasicOrBuilder(); - public static final int POLRULEACTIONLIST_FIELD_NUMBER = 6; - private java.util.List<policy.Policy.PolicyRuleAction> polRuleActionList_; /** * <pre> - * One or more actions should be applied + * Affected device(s) * </pre> * - * <code>repeated .policy.PolicyRuleAction polRuleActionList = 6;</code> + * <code>repeated .context.DeviceId deviceList = 2;</code> */ - @java.lang.Override - public java.util.List<policy.Policy.PolicyRuleAction> getPolRuleActionListList() { - return polRuleActionList_; - } + java.util.List<context.ContextOuterClass.DeviceId> + getDeviceListList(); /** * <pre> - * One or more actions should be applied + * Affected device(s) * </pre> * - * <code>repeated .policy.PolicyRuleAction polRuleActionList = 6;</code> + * <code>repeated .context.DeviceId deviceList = 2;</code> */ - @java.lang.Override - public java.util.List<? extends policy.Policy.PolicyRuleActionOrBuilder> - getPolRuleActionListOrBuilderList() { - return polRuleActionList_; - } + context.ContextOuterClass.DeviceId getDeviceList(int index); /** * <pre> - * One or more actions should be applied + * Affected device(s) * </pre> * - * <code>repeated .policy.PolicyRuleAction polRuleActionList = 6;</code> + * <code>repeated .context.DeviceId deviceList = 2;</code> */ - @java.lang.Override - public int getPolRuleActionListCount() { - return polRuleActionList_.size(); - } + int getDeviceListCount(); /** * <pre> - * One or more actions should be applied + * Affected device(s) * </pre> * - * <code>repeated .policy.PolicyRuleAction polRuleActionList = 6;</code> + * <code>repeated .context.DeviceId deviceList = 2;</code> */ - @java.lang.Override - public policy.Policy.PolicyRuleAction getPolRuleActionList(int index) { - return polRuleActionList_.get(index); - } + java.util.List<? extends context.ContextOuterClass.DeviceIdOrBuilder> + getDeviceListOrBuilderList(); /** * <pre> - * One or more actions should be applied + * Affected device(s) * </pre> * - * <code>repeated .policy.PolicyRuleAction polRuleActionList = 6;</code> + * <code>repeated .context.DeviceId deviceList = 2;</code> */ + context.ContextOuterClass.DeviceIdOrBuilder getDeviceListOrBuilder( + int index); + } + /** + * <pre> + * Device-oriented policy rule + * </pre> + * + * Protobuf type {@code policy.PolicyRuleDevice} + */ + public static final class PolicyRuleDevice extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:policy.PolicyRuleDevice) + PolicyRuleDeviceOrBuilder { + private static final long serialVersionUID = 0L; + // Use PolicyRuleDevice.newBuilder() to construct. + private PolicyRuleDevice(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private PolicyRuleDevice() { + deviceList_ = java.util.Collections.emptyList(); + } + @java.lang.Override - public policy.Policy.PolicyRuleActionOrBuilder getPolRuleActionListOrBuilder( - int index) { - return polRuleActionList_.get(index); + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new PolicyRuleDevice(); } - public static final int SERVICELIST_FIELD_NUMBER = 7; - private java.util.List<context.ContextOuterClass.ServiceId> serviceList_; - /** - * <pre> - * Affected services and devices - * </pre> - * - * <code>repeated .context.ServiceId serviceList = 7;</code> - */ @java.lang.Override - public java.util.List<context.ContextOuterClass.ServiceId> getServiceListList() { - return serviceList_; + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; } - /** - * <pre> - * Affected services and devices - * </pre> - * - * <code>repeated .context.ServiceId serviceList = 7;</code> - */ + private PolicyRuleDevice( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + policy.Policy.PolicyRuleBasic.Builder subBuilder = null; + if (policyRuleBasic_ != null) { + subBuilder = policyRuleBasic_.toBuilder(); + } + policyRuleBasic_ = input.readMessage(policy.Policy.PolicyRuleBasic.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(policyRuleBasic_); + policyRuleBasic_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + deviceList_ = new java.util.ArrayList<context.ContextOuterClass.DeviceId>(); + mutable_bitField0_ |= 0x00000001; + } + deviceList_.add( + input.readMessage(context.ContextOuterClass.DeviceId.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + deviceList_ = java.util.Collections.unmodifiableList(deviceList_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return policy.Policy.internal_static_policy_PolicyRuleDevice_descriptor; + } + @java.lang.Override - public java.util.List<? extends context.ContextOuterClass.ServiceIdOrBuilder> - getServiceListOrBuilderList() { - return serviceList_; + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return policy.Policy.internal_static_policy_PolicyRuleDevice_fieldAccessorTable + .ensureFieldAccessorsInitialized( + policy.Policy.PolicyRuleDevice.class, policy.Policy.PolicyRuleDevice.Builder.class); } + + public static final int POLICYRULEBASIC_FIELD_NUMBER = 1; + private policy.Policy.PolicyRuleBasic policyRuleBasic_; /** * <pre> - * Affected services and devices + * Basic policy rule attributes * </pre> * - * <code>repeated .context.ServiceId serviceList = 7;</code> + * <code>.policy.PolicyRuleBasic policyRuleBasic = 1;</code> + * @return Whether the policyRuleBasic field is set. */ @java.lang.Override - public int getServiceListCount() { - return serviceList_.size(); + public boolean hasPolicyRuleBasic() { + return policyRuleBasic_ != null; } /** * <pre> - * Affected services and devices + * Basic policy rule attributes * </pre> * - * <code>repeated .context.ServiceId serviceList = 7;</code> + * <code>.policy.PolicyRuleBasic policyRuleBasic = 1;</code> + * @return The policyRuleBasic. */ @java.lang.Override - public context.ContextOuterClass.ServiceId getServiceList(int index) { - return serviceList_.get(index); + public policy.Policy.PolicyRuleBasic getPolicyRuleBasic() { + return policyRuleBasic_ == null ? policy.Policy.PolicyRuleBasic.getDefaultInstance() : policyRuleBasic_; } /** * <pre> - * Affected services and devices + * Basic policy rule attributes * </pre> * - * <code>repeated .context.ServiceId serviceList = 7;</code> + * <code>.policy.PolicyRuleBasic policyRuleBasic = 1;</code> */ @java.lang.Override - public context.ContextOuterClass.ServiceIdOrBuilder getServiceListOrBuilder( - int index) { - return serviceList_.get(index); + public policy.Policy.PolicyRuleBasicOrBuilder getPolicyRuleBasicOrBuilder() { + return getPolicyRuleBasic(); } - public static final int DEVICELIST_FIELD_NUMBER = 8; + public static final int DEVICELIST_FIELD_NUMBER = 2; private java.util.List<context.ContextOuterClass.DeviceId> deviceList_; /** - * <code>repeated .context.DeviceId deviceList = 8;</code> + * <pre> + * Affected device(s) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 2;</code> */ @java.lang.Override public java.util.List<context.ContextOuterClass.DeviceId> getDeviceListList() { return deviceList_; } /** - * <code>repeated .context.DeviceId deviceList = 8;</code> + * <pre> + * Affected device(s) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 2;</code> */ @java.lang.Override public java.util.List<? extends context.ContextOuterClass.DeviceIdOrBuilder> @@ -5771,21 +5147,33 @@ public final class Policy { return deviceList_; } /** - * <code>repeated .context.DeviceId deviceList = 8;</code> + * <pre> + * Affected device(s) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 2;</code> */ @java.lang.Override public int getDeviceListCount() { return deviceList_.size(); } /** - * <code>repeated .context.DeviceId deviceList = 8;</code> + * <pre> + * Affected device(s) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 2;</code> */ @java.lang.Override public context.ContextOuterClass.DeviceId getDeviceList(int index) { return deviceList_.get(index); } /** - * <code>repeated .context.DeviceId deviceList = 8;</code> + * <pre> + * Affected device(s) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 2;</code> */ @java.lang.Override public context.ContextOuterClass.DeviceIdOrBuilder getDeviceListOrBuilder( @@ -5807,29 +5195,11 @@ public final class Policy { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (policyRuleId_ != null) { - output.writeMessage(1, getPolicyRuleId()); - } - if (policyRuleType_ != policy.Policy.PolicyRuleType.POLICYTYPE_DEVICE.getNumber()) { - output.writeEnum(2, policyRuleType_); - } - if (policyRulePriority_ != 0) { - output.writeUInt32(3, policyRulePriority_); - } - if (event_ != null) { - output.writeMessage(4, getEvent()); - } - for (int i = 0; i < polRuleConditionList_.size(); i++) { - output.writeMessage(5, polRuleConditionList_.get(i)); - } - for (int i = 0; i < polRuleActionList_.size(); i++) { - output.writeMessage(6, polRuleActionList_.get(i)); - } - for (int i = 0; i < serviceList_.size(); i++) { - output.writeMessage(7, serviceList_.get(i)); + if (policyRuleBasic_ != null) { + output.writeMessage(1, getPolicyRuleBasic()); } for (int i = 0; i < deviceList_.size(); i++) { - output.writeMessage(8, deviceList_.get(i)); + output.writeMessage(2, deviceList_.get(i)); } unknownFields.writeTo(output); } @@ -5840,37 +5210,13 @@ public final class Policy { if (size != -1) return size; size = 0; - if (policyRuleId_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getPolicyRuleId()); - } - if (policyRuleType_ != policy.Policy.PolicyRuleType.POLICYTYPE_DEVICE.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(2, policyRuleType_); - } - if (policyRulePriority_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(3, policyRulePriority_); - } - if (event_ != null) { + if (policyRuleBasic_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, getEvent()); - } - for (int i = 0; i < polRuleConditionList_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, polRuleConditionList_.get(i)); - } - for (int i = 0; i < polRuleActionList_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, polRuleActionList_.get(i)); - } - for (int i = 0; i < serviceList_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, serviceList_.get(i)); + .computeMessageSize(1, getPolicyRuleBasic()); } for (int i = 0; i < deviceList_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(8, deviceList_.get(i)); + .computeMessageSize(2, deviceList_.get(i)); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -5882,30 +5228,16 @@ public final class Policy { if (obj == this) { return true; } - if (!(obj instanceof policy.Policy.PolicyRule)) { + if (!(obj instanceof policy.Policy.PolicyRuleDevice)) { return super.equals(obj); } - policy.Policy.PolicyRule other = (policy.Policy.PolicyRule) obj; + policy.Policy.PolicyRuleDevice other = (policy.Policy.PolicyRuleDevice) obj; - if (hasPolicyRuleId() != other.hasPolicyRuleId()) return false; - if (hasPolicyRuleId()) { - if (!getPolicyRuleId() - .equals(other.getPolicyRuleId())) return false; + if (hasPolicyRuleBasic() != other.hasPolicyRuleBasic()) return false; + if (hasPolicyRuleBasic()) { + if (!getPolicyRuleBasic() + .equals(other.getPolicyRuleBasic())) return false; } - if (policyRuleType_ != other.policyRuleType_) return false; - if (getPolicyRulePriority() - != other.getPolicyRulePriority()) return false; - if (hasEvent() != other.hasEvent()) return false; - if (hasEvent()) { - if (!getEvent() - .equals(other.getEvent())) return false; - } - if (!getPolRuleConditionListList() - .equals(other.getPolRuleConditionListList())) return false; - if (!getPolRuleActionListList() - .equals(other.getPolRuleActionListList())) return false; - if (!getServiceListList() - .equals(other.getServiceListList())) return false; if (!getDeviceListList() .equals(other.getDeviceListList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; @@ -5919,29 +5251,9 @@ public final class Policy { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasPolicyRuleId()) { - hash = (37 * hash) + POLICYRULEID_FIELD_NUMBER; - hash = (53 * hash) + getPolicyRuleId().hashCode(); - } - hash = (37 * hash) + POLICYRULETYPE_FIELD_NUMBER; - hash = (53 * hash) + policyRuleType_; - hash = (37 * hash) + POLICYRULEPRIORITY_FIELD_NUMBER; - hash = (53 * hash) + getPolicyRulePriority(); - if (hasEvent()) { - hash = (37 * hash) + EVENT_FIELD_NUMBER; - hash = (53 * hash) + getEvent().hashCode(); - } - if (getPolRuleConditionListCount() > 0) { - hash = (37 * hash) + POLRULECONDITIONLIST_FIELD_NUMBER; - hash = (53 * hash) + getPolRuleConditionListList().hashCode(); - } - if (getPolRuleActionListCount() > 0) { - hash = (37 * hash) + POLRULEACTIONLIST_FIELD_NUMBER; - hash = (53 * hash) + getPolRuleActionListList().hashCode(); - } - if (getServiceListCount() > 0) { - hash = (37 * hash) + SERVICELIST_FIELD_NUMBER; - hash = (53 * hash) + getServiceListList().hashCode(); + if (hasPolicyRuleBasic()) { + hash = (37 * hash) + POLICYRULEBASIC_FIELD_NUMBER; + hash = (53 * hash) + getPolicyRuleBasic().hashCode(); } if (getDeviceListCount() > 0) { hash = (37 * hash) + DEVICELIST_FIELD_NUMBER; @@ -5952,69 +5264,69 @@ public final class Policy { return hash; } - public static policy.Policy.PolicyRule parseFrom( + public static policy.Policy.PolicyRuleDevice parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static policy.Policy.PolicyRule parseFrom( + public static policy.Policy.PolicyRuleDevice parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static policy.Policy.PolicyRule parseFrom( + public static policy.Policy.PolicyRuleDevice parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static policy.Policy.PolicyRule parseFrom( + public static policy.Policy.PolicyRuleDevice parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static policy.Policy.PolicyRule parseFrom(byte[] data) + public static policy.Policy.PolicyRuleDevice parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static policy.Policy.PolicyRule parseFrom( + public static policy.Policy.PolicyRuleDevice parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static policy.Policy.PolicyRule parseFrom(java.io.InputStream input) + public static policy.Policy.PolicyRuleDevice parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static policy.Policy.PolicyRule parseFrom( + public static policy.Policy.PolicyRuleDevice parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } - public static policy.Policy.PolicyRule parseDelimitedFrom(java.io.InputStream input) + public static policy.Policy.PolicyRuleDevice parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static policy.Policy.PolicyRule parseDelimitedFrom( + public static policy.Policy.PolicyRuleDevice parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static policy.Policy.PolicyRule parseFrom( + public static policy.Policy.PolicyRuleDevice parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static policy.Policy.PolicyRule parseFrom( + public static policy.Policy.PolicyRuleDevice parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -6027,7 +5339,7 @@ public final class Policy { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(policy.Policy.PolicyRule prototype) { + public static Builder newBuilder(policy.Policy.PolicyRuleDevice prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -6044,32 +5356,29 @@ public final class Policy { } /** * <pre> - * 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 + * Device-oriented policy rule * </pre> * - * Protobuf type {@code policy.PolicyRule} + * Protobuf type {@code policy.PolicyRuleDevice} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements - // @@protoc_insertion_point(builder_implements:policy.PolicyRule) - policy.Policy.PolicyRuleOrBuilder { + // @@protoc_insertion_point(builder_implements:policy.PolicyRuleDevice) + policy.Policy.PolicyRuleDeviceOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return policy.Policy.internal_static_policy_PolicyRule_descriptor; + return policy.Policy.internal_static_policy_PolicyRuleDevice_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return policy.Policy.internal_static_policy_PolicyRule_fieldAccessorTable + return policy.Policy.internal_static_policy_PolicyRuleDevice_fieldAccessorTable .ensureFieldAccessorsInitialized( - policy.Policy.PolicyRule.class, policy.Policy.PolicyRule.Builder.class); + policy.Policy.PolicyRuleDevice.class, policy.Policy.PolicyRuleDevice.Builder.class); } - // Construct using policy.Policy.PolicyRule.newBuilder() + // Construct using policy.Policy.PolicyRuleDevice.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -6082,52 +5391,21 @@ public final class Policy { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { - getPolRuleConditionListFieldBuilder(); - getPolRuleActionListFieldBuilder(); - getServiceListFieldBuilder(); getDeviceListFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (policyRuleIdBuilder_ == null) { - policyRuleId_ = null; - } else { - policyRuleId_ = null; - policyRuleIdBuilder_ = null; - } - policyRuleType_ = 0; - - policyRulePriority_ = 0; - - if (eventBuilder_ == null) { - event_ = null; - } else { - event_ = null; - eventBuilder_ = null; - } - if (polRuleConditionListBuilder_ == null) { - polRuleConditionList_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - polRuleConditionListBuilder_.clear(); - } - if (polRuleActionListBuilder_ == null) { - polRuleActionList_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - polRuleActionListBuilder_.clear(); - } - if (serviceListBuilder_ == null) { - serviceList_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); + if (policyRuleBasicBuilder_ == null) { + policyRuleBasic_ = null; } else { - serviceListBuilder_.clear(); + policyRuleBasic_ = null; + policyRuleBasicBuilder_ = null; } if (deviceListBuilder_ == null) { deviceList_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000001); } else { deviceListBuilder_.clear(); } @@ -6137,17 +5415,17 @@ public final class Policy { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return policy.Policy.internal_static_policy_PolicyRule_descriptor; + return policy.Policy.internal_static_policy_PolicyRuleDevice_descriptor; } @java.lang.Override - public policy.Policy.PolicyRule getDefaultInstanceForType() { - return policy.Policy.PolicyRule.getDefaultInstance(); + public policy.Policy.PolicyRuleDevice getDefaultInstanceForType() { + return policy.Policy.PolicyRuleDevice.getDefaultInstance(); } @java.lang.Override - public policy.Policy.PolicyRule build() { - policy.Policy.PolicyRule result = buildPartial(); + public policy.Policy.PolicyRuleDevice build() { + policy.Policy.PolicyRuleDevice result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -6155,52 +5433,18 @@ public final class Policy { } @java.lang.Override - public policy.Policy.PolicyRule buildPartial() { - policy.Policy.PolicyRule result = new policy.Policy.PolicyRule(this); + public policy.Policy.PolicyRuleDevice buildPartial() { + policy.Policy.PolicyRuleDevice result = new policy.Policy.PolicyRuleDevice(this); int from_bitField0_ = bitField0_; - if (policyRuleIdBuilder_ == null) { - result.policyRuleId_ = policyRuleId_; - } else { - result.policyRuleId_ = policyRuleIdBuilder_.build(); - } - result.policyRuleType_ = policyRuleType_; - result.policyRulePriority_ = policyRulePriority_; - if (eventBuilder_ == null) { - result.event_ = event_; - } else { - result.event_ = eventBuilder_.build(); - } - if (polRuleConditionListBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - polRuleConditionList_ = java.util.Collections.unmodifiableList(polRuleConditionList_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.polRuleConditionList_ = polRuleConditionList_; - } else { - result.polRuleConditionList_ = polRuleConditionListBuilder_.build(); - } - if (polRuleActionListBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - polRuleActionList_ = java.util.Collections.unmodifiableList(polRuleActionList_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.polRuleActionList_ = polRuleActionList_; - } else { - result.polRuleActionList_ = polRuleActionListBuilder_.build(); - } - if (serviceListBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0)) { - serviceList_ = java.util.Collections.unmodifiableList(serviceList_); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.serviceList_ = serviceList_; + if (policyRuleBasicBuilder_ == null) { + result.policyRuleBasic_ = policyRuleBasic_; } else { - result.serviceList_ = serviceListBuilder_.build(); + result.policyRuleBasic_ = policyRuleBasicBuilder_.build(); } if (deviceListBuilder_ == null) { - if (((bitField0_ & 0x00000008) != 0)) { + if (((bitField0_ & 0x00000001) != 0)) { deviceList_ = java.util.Collections.unmodifiableList(deviceList_); - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000001); } result.deviceList_ = deviceList_; } else { @@ -6234,121 +5478,34 @@ public final class Policy { public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof policy.Policy.PolicyRule) { - return mergeFrom((policy.Policy.PolicyRule)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(policy.Policy.PolicyRule other) { - if (other == policy.Policy.PolicyRule.getDefaultInstance()) return this; - if (other.hasPolicyRuleId()) { - mergePolicyRuleId(other.getPolicyRuleId()); - } - if (other.policyRuleType_ != 0) { - setPolicyRuleTypeValue(other.getPolicyRuleTypeValue()); - } - if (other.getPolicyRulePriority() != 0) { - setPolicyRulePriority(other.getPolicyRulePriority()); - } - if (other.hasEvent()) { - mergeEvent(other.getEvent()); - } - if (polRuleConditionListBuilder_ == null) { - if (!other.polRuleConditionList_.isEmpty()) { - if (polRuleConditionList_.isEmpty()) { - polRuleConditionList_ = other.polRuleConditionList_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensurePolRuleConditionListIsMutable(); - polRuleConditionList_.addAll(other.polRuleConditionList_); - } - onChanged(); - } - } else { - if (!other.polRuleConditionList_.isEmpty()) { - if (polRuleConditionListBuilder_.isEmpty()) { - polRuleConditionListBuilder_.dispose(); - polRuleConditionListBuilder_ = null; - polRuleConditionList_ = other.polRuleConditionList_; - bitField0_ = (bitField0_ & ~0x00000001); - polRuleConditionListBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getPolRuleConditionListFieldBuilder() : null; - } else { - polRuleConditionListBuilder_.addAllMessages(other.polRuleConditionList_); - } - } - } - if (polRuleActionListBuilder_ == null) { - if (!other.polRuleActionList_.isEmpty()) { - if (polRuleActionList_.isEmpty()) { - polRuleActionList_ = other.polRuleActionList_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensurePolRuleActionListIsMutable(); - polRuleActionList_.addAll(other.polRuleActionList_); - } - onChanged(); - } + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof policy.Policy.PolicyRuleDevice) { + return mergeFrom((policy.Policy.PolicyRuleDevice)other); } else { - if (!other.polRuleActionList_.isEmpty()) { - if (polRuleActionListBuilder_.isEmpty()) { - polRuleActionListBuilder_.dispose(); - polRuleActionListBuilder_ = null; - polRuleActionList_ = other.polRuleActionList_; - bitField0_ = (bitField0_ & ~0x00000002); - polRuleActionListBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getPolRuleActionListFieldBuilder() : null; - } else { - polRuleActionListBuilder_.addAllMessages(other.polRuleActionList_); - } - } + super.mergeFrom(other); + return this; } - if (serviceListBuilder_ == null) { - if (!other.serviceList_.isEmpty()) { - if (serviceList_.isEmpty()) { - serviceList_ = other.serviceList_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureServiceListIsMutable(); - serviceList_.addAll(other.serviceList_); - } - onChanged(); - } - } else { - if (!other.serviceList_.isEmpty()) { - if (serviceListBuilder_.isEmpty()) { - serviceListBuilder_.dispose(); - serviceListBuilder_ = null; - serviceList_ = other.serviceList_; - bitField0_ = (bitField0_ & ~0x00000004); - serviceListBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getServiceListFieldBuilder() : null; - } else { - serviceListBuilder_.addAllMessages(other.serviceList_); - } - } + } + + public Builder mergeFrom(policy.Policy.PolicyRuleDevice other) { + if (other == policy.Policy.PolicyRuleDevice.getDefaultInstance()) return this; + if (other.hasPolicyRuleBasic()) { + mergePolicyRuleBasic(other.getPolicyRuleBasic()); } if (deviceListBuilder_ == null) { if (!other.deviceList_.isEmpty()) { if (deviceList_.isEmpty()) { deviceList_ = other.deviceList_; - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000001); } else { ensureDeviceListIsMutable(); deviceList_.addAll(other.deviceList_); @@ -6361,7 +5518,7 @@ public final class Policy { deviceListBuilder_.dispose(); deviceListBuilder_ = null; deviceList_ = other.deviceList_; - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000001); deviceListBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getDeviceListFieldBuilder() : null; @@ -6385,11 +5542,11 @@ public final class Policy { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - policy.Policy.PolicyRule parsedMessage = null; + policy.Policy.PolicyRuleDevice parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (policy.Policy.PolicyRule) e.getUnfinishedMessage(); + parsedMessage = (policy.Policy.PolicyRuleDevice) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -6400,1575 +5557,2073 @@ public final class Policy { } private int bitField0_; - private policy.Policy.PolicyRuleId policyRuleId_; + private policy.Policy.PolicyRuleBasic policyRuleBasic_; private com.google.protobuf.SingleFieldBuilderV3< - policy.Policy.PolicyRuleId, policy.Policy.PolicyRuleId.Builder, policy.Policy.PolicyRuleIdOrBuilder> policyRuleIdBuilder_; + policy.Policy.PolicyRuleBasic, policy.Policy.PolicyRuleBasic.Builder, policy.Policy.PolicyRuleBasicOrBuilder> policyRuleBasicBuilder_; /** * <pre> * Basic policy rule attributes * </pre> * - * <code>.policy.PolicyRuleId policyRuleId = 1;</code> - * @return Whether the policyRuleId field is set. + * <code>.policy.PolicyRuleBasic policyRuleBasic = 1;</code> + * @return Whether the policyRuleBasic field is set. */ - public boolean hasPolicyRuleId() { - return policyRuleIdBuilder_ != null || policyRuleId_ != null; + public boolean hasPolicyRuleBasic() { + return policyRuleBasicBuilder_ != null || policyRuleBasic_ != null; } /** * <pre> * Basic policy rule attributes * </pre> * - * <code>.policy.PolicyRuleId policyRuleId = 1;</code> - * @return The policyRuleId. + * <code>.policy.PolicyRuleBasic policyRuleBasic = 1;</code> + * @return The policyRuleBasic. */ - public policy.Policy.PolicyRuleId getPolicyRuleId() { - if (policyRuleIdBuilder_ == null) { - return policyRuleId_ == null ? policy.Policy.PolicyRuleId.getDefaultInstance() : policyRuleId_; + public policy.Policy.PolicyRuleBasic getPolicyRuleBasic() { + if (policyRuleBasicBuilder_ == null) { + return policyRuleBasic_ == null ? policy.Policy.PolicyRuleBasic.getDefaultInstance() : policyRuleBasic_; + } else { + return policyRuleBasicBuilder_.getMessage(); + } + } + /** + * <pre> + * Basic policy rule attributes + * </pre> + * + * <code>.policy.PolicyRuleBasic policyRuleBasic = 1;</code> + */ + public Builder setPolicyRuleBasic(policy.Policy.PolicyRuleBasic value) { + if (policyRuleBasicBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + policyRuleBasic_ = value; + onChanged(); + } else { + policyRuleBasicBuilder_.setMessage(value); + } + + return this; + } + /** + * <pre> + * Basic policy rule attributes + * </pre> + * + * <code>.policy.PolicyRuleBasic policyRuleBasic = 1;</code> + */ + public Builder setPolicyRuleBasic( + policy.Policy.PolicyRuleBasic.Builder builderForValue) { + if (policyRuleBasicBuilder_ == null) { + policyRuleBasic_ = builderForValue.build(); + onChanged(); + } else { + policyRuleBasicBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * <pre> + * Basic policy rule attributes + * </pre> + * + * <code>.policy.PolicyRuleBasic policyRuleBasic = 1;</code> + */ + public Builder mergePolicyRuleBasic(policy.Policy.PolicyRuleBasic value) { + if (policyRuleBasicBuilder_ == null) { + if (policyRuleBasic_ != null) { + policyRuleBasic_ = + policy.Policy.PolicyRuleBasic.newBuilder(policyRuleBasic_).mergeFrom(value).buildPartial(); + } else { + policyRuleBasic_ = value; + } + onChanged(); + } else { + policyRuleBasicBuilder_.mergeFrom(value); + } + + return this; + } + /** + * <pre> + * Basic policy rule attributes + * </pre> + * + * <code>.policy.PolicyRuleBasic policyRuleBasic = 1;</code> + */ + public Builder clearPolicyRuleBasic() { + if (policyRuleBasicBuilder_ == null) { + policyRuleBasic_ = null; + onChanged(); + } else { + policyRuleBasic_ = null; + policyRuleBasicBuilder_ = null; + } + + return this; + } + /** + * <pre> + * Basic policy rule attributes + * </pre> + * + * <code>.policy.PolicyRuleBasic policyRuleBasic = 1;</code> + */ + public policy.Policy.PolicyRuleBasic.Builder getPolicyRuleBasicBuilder() { + + onChanged(); + return getPolicyRuleBasicFieldBuilder().getBuilder(); + } + /** + * <pre> + * Basic policy rule attributes + * </pre> + * + * <code>.policy.PolicyRuleBasic policyRuleBasic = 1;</code> + */ + public policy.Policy.PolicyRuleBasicOrBuilder getPolicyRuleBasicOrBuilder() { + if (policyRuleBasicBuilder_ != null) { + return policyRuleBasicBuilder_.getMessageOrBuilder(); + } else { + return policyRuleBasic_ == null ? + policy.Policy.PolicyRuleBasic.getDefaultInstance() : policyRuleBasic_; + } + } + /** + * <pre> + * Basic policy rule attributes + * </pre> + * + * <code>.policy.PolicyRuleBasic policyRuleBasic = 1;</code> + */ + private com.google.protobuf.SingleFieldBuilderV3< + policy.Policy.PolicyRuleBasic, policy.Policy.PolicyRuleBasic.Builder, policy.Policy.PolicyRuleBasicOrBuilder> + getPolicyRuleBasicFieldBuilder() { + if (policyRuleBasicBuilder_ == null) { + policyRuleBasicBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + policy.Policy.PolicyRuleBasic, policy.Policy.PolicyRuleBasic.Builder, policy.Policy.PolicyRuleBasicOrBuilder>( + getPolicyRuleBasic(), + getParentForChildren(), + isClean()); + policyRuleBasic_ = null; + } + return policyRuleBasicBuilder_; + } + + private java.util.List<context.ContextOuterClass.DeviceId> deviceList_ = + java.util.Collections.emptyList(); + private void ensureDeviceListIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + deviceList_ = new java.util.ArrayList<context.ContextOuterClass.DeviceId>(deviceList_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> deviceListBuilder_; + + /** + * <pre> + * Affected device(s) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 2;</code> + */ + public java.util.List<context.ContextOuterClass.DeviceId> getDeviceListList() { + if (deviceListBuilder_ == null) { + return java.util.Collections.unmodifiableList(deviceList_); + } else { + return deviceListBuilder_.getMessageList(); + } + } + /** + * <pre> + * Affected device(s) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 2;</code> + */ + public int getDeviceListCount() { + if (deviceListBuilder_ == null) { + return deviceList_.size(); + } else { + return deviceListBuilder_.getCount(); + } + } + /** + * <pre> + * Affected device(s) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 2;</code> + */ + public context.ContextOuterClass.DeviceId getDeviceList(int index) { + if (deviceListBuilder_ == null) { + return deviceList_.get(index); + } else { + return deviceListBuilder_.getMessage(index); + } + } + /** + * <pre> + * Affected device(s) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 2;</code> + */ + public Builder setDeviceList( + int index, context.ContextOuterClass.DeviceId value) { + if (deviceListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeviceListIsMutable(); + deviceList_.set(index, value); + onChanged(); + } else { + deviceListBuilder_.setMessage(index, value); + } + return this; + } + /** + * <pre> + * Affected device(s) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 2;</code> + */ + public Builder setDeviceList( + int index, context.ContextOuterClass.DeviceId.Builder builderForValue) { + if (deviceListBuilder_ == null) { + ensureDeviceListIsMutable(); + deviceList_.set(index, builderForValue.build()); + onChanged(); + } else { + deviceListBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * <pre> + * Affected device(s) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 2;</code> + */ + public Builder addDeviceList(context.ContextOuterClass.DeviceId value) { + if (deviceListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeviceListIsMutable(); + deviceList_.add(value); + onChanged(); + } else { + deviceListBuilder_.addMessage(value); + } + return this; + } + /** + * <pre> + * Affected device(s) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 2;</code> + */ + public Builder addDeviceList( + int index, context.ContextOuterClass.DeviceId value) { + if (deviceListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeviceListIsMutable(); + deviceList_.add(index, value); + onChanged(); + } else { + deviceListBuilder_.addMessage(index, value); + } + return this; + } + /** + * <pre> + * Affected device(s) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 2;</code> + */ + public Builder addDeviceList( + context.ContextOuterClass.DeviceId.Builder builderForValue) { + if (deviceListBuilder_ == null) { + ensureDeviceListIsMutable(); + deviceList_.add(builderForValue.build()); + onChanged(); } else { - return policyRuleIdBuilder_.getMessage(); + deviceListBuilder_.addMessage(builderForValue.build()); } + return this; } /** * <pre> - * Basic policy rule attributes + * Affected device(s) * </pre> * - * <code>.policy.PolicyRuleId policyRuleId = 1;</code> + * <code>repeated .context.DeviceId deviceList = 2;</code> */ - public Builder setPolicyRuleId(policy.Policy.PolicyRuleId value) { - if (policyRuleIdBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - policyRuleId_ = value; + public Builder addDeviceList( + int index, context.ContextOuterClass.DeviceId.Builder builderForValue) { + if (deviceListBuilder_ == null) { + ensureDeviceListIsMutable(); + deviceList_.add(index, builderForValue.build()); onChanged(); } else { - policyRuleIdBuilder_.setMessage(value); + deviceListBuilder_.addMessage(index, builderForValue.build()); } - return this; } /** * <pre> - * Basic policy rule attributes + * Affected device(s) * </pre> * - * <code>.policy.PolicyRuleId policyRuleId = 1;</code> + * <code>repeated .context.DeviceId deviceList = 2;</code> */ - public Builder setPolicyRuleId( - policy.Policy.PolicyRuleId.Builder builderForValue) { - if (policyRuleIdBuilder_ == null) { - policyRuleId_ = builderForValue.build(); + public Builder addAllDeviceList( + java.lang.Iterable<? extends context.ContextOuterClass.DeviceId> values) { + if (deviceListBuilder_ == null) { + ensureDeviceListIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, deviceList_); onChanged(); } else { - policyRuleIdBuilder_.setMessage(builderForValue.build()); + deviceListBuilder_.addAllMessages(values); } - return this; } /** * <pre> - * Basic policy rule attributes + * Affected device(s) * </pre> * - * <code>.policy.PolicyRuleId policyRuleId = 1;</code> + * <code>repeated .context.DeviceId deviceList = 2;</code> */ - public Builder mergePolicyRuleId(policy.Policy.PolicyRuleId value) { - if (policyRuleIdBuilder_ == null) { - if (policyRuleId_ != null) { - policyRuleId_ = - policy.Policy.PolicyRuleId.newBuilder(policyRuleId_).mergeFrom(value).buildPartial(); - } else { - policyRuleId_ = value; - } + public Builder clearDeviceList() { + if (deviceListBuilder_ == null) { + deviceList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { - policyRuleIdBuilder_.mergeFrom(value); + deviceListBuilder_.clear(); } - return this; } /** * <pre> - * Basic policy rule attributes + * Affected device(s) * </pre> * - * <code>.policy.PolicyRuleId policyRuleId = 1;</code> + * <code>repeated .context.DeviceId deviceList = 2;</code> */ - public Builder clearPolicyRuleId() { - if (policyRuleIdBuilder_ == null) { - policyRuleId_ = null; + public Builder removeDeviceList(int index) { + if (deviceListBuilder_ == null) { + ensureDeviceListIsMutable(); + deviceList_.remove(index); onChanged(); } else { - policyRuleId_ = null; - policyRuleIdBuilder_ = null; + deviceListBuilder_.remove(index); } - return this; } /** * <pre> - * Basic policy rule attributes + * Affected device(s) * </pre> * - * <code>.policy.PolicyRuleId policyRuleId = 1;</code> + * <code>repeated .context.DeviceId deviceList = 2;</code> */ - public policy.Policy.PolicyRuleId.Builder getPolicyRuleIdBuilder() { - - onChanged(); - return getPolicyRuleIdFieldBuilder().getBuilder(); + public context.ContextOuterClass.DeviceId.Builder getDeviceListBuilder( + int index) { + return getDeviceListFieldBuilder().getBuilder(index); } /** * <pre> - * Basic policy rule attributes + * Affected device(s) * </pre> * - * <code>.policy.PolicyRuleId policyRuleId = 1;</code> + * <code>repeated .context.DeviceId deviceList = 2;</code> */ - public policy.Policy.PolicyRuleIdOrBuilder getPolicyRuleIdOrBuilder() { - if (policyRuleIdBuilder_ != null) { - return policyRuleIdBuilder_.getMessageOrBuilder(); - } else { - return policyRuleId_ == null ? - policy.Policy.PolicyRuleId.getDefaultInstance() : policyRuleId_; + public context.ContextOuterClass.DeviceIdOrBuilder getDeviceListOrBuilder( + int index) { + if (deviceListBuilder_ == null) { + return deviceList_.get(index); } else { + return deviceListBuilder_.getMessageOrBuilder(index); } } /** * <pre> - * Basic policy rule attributes + * Affected device(s) * </pre> * - * <code>.policy.PolicyRuleId policyRuleId = 1;</code> + * <code>repeated .context.DeviceId deviceList = 2;</code> */ - private com.google.protobuf.SingleFieldBuilderV3< - policy.Policy.PolicyRuleId, policy.Policy.PolicyRuleId.Builder, policy.Policy.PolicyRuleIdOrBuilder> - getPolicyRuleIdFieldBuilder() { - if (policyRuleIdBuilder_ == null) { - policyRuleIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - policy.Policy.PolicyRuleId, policy.Policy.PolicyRuleId.Builder, policy.Policy.PolicyRuleIdOrBuilder>( - getPolicyRuleId(), - getParentForChildren(), - isClean()); - policyRuleId_ = null; + public java.util.List<? extends context.ContextOuterClass.DeviceIdOrBuilder> + getDeviceListOrBuilderList() { + if (deviceListBuilder_ != null) { + return deviceListBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(deviceList_); } - return policyRuleIdBuilder_; } - - private int policyRuleType_ = 0; /** - * <code>.policy.PolicyRuleType policyRuleType = 2;</code> - * @return The enum numeric value on the wire for policyRuleType. + * <pre> + * Affected device(s) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 2;</code> */ - @java.lang.Override public int getPolicyRuleTypeValue() { - return policyRuleType_; + public context.ContextOuterClass.DeviceId.Builder addDeviceListBuilder() { + return getDeviceListFieldBuilder().addBuilder( + context.ContextOuterClass.DeviceId.getDefaultInstance()); } /** - * <code>.policy.PolicyRuleType policyRuleType = 2;</code> - * @param value The enum numeric value on the wire for policyRuleType to set. - * @return This builder for chaining. + * <pre> + * Affected device(s) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 2;</code> */ - public Builder setPolicyRuleTypeValue(int value) { - - policyRuleType_ = value; - onChanged(); - return this; + public context.ContextOuterClass.DeviceId.Builder addDeviceListBuilder( + int index) { + return getDeviceListFieldBuilder().addBuilder( + index, context.ContextOuterClass.DeviceId.getDefaultInstance()); } /** - * <code>.policy.PolicyRuleType policyRuleType = 2;</code> - * @return The policyRuleType. + * <pre> + * Affected device(s) + * </pre> + * + * <code>repeated .context.DeviceId deviceList = 2;</code> */ + public java.util.List<context.ContextOuterClass.DeviceId.Builder> + getDeviceListBuilderList() { + return getDeviceListFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> + getDeviceListFieldBuilder() { + if (deviceListBuilder_ == null) { + deviceListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder>( + deviceList_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + deviceList_ = null; + } + return deviceListBuilder_; + } @java.lang.Override - public policy.Policy.PolicyRuleType getPolicyRuleType() { - @SuppressWarnings("deprecation") - policy.Policy.PolicyRuleType result = policy.Policy.PolicyRuleType.valueOf(policyRuleType_); - return result == null ? policy.Policy.PolicyRuleType.UNRECOGNIZED : result; + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); } - /** - * <code>.policy.PolicyRuleType policyRuleType = 2;</code> - * @param value The policyRuleType to set. - * @return This builder for chaining. - */ - public Builder setPolicyRuleType(policy.Policy.PolicyRuleType value) { - if (value == null) { - throw new NullPointerException(); + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:policy.PolicyRuleDevice) + } + + // @@protoc_insertion_point(class_scope:policy.PolicyRuleDevice) + private static final policy.Policy.PolicyRuleDevice DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new policy.Policy.PolicyRuleDevice(); + } + + public static policy.Policy.PolicyRuleDevice getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<PolicyRuleDevice> + PARSER = new com.google.protobuf.AbstractParser<PolicyRuleDevice>() { + @java.lang.Override + public PolicyRuleDevice parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PolicyRuleDevice(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<PolicyRuleDevice> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<PolicyRuleDevice> getParserForType() { + return PARSER; + } + + @java.lang.Override + public policy.Policy.PolicyRuleDevice getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface PolicyRuleIdListOrBuilder extends + // @@protoc_insertion_point(interface_extends:policy.PolicyRuleIdList) + com.google.protobuf.MessageOrBuilder { + + /** + * <code>repeated .policy.PolicyRuleId policyRuleIdList = 1;</code> + */ + java.util.List<policy.Policy.PolicyRuleId> + getPolicyRuleIdListList(); + /** + * <code>repeated .policy.PolicyRuleId policyRuleIdList = 1;</code> + */ + policy.Policy.PolicyRuleId getPolicyRuleIdList(int index); + /** + * <code>repeated .policy.PolicyRuleId policyRuleIdList = 1;</code> + */ + int getPolicyRuleIdListCount(); + /** + * <code>repeated .policy.PolicyRuleId policyRuleIdList = 1;</code> + */ + java.util.List<? extends policy.Policy.PolicyRuleIdOrBuilder> + getPolicyRuleIdListOrBuilderList(); + /** + * <code>repeated .policy.PolicyRuleId policyRuleIdList = 1;</code> + */ + policy.Policy.PolicyRuleIdOrBuilder getPolicyRuleIdListOrBuilder( + int index); + } + /** + * <pre> + * A list of policy rule IDs + * </pre> + * + * Protobuf type {@code policy.PolicyRuleIdList} + */ + public static final class PolicyRuleIdList extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:policy.PolicyRuleIdList) + PolicyRuleIdListOrBuilder { + private static final long serialVersionUID = 0L; + // Use PolicyRuleIdList.newBuilder() to construct. + private PolicyRuleIdList(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private PolicyRuleIdList() { + policyRuleIdList_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new PolicyRuleIdList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private PolicyRuleIdList( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + policyRuleIdList_ = new java.util.ArrayList<policy.Policy.PolicyRuleId>(); + mutable_bitField0_ |= 0x00000001; + } + policyRuleIdList_.add( + input.readMessage(policy.Policy.PolicyRuleId.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } } - - policyRuleType_ = value.getNumber(); - onChanged(); - return this; - } - /** - * <code>.policy.PolicyRuleType policyRuleType = 2;</code> - * @return This builder for chaining. - */ - public Builder clearPolicyRuleType() { - - policyRuleType_ = 0; - onChanged(); - return this; + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + policyRuleIdList_ = java.util.Collections.unmodifiableList(policyRuleIdList_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return policy.Policy.internal_static_policy_PolicyRuleIdList_descriptor; + } - private int policyRulePriority_ ; - /** - * <code>uint32 PolicyRulePriority = 3;</code> - * @return The policyRulePriority. - */ - @java.lang.Override - public int getPolicyRulePriority() { - return policyRulePriority_; - } - /** - * <code>uint32 PolicyRulePriority = 3;</code> - * @param value The policyRulePriority to set. - * @return This builder for chaining. - */ - public Builder setPolicyRulePriority(int value) { - - policyRulePriority_ = value; - onChanged(); - return this; - } - /** - * <code>uint32 PolicyRulePriority = 3;</code> - * @return This builder for chaining. - */ - public Builder clearPolicyRulePriority() { - - policyRulePriority_ = 0; - onChanged(); - return this; - } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return policy.Policy.internal_static_policy_PolicyRuleIdList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + policy.Policy.PolicyRuleIdList.class, policy.Policy.PolicyRuleIdList.Builder.class); + } - private policy.Policy.PolicyRuleEvent event_; - private com.google.protobuf.SingleFieldBuilderV3< - policy.Policy.PolicyRuleEvent, policy.Policy.PolicyRuleEvent.Builder, policy.Policy.PolicyRuleEventOrBuilder> eventBuilder_; - /** - * <pre> - * Event-Condition-Action model - * </pre> - * - * <code>.policy.PolicyRuleEvent event = 4;</code> - * @return Whether the event field is set. - */ - public boolean hasEvent() { - return eventBuilder_ != null || event_ != null; - } - /** - * <pre> - * Event-Condition-Action model - * </pre> - * - * <code>.policy.PolicyRuleEvent event = 4;</code> - * @return The event. - */ - public policy.Policy.PolicyRuleEvent getEvent() { - if (eventBuilder_ == null) { - return event_ == null ? policy.Policy.PolicyRuleEvent.getDefaultInstance() : event_; - } else { - return eventBuilder_.getMessage(); - } - } - /** - * <pre> - * Event-Condition-Action model - * </pre> - * - * <code>.policy.PolicyRuleEvent event = 4;</code> - */ - public Builder setEvent(policy.Policy.PolicyRuleEvent value) { - if (eventBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - event_ = value; - onChanged(); - } else { - eventBuilder_.setMessage(value); - } + public static final int POLICYRULEIDLIST_FIELD_NUMBER = 1; + private java.util.List<policy.Policy.PolicyRuleId> policyRuleIdList_; + /** + * <code>repeated .policy.PolicyRuleId policyRuleIdList = 1;</code> + */ + @java.lang.Override + public java.util.List<policy.Policy.PolicyRuleId> getPolicyRuleIdListList() { + return policyRuleIdList_; + } + /** + * <code>repeated .policy.PolicyRuleId policyRuleIdList = 1;</code> + */ + @java.lang.Override + public java.util.List<? extends policy.Policy.PolicyRuleIdOrBuilder> + getPolicyRuleIdListOrBuilderList() { + return policyRuleIdList_; + } + /** + * <code>repeated .policy.PolicyRuleId policyRuleIdList = 1;</code> + */ + @java.lang.Override + public int getPolicyRuleIdListCount() { + return policyRuleIdList_.size(); + } + /** + * <code>repeated .policy.PolicyRuleId policyRuleIdList = 1;</code> + */ + @java.lang.Override + public policy.Policy.PolicyRuleId getPolicyRuleIdList(int index) { + return policyRuleIdList_.get(index); + } + /** + * <code>repeated .policy.PolicyRuleId policyRuleIdList = 1;</code> + */ + @java.lang.Override + public policy.Policy.PolicyRuleIdOrBuilder getPolicyRuleIdListOrBuilder( + int index) { + return policyRuleIdList_.get(index); + } - return this; - } - /** - * <pre> - * Event-Condition-Action model - * </pre> - * - * <code>.policy.PolicyRuleEvent event = 4;</code> - */ - public Builder setEvent( - policy.Policy.PolicyRuleEvent.Builder builderForValue) { - if (eventBuilder_ == null) { - event_ = builderForValue.build(); - onChanged(); - } else { - eventBuilder_.setMessage(builderForValue.build()); - } + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; - return this; + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < policyRuleIdList_.size(); i++) { + output.writeMessage(1, policyRuleIdList_.get(i)); } - /** - * <pre> - * Event-Condition-Action model - * </pre> - * - * <code>.policy.PolicyRuleEvent event = 4;</code> - */ - public Builder mergeEvent(policy.Policy.PolicyRuleEvent value) { - if (eventBuilder_ == null) { - if (event_ != null) { - event_ = - policy.Policy.PolicyRuleEvent.newBuilder(event_).mergeFrom(value).buildPartial(); - } else { - event_ = value; - } - onChanged(); - } else { - eventBuilder_.mergeFrom(value); - } + unknownFields.writeTo(output); + } - return this; + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < policyRuleIdList_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, policyRuleIdList_.get(i)); } - /** - * <pre> - * Event-Condition-Action model - * </pre> - * - * <code>.policy.PolicyRuleEvent event = 4;</code> - */ - public Builder clearEvent() { - if (eventBuilder_ == null) { - event_ = null; - onChanged(); - } else { - event_ = null; - eventBuilder_ = null; - } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } - return this; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; } - /** - * <pre> - * Event-Condition-Action model - * </pre> - * - * <code>.policy.PolicyRuleEvent event = 4;</code> - */ - public policy.Policy.PolicyRuleEvent.Builder getEventBuilder() { - - onChanged(); - return getEventFieldBuilder().getBuilder(); + if (!(obj instanceof policy.Policy.PolicyRuleIdList)) { + return super.equals(obj); } - /** - * <pre> - * Event-Condition-Action model - * </pre> - * - * <code>.policy.PolicyRuleEvent event = 4;</code> - */ - public policy.Policy.PolicyRuleEventOrBuilder getEventOrBuilder() { - if (eventBuilder_ != null) { - return eventBuilder_.getMessageOrBuilder(); - } else { - return event_ == null ? - policy.Policy.PolicyRuleEvent.getDefaultInstance() : event_; - } + policy.Policy.PolicyRuleIdList other = (policy.Policy.PolicyRuleIdList) obj; + + if (!getPolicyRuleIdListList() + .equals(other.getPolicyRuleIdListList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; } - /** - * <pre> - * Event-Condition-Action model - * </pre> - * - * <code>.policy.PolicyRuleEvent event = 4;</code> - */ - private com.google.protobuf.SingleFieldBuilderV3< - policy.Policy.PolicyRuleEvent, policy.Policy.PolicyRuleEvent.Builder, policy.Policy.PolicyRuleEventOrBuilder> - getEventFieldBuilder() { - if (eventBuilder_ == null) { - eventBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - policy.Policy.PolicyRuleEvent, policy.Policy.PolicyRuleEvent.Builder, policy.Policy.PolicyRuleEventOrBuilder>( - getEvent(), - getParentForChildren(), - isClean()); - event_ = null; - } - return eventBuilder_; + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getPolicyRuleIdListCount() > 0) { + hash = (37 * hash) + POLICYRULEIDLIST_FIELD_NUMBER; + hash = (53 * hash) + getPolicyRuleIdListList().hashCode(); } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static policy.Policy.PolicyRuleIdList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static policy.Policy.PolicyRuleIdList parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static policy.Policy.PolicyRuleIdList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static policy.Policy.PolicyRuleIdList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static policy.Policy.PolicyRuleIdList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static policy.Policy.PolicyRuleIdList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static policy.Policy.PolicyRuleIdList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static policy.Policy.PolicyRuleIdList parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static policy.Policy.PolicyRuleIdList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static policy.Policy.PolicyRuleIdList parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static policy.Policy.PolicyRuleIdList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static policy.Policy.PolicyRuleIdList parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } - private java.util.List<policy.Policy.PolicyRuleCondition> polRuleConditionList_ = - java.util.Collections.emptyList(); - private void ensurePolRuleConditionListIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - polRuleConditionList_ = new java.util.ArrayList<policy.Policy.PolicyRuleCondition>(polRuleConditionList_); - bitField0_ |= 0x00000001; - } + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(policy.Policy.PolicyRuleIdList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * <pre> + * A list of policy rule IDs + * </pre> + * + * Protobuf type {@code policy.PolicyRuleIdList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:policy.PolicyRuleIdList) + policy.Policy.PolicyRuleIdListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return policy.Policy.internal_static_policy_PolicyRuleIdList_descriptor; } - private com.google.protobuf.RepeatedFieldBuilderV3< - policy.Policy.PolicyRuleCondition, policy.Policy.PolicyRuleCondition.Builder, policy.Policy.PolicyRuleConditionOrBuilder> polRuleConditionListBuilder_; + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return policy.Policy.internal_static_policy_PolicyRuleIdList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + policy.Policy.PolicyRuleIdList.class, policy.Policy.PolicyRuleIdList.Builder.class); + } - /** - * <pre> - * One or more conditions must be met - * </pre> - * - * <code>repeated .policy.PolicyRuleCondition polRuleConditionList = 5;</code> - */ - public java.util.List<policy.Policy.PolicyRuleCondition> getPolRuleConditionListList() { - if (polRuleConditionListBuilder_ == null) { - return java.util.Collections.unmodifiableList(polRuleConditionList_); - } else { - return polRuleConditionListBuilder_.getMessageList(); - } + // Construct using policy.Policy.PolicyRuleIdList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); } - /** - * <pre> - * One or more conditions must be met - * </pre> - * - * <code>repeated .policy.PolicyRuleCondition polRuleConditionList = 5;</code> - */ - public int getPolRuleConditionListCount() { - if (polRuleConditionListBuilder_ == null) { - return polRuleConditionList_.size(); - } else { - return polRuleConditionListBuilder_.getCount(); - } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); } - /** - * <pre> - * One or more conditions must be met - * </pre> - * - * <code>repeated .policy.PolicyRuleCondition polRuleConditionList = 5;</code> - */ - public policy.Policy.PolicyRuleCondition getPolRuleConditionList(int index) { - if (polRuleConditionListBuilder_ == null) { - return polRuleConditionList_.get(index); - } else { - return polRuleConditionListBuilder_.getMessage(index); + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getPolicyRuleIdListFieldBuilder(); } } - /** - * <pre> - * One or more conditions must be met - * </pre> - * - * <code>repeated .policy.PolicyRuleCondition polRuleConditionList = 5;</code> - */ - public Builder setPolRuleConditionList( - int index, policy.Policy.PolicyRuleCondition value) { - if (polRuleConditionListBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePolRuleConditionListIsMutable(); - polRuleConditionList_.set(index, value); - onChanged(); + @java.lang.Override + public Builder clear() { + super.clear(); + if (policyRuleIdListBuilder_ == null) { + policyRuleIdList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); } else { - polRuleConditionListBuilder_.setMessage(index, value); + policyRuleIdListBuilder_.clear(); } return this; } - /** - * <pre> - * One or more conditions must be met - * </pre> - * - * <code>repeated .policy.PolicyRuleCondition polRuleConditionList = 5;</code> - */ - public Builder setPolRuleConditionList( - int index, policy.Policy.PolicyRuleCondition.Builder builderForValue) { - if (polRuleConditionListBuilder_ == null) { - ensurePolRuleConditionListIsMutable(); - polRuleConditionList_.set(index, builderForValue.build()); - onChanged(); - } else { - polRuleConditionListBuilder_.setMessage(index, builderForValue.build()); - } - return this; + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return policy.Policy.internal_static_policy_PolicyRuleIdList_descriptor; } - /** - * <pre> - * One or more conditions must be met - * </pre> - * - * <code>repeated .policy.PolicyRuleCondition polRuleConditionList = 5;</code> - */ - public Builder addPolRuleConditionList(policy.Policy.PolicyRuleCondition value) { - if (polRuleConditionListBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePolRuleConditionListIsMutable(); - polRuleConditionList_.add(value); - onChanged(); - } else { - polRuleConditionListBuilder_.addMessage(value); + + @java.lang.Override + public policy.Policy.PolicyRuleIdList getDefaultInstanceForType() { + return policy.Policy.PolicyRuleIdList.getDefaultInstance(); + } + + @java.lang.Override + public policy.Policy.PolicyRuleIdList build() { + policy.Policy.PolicyRuleIdList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); } - return this; + return result; } - /** - * <pre> - * One or more conditions must be met - * </pre> - * - * <code>repeated .policy.PolicyRuleCondition polRuleConditionList = 5;</code> - */ - public Builder addPolRuleConditionList( - int index, policy.Policy.PolicyRuleCondition value) { - if (polRuleConditionListBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); + + @java.lang.Override + public policy.Policy.PolicyRuleIdList buildPartial() { + policy.Policy.PolicyRuleIdList result = new policy.Policy.PolicyRuleIdList(this); + int from_bitField0_ = bitField0_; + if (policyRuleIdListBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + policyRuleIdList_ = java.util.Collections.unmodifiableList(policyRuleIdList_); + bitField0_ = (bitField0_ & ~0x00000001); } - ensurePolRuleConditionListIsMutable(); - polRuleConditionList_.add(index, value); - onChanged(); + result.policyRuleIdList_ = policyRuleIdList_; } else { - polRuleConditionListBuilder_.addMessage(index, value); + result.policyRuleIdList_ = policyRuleIdListBuilder_.build(); } - return this; + onBuilt(); + return result; } - /** - * <pre> - * One or more conditions must be met - * </pre> - * - * <code>repeated .policy.PolicyRuleCondition polRuleConditionList = 5;</code> - */ - public Builder addPolRuleConditionList( - policy.Policy.PolicyRuleCondition.Builder builderForValue) { - if (polRuleConditionListBuilder_ == null) { - ensurePolRuleConditionListIsMutable(); - polRuleConditionList_.add(builderForValue.build()); - onChanged(); - } else { - polRuleConditionListBuilder_.addMessage(builderForValue.build()); - } - return this; + + @java.lang.Override + public Builder clone() { + return super.clone(); } - /** - * <pre> - * One or more conditions must be met - * </pre> - * - * <code>repeated .policy.PolicyRuleCondition polRuleConditionList = 5;</code> - */ - public Builder addPolRuleConditionList( - int index, policy.Policy.PolicyRuleCondition.Builder builderForValue) { - if (polRuleConditionListBuilder_ == null) { - ensurePolRuleConditionListIsMutable(); - polRuleConditionList_.add(index, builderForValue.build()); - onChanged(); - } else { - polRuleConditionListBuilder_.addMessage(index, builderForValue.build()); - } - return this; + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); } - /** - * <pre> - * One or more conditions must be met - * </pre> - * - * <code>repeated .policy.PolicyRuleCondition polRuleConditionList = 5;</code> - */ - public Builder addAllPolRuleConditionList( - java.lang.Iterable<? extends policy.Policy.PolicyRuleCondition> values) { - if (polRuleConditionListBuilder_ == null) { - ensurePolRuleConditionListIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, polRuleConditionList_); - onChanged(); - } else { - polRuleConditionListBuilder_.addAllMessages(values); - } - return this; + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); } - /** - * <pre> - * One or more conditions must be met - * </pre> - * - * <code>repeated .policy.PolicyRuleCondition polRuleConditionList = 5;</code> - */ - public Builder clearPolRuleConditionList() { - if (polRuleConditionListBuilder_ == null) { - polRuleConditionList_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - polRuleConditionListBuilder_.clear(); - } - return this; + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); } - /** - * <pre> - * One or more conditions must be met - * </pre> - * - * <code>repeated .policy.PolicyRuleCondition polRuleConditionList = 5;</code> - */ - public Builder removePolRuleConditionList(int index) { - if (polRuleConditionListBuilder_ == null) { - ensurePolRuleConditionListIsMutable(); - polRuleConditionList_.remove(index); - onChanged(); - } else { - polRuleConditionListBuilder_.remove(index); - } - return this; + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); } - /** - * <pre> - * One or more conditions must be met - * </pre> - * - * <code>repeated .policy.PolicyRuleCondition polRuleConditionList = 5;</code> - */ - public policy.Policy.PolicyRuleCondition.Builder getPolRuleConditionListBuilder( - int index) { - return getPolRuleConditionListFieldBuilder().getBuilder(index); + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); } - /** - * <pre> - * One or more conditions must be met - * </pre> - * - * <code>repeated .policy.PolicyRuleCondition polRuleConditionList = 5;</code> - */ - public policy.Policy.PolicyRuleConditionOrBuilder getPolRuleConditionListOrBuilder( - int index) { - if (polRuleConditionListBuilder_ == null) { - return polRuleConditionList_.get(index); } else { - return polRuleConditionListBuilder_.getMessageOrBuilder(index); + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof policy.Policy.PolicyRuleIdList) { + return mergeFrom((policy.Policy.PolicyRuleIdList)other); + } else { + super.mergeFrom(other); + return this; } } - /** - * <pre> - * One or more conditions must be met - * </pre> - * - * <code>repeated .policy.PolicyRuleCondition polRuleConditionList = 5;</code> - */ - public java.util.List<? extends policy.Policy.PolicyRuleConditionOrBuilder> - getPolRuleConditionListOrBuilderList() { - if (polRuleConditionListBuilder_ != null) { - return polRuleConditionListBuilder_.getMessageOrBuilderList(); + + public Builder mergeFrom(policy.Policy.PolicyRuleIdList other) { + if (other == policy.Policy.PolicyRuleIdList.getDefaultInstance()) return this; + if (policyRuleIdListBuilder_ == null) { + if (!other.policyRuleIdList_.isEmpty()) { + if (policyRuleIdList_.isEmpty()) { + policyRuleIdList_ = other.policyRuleIdList_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePolicyRuleIdListIsMutable(); + policyRuleIdList_.addAll(other.policyRuleIdList_); + } + onChanged(); + } } else { - return java.util.Collections.unmodifiableList(polRuleConditionList_); + if (!other.policyRuleIdList_.isEmpty()) { + if (policyRuleIdListBuilder_.isEmpty()) { + policyRuleIdListBuilder_.dispose(); + policyRuleIdListBuilder_ = null; + policyRuleIdList_ = other.policyRuleIdList_; + bitField0_ = (bitField0_ & ~0x00000001); + policyRuleIdListBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getPolicyRuleIdListFieldBuilder() : null; + } else { + policyRuleIdListBuilder_.addAllMessages(other.policyRuleIdList_); + } + } } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; } - /** - * <pre> - * One or more conditions must be met - * </pre> - * - * <code>repeated .policy.PolicyRuleCondition polRuleConditionList = 5;</code> - */ - public policy.Policy.PolicyRuleCondition.Builder addPolRuleConditionListBuilder() { - return getPolRuleConditionListFieldBuilder().addBuilder( - policy.Policy.PolicyRuleCondition.getDefaultInstance()); - } - /** - * <pre> - * One or more conditions must be met - * </pre> - * - * <code>repeated .policy.PolicyRuleCondition polRuleConditionList = 5;</code> - */ - public policy.Policy.PolicyRuleCondition.Builder addPolRuleConditionListBuilder( - int index) { - return getPolRuleConditionListFieldBuilder().addBuilder( - index, policy.Policy.PolicyRuleCondition.getDefaultInstance()); - } - /** - * <pre> - * One or more conditions must be met - * </pre> - * - * <code>repeated .policy.PolicyRuleCondition polRuleConditionList = 5;</code> - */ - public java.util.List<policy.Policy.PolicyRuleCondition.Builder> - getPolRuleConditionListBuilderList() { - return getPolRuleConditionListFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - policy.Policy.PolicyRuleCondition, policy.Policy.PolicyRuleCondition.Builder, policy.Policy.PolicyRuleConditionOrBuilder> - getPolRuleConditionListFieldBuilder() { - if (polRuleConditionListBuilder_ == null) { - polRuleConditionListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - policy.Policy.PolicyRuleCondition, policy.Policy.PolicyRuleCondition.Builder, policy.Policy.PolicyRuleConditionOrBuilder>( - polRuleConditionList_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - polRuleConditionList_ = null; + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + policy.Policy.PolicyRuleIdList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (policy.Policy.PolicyRuleIdList) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } } - return polRuleConditionListBuilder_; + return this; } + private int bitField0_; - private java.util.List<policy.Policy.PolicyRuleAction> polRuleActionList_ = + private java.util.List<policy.Policy.PolicyRuleId> policyRuleIdList_ = java.util.Collections.emptyList(); - private void ensurePolRuleActionListIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - polRuleActionList_ = new java.util.ArrayList<policy.Policy.PolicyRuleAction>(polRuleActionList_); - bitField0_ |= 0x00000002; + private void ensurePolicyRuleIdListIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + policyRuleIdList_ = new java.util.ArrayList<policy.Policy.PolicyRuleId>(policyRuleIdList_); + bitField0_ |= 0x00000001; } } private com.google.protobuf.RepeatedFieldBuilderV3< - policy.Policy.PolicyRuleAction, policy.Policy.PolicyRuleAction.Builder, policy.Policy.PolicyRuleActionOrBuilder> polRuleActionListBuilder_; + policy.Policy.PolicyRuleId, policy.Policy.PolicyRuleId.Builder, policy.Policy.PolicyRuleIdOrBuilder> policyRuleIdListBuilder_; /** - * <pre> - * One or more actions should be applied - * </pre> - * - * <code>repeated .policy.PolicyRuleAction polRuleActionList = 6;</code> + * <code>repeated .policy.PolicyRuleId policyRuleIdList = 1;</code> */ - public java.util.List<policy.Policy.PolicyRuleAction> getPolRuleActionListList() { - if (polRuleActionListBuilder_ == null) { - return java.util.Collections.unmodifiableList(polRuleActionList_); + public java.util.List<policy.Policy.PolicyRuleId> getPolicyRuleIdListList() { + if (policyRuleIdListBuilder_ == null) { + return java.util.Collections.unmodifiableList(policyRuleIdList_); } else { - return polRuleActionListBuilder_.getMessageList(); + return policyRuleIdListBuilder_.getMessageList(); } } /** - * <pre> - * One or more actions should be applied - * </pre> - * - * <code>repeated .policy.PolicyRuleAction polRuleActionList = 6;</code> + * <code>repeated .policy.PolicyRuleId policyRuleIdList = 1;</code> */ - public int getPolRuleActionListCount() { - if (polRuleActionListBuilder_ == null) { - return polRuleActionList_.size(); + public int getPolicyRuleIdListCount() { + if (policyRuleIdListBuilder_ == null) { + return policyRuleIdList_.size(); } else { - return polRuleActionListBuilder_.getCount(); + return policyRuleIdListBuilder_.getCount(); } } /** - * <pre> - * One or more actions should be applied - * </pre> - * - * <code>repeated .policy.PolicyRuleAction polRuleActionList = 6;</code> + * <code>repeated .policy.PolicyRuleId policyRuleIdList = 1;</code> */ - public policy.Policy.PolicyRuleAction getPolRuleActionList(int index) { - if (polRuleActionListBuilder_ == null) { - return polRuleActionList_.get(index); + public policy.Policy.PolicyRuleId getPolicyRuleIdList(int index) { + if (policyRuleIdListBuilder_ == null) { + return policyRuleIdList_.get(index); } else { - return polRuleActionListBuilder_.getMessage(index); + return policyRuleIdListBuilder_.getMessage(index); } } /** - * <pre> - * One or more actions should be applied - * </pre> - * - * <code>repeated .policy.PolicyRuleAction polRuleActionList = 6;</code> + * <code>repeated .policy.PolicyRuleId policyRuleIdList = 1;</code> */ - public Builder setPolRuleActionList( - int index, policy.Policy.PolicyRuleAction value) { - if (polRuleActionListBuilder_ == null) { + public Builder setPolicyRuleIdList( + int index, policy.Policy.PolicyRuleId value) { + if (policyRuleIdListBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensurePolRuleActionListIsMutable(); - polRuleActionList_.set(index, value); + ensurePolicyRuleIdListIsMutable(); + policyRuleIdList_.set(index, value); onChanged(); } else { - polRuleActionListBuilder_.setMessage(index, value); + policyRuleIdListBuilder_.setMessage(index, value); } return this; } /** - * <pre> - * One or more actions should be applied - * </pre> - * - * <code>repeated .policy.PolicyRuleAction polRuleActionList = 6;</code> + * <code>repeated .policy.PolicyRuleId policyRuleIdList = 1;</code> */ - public Builder setPolRuleActionList( - int index, policy.Policy.PolicyRuleAction.Builder builderForValue) { - if (polRuleActionListBuilder_ == null) { - ensurePolRuleActionListIsMutable(); - polRuleActionList_.set(index, builderForValue.build()); + public Builder setPolicyRuleIdList( + int index, policy.Policy.PolicyRuleId.Builder builderForValue) { + if (policyRuleIdListBuilder_ == null) { + ensurePolicyRuleIdListIsMutable(); + policyRuleIdList_.set(index, builderForValue.build()); onChanged(); } else { - polRuleActionListBuilder_.setMessage(index, builderForValue.build()); + policyRuleIdListBuilder_.setMessage(index, builderForValue.build()); } return this; } /** - * <pre> - * One or more actions should be applied - * </pre> - * - * <code>repeated .policy.PolicyRuleAction polRuleActionList = 6;</code> + * <code>repeated .policy.PolicyRuleId policyRuleIdList = 1;</code> */ - public Builder addPolRuleActionList(policy.Policy.PolicyRuleAction value) { - if (polRuleActionListBuilder_ == null) { + public Builder addPolicyRuleIdList(policy.Policy.PolicyRuleId value) { + if (policyRuleIdListBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensurePolRuleActionListIsMutable(); - polRuleActionList_.add(value); + ensurePolicyRuleIdListIsMutable(); + policyRuleIdList_.add(value); onChanged(); } else { - polRuleActionListBuilder_.addMessage(value); + policyRuleIdListBuilder_.addMessage(value); } return this; } /** - * <pre> - * One or more actions should be applied - * </pre> - * - * <code>repeated .policy.PolicyRuleAction polRuleActionList = 6;</code> + * <code>repeated .policy.PolicyRuleId policyRuleIdList = 1;</code> */ - public Builder addPolRuleActionList( - int index, policy.Policy.PolicyRuleAction value) { - if (polRuleActionListBuilder_ == null) { + public Builder addPolicyRuleIdList( + int index, policy.Policy.PolicyRuleId value) { + if (policyRuleIdListBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensurePolRuleActionListIsMutable(); - polRuleActionList_.add(index, value); + ensurePolicyRuleIdListIsMutable(); + policyRuleIdList_.add(index, value); onChanged(); } else { - polRuleActionListBuilder_.addMessage(index, value); + policyRuleIdListBuilder_.addMessage(index, value); } return this; } /** - * <pre> - * One or more actions should be applied - * </pre> - * - * <code>repeated .policy.PolicyRuleAction polRuleActionList = 6;</code> + * <code>repeated .policy.PolicyRuleId policyRuleIdList = 1;</code> */ - public Builder addPolRuleActionList( - policy.Policy.PolicyRuleAction.Builder builderForValue) { - if (polRuleActionListBuilder_ == null) { - ensurePolRuleActionListIsMutable(); - polRuleActionList_.add(builderForValue.build()); + public Builder addPolicyRuleIdList( + policy.Policy.PolicyRuleId.Builder builderForValue) { + if (policyRuleIdListBuilder_ == null) { + ensurePolicyRuleIdListIsMutable(); + policyRuleIdList_.add(builderForValue.build()); onChanged(); } else { - polRuleActionListBuilder_.addMessage(builderForValue.build()); + policyRuleIdListBuilder_.addMessage(builderForValue.build()); } return this; } /** - * <pre> - * One or more actions should be applied - * </pre> - * - * <code>repeated .policy.PolicyRuleAction polRuleActionList = 6;</code> + * <code>repeated .policy.PolicyRuleId policyRuleIdList = 1;</code> */ - public Builder addPolRuleActionList( - int index, policy.Policy.PolicyRuleAction.Builder builderForValue) { - if (polRuleActionListBuilder_ == null) { - ensurePolRuleActionListIsMutable(); - polRuleActionList_.add(index, builderForValue.build()); + public Builder addPolicyRuleIdList( + int index, policy.Policy.PolicyRuleId.Builder builderForValue) { + if (policyRuleIdListBuilder_ == null) { + ensurePolicyRuleIdListIsMutable(); + policyRuleIdList_.add(index, builderForValue.build()); onChanged(); } else { - polRuleActionListBuilder_.addMessage(index, builderForValue.build()); + policyRuleIdListBuilder_.addMessage(index, builderForValue.build()); } return this; } /** - * <pre> - * One or more actions should be applied - * </pre> - * - * <code>repeated .policy.PolicyRuleAction polRuleActionList = 6;</code> + * <code>repeated .policy.PolicyRuleId policyRuleIdList = 1;</code> */ - public Builder addAllPolRuleActionList( - java.lang.Iterable<? extends policy.Policy.PolicyRuleAction> values) { - if (polRuleActionListBuilder_ == null) { - ensurePolRuleActionListIsMutable(); + public Builder addAllPolicyRuleIdList( + java.lang.Iterable<? extends policy.Policy.PolicyRuleId> values) { + if (policyRuleIdListBuilder_ == null) { + ensurePolicyRuleIdListIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, polRuleActionList_); + values, policyRuleIdList_); onChanged(); } else { - polRuleActionListBuilder_.addAllMessages(values); + policyRuleIdListBuilder_.addAllMessages(values); } return this; } /** - * <pre> - * One or more actions should be applied - * </pre> - * - * <code>repeated .policy.PolicyRuleAction polRuleActionList = 6;</code> + * <code>repeated .policy.PolicyRuleId policyRuleIdList = 1;</code> */ - public Builder clearPolRuleActionList() { - if (polRuleActionListBuilder_ == null) { - polRuleActionList_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + public Builder clearPolicyRuleIdList() { + if (policyRuleIdListBuilder_ == null) { + policyRuleIdList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { - polRuleActionListBuilder_.clear(); + policyRuleIdListBuilder_.clear(); } return this; } /** - * <pre> - * One or more actions should be applied - * </pre> - * - * <code>repeated .policy.PolicyRuleAction polRuleActionList = 6;</code> + * <code>repeated .policy.PolicyRuleId policyRuleIdList = 1;</code> */ - public Builder removePolRuleActionList(int index) { - if (polRuleActionListBuilder_ == null) { - ensurePolRuleActionListIsMutable(); - polRuleActionList_.remove(index); + public Builder removePolicyRuleIdList(int index) { + if (policyRuleIdListBuilder_ == null) { + ensurePolicyRuleIdListIsMutable(); + policyRuleIdList_.remove(index); onChanged(); } else { - polRuleActionListBuilder_.remove(index); + policyRuleIdListBuilder_.remove(index); } return this; } /** - * <pre> - * One or more actions should be applied - * </pre> - * - * <code>repeated .policy.PolicyRuleAction polRuleActionList = 6;</code> + * <code>repeated .policy.PolicyRuleId policyRuleIdList = 1;</code> */ - public policy.Policy.PolicyRuleAction.Builder getPolRuleActionListBuilder( + public policy.Policy.PolicyRuleId.Builder getPolicyRuleIdListBuilder( int index) { - return getPolRuleActionListFieldBuilder().getBuilder(index); + return getPolicyRuleIdListFieldBuilder().getBuilder(index); } /** - * <pre> - * One or more actions should be applied - * </pre> - * - * <code>repeated .policy.PolicyRuleAction polRuleActionList = 6;</code> + * <code>repeated .policy.PolicyRuleId policyRuleIdList = 1;</code> */ - public policy.Policy.PolicyRuleActionOrBuilder getPolRuleActionListOrBuilder( + public policy.Policy.PolicyRuleIdOrBuilder getPolicyRuleIdListOrBuilder( int index) { - if (polRuleActionListBuilder_ == null) { - return polRuleActionList_.get(index); } else { - return polRuleActionListBuilder_.getMessageOrBuilder(index); + if (policyRuleIdListBuilder_ == null) { + return policyRuleIdList_.get(index); } else { + return policyRuleIdListBuilder_.getMessageOrBuilder(index); } } /** - * <pre> - * One or more actions should be applied - * </pre> - * - * <code>repeated .policy.PolicyRuleAction polRuleActionList = 6;</code> + * <code>repeated .policy.PolicyRuleId policyRuleIdList = 1;</code> */ - public java.util.List<? extends policy.Policy.PolicyRuleActionOrBuilder> - getPolRuleActionListOrBuilderList() { - if (polRuleActionListBuilder_ != null) { - return polRuleActionListBuilder_.getMessageOrBuilderList(); + public java.util.List<? extends policy.Policy.PolicyRuleIdOrBuilder> + getPolicyRuleIdListOrBuilderList() { + if (policyRuleIdListBuilder_ != null) { + return policyRuleIdListBuilder_.getMessageOrBuilderList(); } else { - return java.util.Collections.unmodifiableList(polRuleActionList_); + return java.util.Collections.unmodifiableList(policyRuleIdList_); } } /** - * <pre> - * One or more actions should be applied - * </pre> - * - * <code>repeated .policy.PolicyRuleAction polRuleActionList = 6;</code> + * <code>repeated .policy.PolicyRuleId policyRuleIdList = 1;</code> */ - public policy.Policy.PolicyRuleAction.Builder addPolRuleActionListBuilder() { - return getPolRuleActionListFieldBuilder().addBuilder( - policy.Policy.PolicyRuleAction.getDefaultInstance()); + public policy.Policy.PolicyRuleId.Builder addPolicyRuleIdListBuilder() { + return getPolicyRuleIdListFieldBuilder().addBuilder( + policy.Policy.PolicyRuleId.getDefaultInstance()); } /** - * <pre> - * One or more actions should be applied - * </pre> - * - * <code>repeated .policy.PolicyRuleAction polRuleActionList = 6;</code> + * <code>repeated .policy.PolicyRuleId policyRuleIdList = 1;</code> */ - public policy.Policy.PolicyRuleAction.Builder addPolRuleActionListBuilder( + public policy.Policy.PolicyRuleId.Builder addPolicyRuleIdListBuilder( int index) { - return getPolRuleActionListFieldBuilder().addBuilder( - index, policy.Policy.PolicyRuleAction.getDefaultInstance()); + return getPolicyRuleIdListFieldBuilder().addBuilder( + index, policy.Policy.PolicyRuleId.getDefaultInstance()); } /** - * <pre> - * One or more actions should be applied - * </pre> - * - * <code>repeated .policy.PolicyRuleAction polRuleActionList = 6;</code> + * <code>repeated .policy.PolicyRuleId policyRuleIdList = 1;</code> */ - public java.util.List<policy.Policy.PolicyRuleAction.Builder> - getPolRuleActionListBuilderList() { - return getPolRuleActionListFieldBuilder().getBuilderList(); + public java.util.List<policy.Policy.PolicyRuleId.Builder> + getPolicyRuleIdListBuilderList() { + return getPolicyRuleIdListFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< - policy.Policy.PolicyRuleAction, policy.Policy.PolicyRuleAction.Builder, policy.Policy.PolicyRuleActionOrBuilder> - getPolRuleActionListFieldBuilder() { - if (polRuleActionListBuilder_ == null) { - polRuleActionListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - policy.Policy.PolicyRuleAction, policy.Policy.PolicyRuleAction.Builder, policy.Policy.PolicyRuleActionOrBuilder>( - polRuleActionList_, - ((bitField0_ & 0x00000002) != 0), + policy.Policy.PolicyRuleId, policy.Policy.PolicyRuleId.Builder, policy.Policy.PolicyRuleIdOrBuilder> + getPolicyRuleIdListFieldBuilder() { + if (policyRuleIdListBuilder_ == null) { + policyRuleIdListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + policy.Policy.PolicyRuleId, policy.Policy.PolicyRuleId.Builder, policy.Policy.PolicyRuleIdOrBuilder>( + policyRuleIdList_, + ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - polRuleActionList_ = null; + policyRuleIdList_ = null; + } + return policyRuleIdListBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:policy.PolicyRuleIdList) + } + + // @@protoc_insertion_point(class_scope:policy.PolicyRuleIdList) + private static final policy.Policy.PolicyRuleIdList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new policy.Policy.PolicyRuleIdList(); + } + + public static policy.Policy.PolicyRuleIdList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<PolicyRuleIdList> + PARSER = new com.google.protobuf.AbstractParser<PolicyRuleIdList>() { + @java.lang.Override + public PolicyRuleIdList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PolicyRuleIdList(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<PolicyRuleIdList> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<PolicyRuleIdList> getParserForType() { + return PARSER; + } + + @java.lang.Override + public policy.Policy.PolicyRuleIdList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface PolicyRuleServiceListOrBuilder extends + // @@protoc_insertion_point(interface_extends:policy.PolicyRuleServiceList) + com.google.protobuf.MessageOrBuilder { + + /** + * <code>repeated .policy.PolicyRuleService policyRuleServiceList = 1;</code> + */ + java.util.List<policy.Policy.PolicyRuleService> + getPolicyRuleServiceListList(); + /** + * <code>repeated .policy.PolicyRuleService policyRuleServiceList = 1;</code> + */ + policy.Policy.PolicyRuleService getPolicyRuleServiceList(int index); + /** + * <code>repeated .policy.PolicyRuleService policyRuleServiceList = 1;</code> + */ + int getPolicyRuleServiceListCount(); + /** + * <code>repeated .policy.PolicyRuleService policyRuleServiceList = 1;</code> + */ + java.util.List<? extends policy.Policy.PolicyRuleServiceOrBuilder> + getPolicyRuleServiceListOrBuilderList(); + /** + * <code>repeated .policy.PolicyRuleService policyRuleServiceList = 1;</code> + */ + policy.Policy.PolicyRuleServiceOrBuilder getPolicyRuleServiceListOrBuilder( + int index); + } + /** + * <pre> + * A list of service-oriented policy rules + * </pre> + * + * Protobuf type {@code policy.PolicyRuleServiceList} + */ + public static final class PolicyRuleServiceList extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:policy.PolicyRuleServiceList) + PolicyRuleServiceListOrBuilder { + private static final long serialVersionUID = 0L; + // Use PolicyRuleServiceList.newBuilder() to construct. + private PolicyRuleServiceList(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private PolicyRuleServiceList() { + policyRuleServiceList_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new PolicyRuleServiceList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private PolicyRuleServiceList( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + policyRuleServiceList_ = new java.util.ArrayList<policy.Policy.PolicyRuleService>(); + mutable_bitField0_ |= 0x00000001; + } + policyRuleServiceList_.add( + input.readMessage(policy.Policy.PolicyRuleService.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + policyRuleServiceList_ = java.util.Collections.unmodifiableList(policyRuleServiceList_); } - return polRuleActionListBuilder_; + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return policy.Policy.internal_static_policy_PolicyRuleServiceList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return policy.Policy.internal_static_policy_PolicyRuleServiceList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + policy.Policy.PolicyRuleServiceList.class, policy.Policy.PolicyRuleServiceList.Builder.class); + } + + public static final int POLICYRULESERVICELIST_FIELD_NUMBER = 1; + private java.util.List<policy.Policy.PolicyRuleService> policyRuleServiceList_; + /** + * <code>repeated .policy.PolicyRuleService policyRuleServiceList = 1;</code> + */ + @java.lang.Override + public java.util.List<policy.Policy.PolicyRuleService> getPolicyRuleServiceListList() { + return policyRuleServiceList_; + } + /** + * <code>repeated .policy.PolicyRuleService policyRuleServiceList = 1;</code> + */ + @java.lang.Override + public java.util.List<? extends policy.Policy.PolicyRuleServiceOrBuilder> + getPolicyRuleServiceListOrBuilderList() { + return policyRuleServiceList_; + } + /** + * <code>repeated .policy.PolicyRuleService policyRuleServiceList = 1;</code> + */ + @java.lang.Override + public int getPolicyRuleServiceListCount() { + return policyRuleServiceList_.size(); + } + /** + * <code>repeated .policy.PolicyRuleService policyRuleServiceList = 1;</code> + */ + @java.lang.Override + public policy.Policy.PolicyRuleService getPolicyRuleServiceList(int index) { + return policyRuleServiceList_.get(index); + } + /** + * <code>repeated .policy.PolicyRuleService policyRuleServiceList = 1;</code> + */ + @java.lang.Override + public policy.Policy.PolicyRuleServiceOrBuilder getPolicyRuleServiceListOrBuilder( + int index) { + return policyRuleServiceList_.get(index); + } - private java.util.List<context.ContextOuterClass.ServiceId> serviceList_ = - java.util.Collections.emptyList(); - private void ensureServiceListIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { - serviceList_ = new java.util.ArrayList<context.ContextOuterClass.ServiceId>(serviceList_); - bitField0_ |= 0x00000004; - } + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < policyRuleServiceList_.size(); i++) { + output.writeMessage(1, policyRuleServiceList_.get(i)); } + unknownFields.writeTo(output); + } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> serviceListBuilder_; + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; - /** - * <pre> - * Affected services and devices - * </pre> - * - * <code>repeated .context.ServiceId serviceList = 7;</code> - */ - public java.util.List<context.ContextOuterClass.ServiceId> getServiceListList() { - if (serviceListBuilder_ == null) { - return java.util.Collections.unmodifiableList(serviceList_); - } else { - return serviceListBuilder_.getMessageList(); - } + size = 0; + for (int i = 0; i < policyRuleServiceList_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, policyRuleServiceList_.get(i)); } - /** - * <pre> - * Affected services and devices - * </pre> - * - * <code>repeated .context.ServiceId serviceList = 7;</code> - */ - public int getServiceListCount() { - if (serviceListBuilder_ == null) { - return serviceList_.size(); - } else { - return serviceListBuilder_.getCount(); - } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; } - /** - * <pre> - * Affected services and devices - * </pre> - * - * <code>repeated .context.ServiceId serviceList = 7;</code> - */ - public context.ContextOuterClass.ServiceId getServiceList(int index) { - if (serviceListBuilder_ == null) { - return serviceList_.get(index); - } else { - return serviceListBuilder_.getMessage(index); - } + if (!(obj instanceof policy.Policy.PolicyRuleServiceList)) { + return super.equals(obj); } - /** - * <pre> - * Affected services and devices - * </pre> - * - * <code>repeated .context.ServiceId serviceList = 7;</code> - */ - public Builder setServiceList( - int index, context.ContextOuterClass.ServiceId value) { - if (serviceListBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureServiceListIsMutable(); - serviceList_.set(index, value); - onChanged(); - } else { - serviceListBuilder_.setMessage(index, value); - } - return this; + policy.Policy.PolicyRuleServiceList other = (policy.Policy.PolicyRuleServiceList) obj; + + if (!getPolicyRuleServiceListList() + .equals(other.getPolicyRuleServiceListList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; } - /** - * <pre> - * Affected services and devices - * </pre> - * - * <code>repeated .context.ServiceId serviceList = 7;</code> - */ - public Builder setServiceList( - int index, context.ContextOuterClass.ServiceId.Builder builderForValue) { - if (serviceListBuilder_ == null) { - ensureServiceListIsMutable(); - serviceList_.set(index, builderForValue.build()); - onChanged(); - } else { - serviceListBuilder_.setMessage(index, builderForValue.build()); - } - return this; + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getPolicyRuleServiceListCount() > 0) { + hash = (37 * hash) + POLICYRULESERVICELIST_FIELD_NUMBER; + hash = (53 * hash) + getPolicyRuleServiceListList().hashCode(); } - /** - * <pre> - * Affected services and devices - * </pre> - * - * <code>repeated .context.ServiceId serviceList = 7;</code> - */ - public Builder addServiceList(context.ContextOuterClass.ServiceId value) { - if (serviceListBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureServiceListIsMutable(); - serviceList_.add(value); - onChanged(); - } else { - serviceListBuilder_.addMessage(value); - } - return this; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static policy.Policy.PolicyRuleServiceList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static policy.Policy.PolicyRuleServiceList parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static policy.Policy.PolicyRuleServiceList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static policy.Policy.PolicyRuleServiceList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static policy.Policy.PolicyRuleServiceList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static policy.Policy.PolicyRuleServiceList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static policy.Policy.PolicyRuleServiceList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static policy.Policy.PolicyRuleServiceList parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static policy.Policy.PolicyRuleServiceList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static policy.Policy.PolicyRuleServiceList parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static policy.Policy.PolicyRuleServiceList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static policy.Policy.PolicyRuleServiceList parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(policy.Policy.PolicyRuleServiceList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * <pre> + * A list of service-oriented policy rules + * </pre> + * + * Protobuf type {@code policy.PolicyRuleServiceList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:policy.PolicyRuleServiceList) + policy.Policy.PolicyRuleServiceListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return policy.Policy.internal_static_policy_PolicyRuleServiceList_descriptor; } - /** - * <pre> - * Affected services and devices - * </pre> - * - * <code>repeated .context.ServiceId serviceList = 7;</code> - */ - public Builder addServiceList( - int index, context.ContextOuterClass.ServiceId value) { - if (serviceListBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureServiceListIsMutable(); - serviceList_.add(index, value); - onChanged(); - } else { - serviceListBuilder_.addMessage(index, value); - } - return this; + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return policy.Policy.internal_static_policy_PolicyRuleServiceList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + policy.Policy.PolicyRuleServiceList.class, policy.Policy.PolicyRuleServiceList.Builder.class); } - /** - * <pre> - * Affected services and devices - * </pre> - * - * <code>repeated .context.ServiceId serviceList = 7;</code> - */ - public Builder addServiceList( - context.ContextOuterClass.ServiceId.Builder builderForValue) { - if (serviceListBuilder_ == null) { - ensureServiceListIsMutable(); - serviceList_.add(builderForValue.build()); - onChanged(); - } else { - serviceListBuilder_.addMessage(builderForValue.build()); - } - return this; + + // Construct using policy.Policy.PolicyRuleServiceList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); } - /** - * <pre> - * Affected services and devices - * </pre> - * - * <code>repeated .context.ServiceId serviceList = 7;</code> - */ - public Builder addServiceList( - int index, context.ContextOuterClass.ServiceId.Builder builderForValue) { - if (serviceListBuilder_ == null) { - ensureServiceListIsMutable(); - serviceList_.add(index, builderForValue.build()); - onChanged(); - } else { - serviceListBuilder_.addMessage(index, builderForValue.build()); - } - return this; + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); } - /** - * <pre> - * Affected services and devices - * </pre> - * - * <code>repeated .context.ServiceId serviceList = 7;</code> - */ - public Builder addAllServiceList( - java.lang.Iterable<? extends context.ContextOuterClass.ServiceId> values) { - if (serviceListBuilder_ == null) { - ensureServiceListIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, serviceList_); - onChanged(); - } else { - serviceListBuilder_.addAllMessages(values); + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getPolicyRuleServiceListFieldBuilder(); } - return this; } - /** - * <pre> - * Affected services and devices - * </pre> - * - * <code>repeated .context.ServiceId serviceList = 7;</code> - */ - public Builder clearServiceList() { - if (serviceListBuilder_ == null) { - serviceList_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); + @java.lang.Override + public Builder clear() { + super.clear(); + if (policyRuleServiceListBuilder_ == null) { + policyRuleServiceList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); } else { - serviceListBuilder_.clear(); + policyRuleServiceListBuilder_.clear(); } return this; } - /** - * <pre> - * Affected services and devices - * </pre> - * - * <code>repeated .context.ServiceId serviceList = 7;</code> - */ - public Builder removeServiceList(int index) { - if (serviceListBuilder_ == null) { - ensureServiceListIsMutable(); - serviceList_.remove(index); - onChanged(); - } else { - serviceListBuilder_.remove(index); - } - return this; + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return policy.Policy.internal_static_policy_PolicyRuleServiceList_descriptor; } - /** - * <pre> - * Affected services and devices - * </pre> - * - * <code>repeated .context.ServiceId serviceList = 7;</code> - */ - public context.ContextOuterClass.ServiceId.Builder getServiceListBuilder( - int index) { - return getServiceListFieldBuilder().getBuilder(index); + + @java.lang.Override + public policy.Policy.PolicyRuleServiceList getDefaultInstanceForType() { + return policy.Policy.PolicyRuleServiceList.getDefaultInstance(); } - /** - * <pre> - * Affected services and devices - * </pre> - * - * <code>repeated .context.ServiceId serviceList = 7;</code> - */ - public context.ContextOuterClass.ServiceIdOrBuilder getServiceListOrBuilder( - int index) { - if (serviceListBuilder_ == null) { - return serviceList_.get(index); } else { - return serviceListBuilder_.getMessageOrBuilder(index); + + @java.lang.Override + public policy.Policy.PolicyRuleServiceList build() { + policy.Policy.PolicyRuleServiceList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); } + return result; } - /** - * <pre> - * Affected services and devices - * </pre> - * - * <code>repeated .context.ServiceId serviceList = 7;</code> - */ - public java.util.List<? extends context.ContextOuterClass.ServiceIdOrBuilder> - getServiceListOrBuilderList() { - if (serviceListBuilder_ != null) { - return serviceListBuilder_.getMessageOrBuilderList(); + + @java.lang.Override + public policy.Policy.PolicyRuleServiceList buildPartial() { + policy.Policy.PolicyRuleServiceList result = new policy.Policy.PolicyRuleServiceList(this); + int from_bitField0_ = bitField0_; + if (policyRuleServiceListBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + policyRuleServiceList_ = java.util.Collections.unmodifiableList(policyRuleServiceList_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.policyRuleServiceList_ = policyRuleServiceList_; } else { - return java.util.Collections.unmodifiableList(serviceList_); + result.policyRuleServiceList_ = policyRuleServiceListBuilder_.build(); } + onBuilt(); + return result; } - /** - * <pre> - * Affected services and devices - * </pre> - * - * <code>repeated .context.ServiceId serviceList = 7;</code> - */ - public context.ContextOuterClass.ServiceId.Builder addServiceListBuilder() { - return getServiceListFieldBuilder().addBuilder( - context.ContextOuterClass.ServiceId.getDefaultInstance()); + + @java.lang.Override + public Builder clone() { + return super.clone(); } - /** - * <pre> - * Affected services and devices - * </pre> - * - * <code>repeated .context.ServiceId serviceList = 7;</code> - */ - public context.ContextOuterClass.ServiceId.Builder addServiceListBuilder( - int index) { - return getServiceListFieldBuilder().addBuilder( - index, context.ContextOuterClass.ServiceId.getDefaultInstance()); + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); } - /** - * <pre> - * Affected services and devices - * </pre> - * - * <code>repeated .context.ServiceId serviceList = 7;</code> - */ - public java.util.List<context.ContextOuterClass.ServiceId.Builder> - getServiceListBuilderList() { - return getServiceListFieldBuilder().getBuilderList(); + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> - getServiceListFieldBuilder() { - if (serviceListBuilder_ == null) { - serviceListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder>( - serviceList_, - ((bitField0_ & 0x00000004) != 0), - getParentForChildren(), - isClean()); - serviceList_ = null; + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof policy.Policy.PolicyRuleServiceList) { + return mergeFrom((policy.Policy.PolicyRuleServiceList)other); + } else { + super.mergeFrom(other); + return this; } - return serviceListBuilder_; } - private java.util.List<context.ContextOuterClass.DeviceId> deviceList_ = + public Builder mergeFrom(policy.Policy.PolicyRuleServiceList other) { + if (other == policy.Policy.PolicyRuleServiceList.getDefaultInstance()) return this; + if (policyRuleServiceListBuilder_ == null) { + if (!other.policyRuleServiceList_.isEmpty()) { + if (policyRuleServiceList_.isEmpty()) { + policyRuleServiceList_ = other.policyRuleServiceList_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePolicyRuleServiceListIsMutable(); + policyRuleServiceList_.addAll(other.policyRuleServiceList_); + } + onChanged(); + } + } else { + if (!other.policyRuleServiceList_.isEmpty()) { + if (policyRuleServiceListBuilder_.isEmpty()) { + policyRuleServiceListBuilder_.dispose(); + policyRuleServiceListBuilder_ = null; + policyRuleServiceList_ = other.policyRuleServiceList_; + bitField0_ = (bitField0_ & ~0x00000001); + policyRuleServiceListBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getPolicyRuleServiceListFieldBuilder() : null; + } else { + policyRuleServiceListBuilder_.addAllMessages(other.policyRuleServiceList_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + policy.Policy.PolicyRuleServiceList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (policy.Policy.PolicyRuleServiceList) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List<policy.Policy.PolicyRuleService> policyRuleServiceList_ = java.util.Collections.emptyList(); - private void ensureDeviceListIsMutable() { - if (!((bitField0_ & 0x00000008) != 0)) { - deviceList_ = new java.util.ArrayList<context.ContextOuterClass.DeviceId>(deviceList_); - bitField0_ |= 0x00000008; + private void ensurePolicyRuleServiceListIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + policyRuleServiceList_ = new java.util.ArrayList<policy.Policy.PolicyRuleService>(policyRuleServiceList_); + bitField0_ |= 0x00000001; } } private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> deviceListBuilder_; + policy.Policy.PolicyRuleService, policy.Policy.PolicyRuleService.Builder, policy.Policy.PolicyRuleServiceOrBuilder> policyRuleServiceListBuilder_; /** - * <code>repeated .context.DeviceId deviceList = 8;</code> + * <code>repeated .policy.PolicyRuleService policyRuleServiceList = 1;</code> */ - public java.util.List<context.ContextOuterClass.DeviceId> getDeviceListList() { - if (deviceListBuilder_ == null) { - return java.util.Collections.unmodifiableList(deviceList_); + public java.util.List<policy.Policy.PolicyRuleService> getPolicyRuleServiceListList() { + if (policyRuleServiceListBuilder_ == null) { + return java.util.Collections.unmodifiableList(policyRuleServiceList_); } else { - return deviceListBuilder_.getMessageList(); + return policyRuleServiceListBuilder_.getMessageList(); } } /** - * <code>repeated .context.DeviceId deviceList = 8;</code> + * <code>repeated .policy.PolicyRuleService policyRuleServiceList = 1;</code> */ - public int getDeviceListCount() { - if (deviceListBuilder_ == null) { - return deviceList_.size(); + public int getPolicyRuleServiceListCount() { + if (policyRuleServiceListBuilder_ == null) { + return policyRuleServiceList_.size(); } else { - return deviceListBuilder_.getCount(); + return policyRuleServiceListBuilder_.getCount(); } } /** - * <code>repeated .context.DeviceId deviceList = 8;</code> + * <code>repeated .policy.PolicyRuleService policyRuleServiceList = 1;</code> */ - public context.ContextOuterClass.DeviceId getDeviceList(int index) { - if (deviceListBuilder_ == null) { - return deviceList_.get(index); + public policy.Policy.PolicyRuleService getPolicyRuleServiceList(int index) { + if (policyRuleServiceListBuilder_ == null) { + return policyRuleServiceList_.get(index); } else { - return deviceListBuilder_.getMessage(index); + return policyRuleServiceListBuilder_.getMessage(index); } } /** - * <code>repeated .context.DeviceId deviceList = 8;</code> + * <code>repeated .policy.PolicyRuleService policyRuleServiceList = 1;</code> */ - public Builder setDeviceList( - int index, context.ContextOuterClass.DeviceId value) { - if (deviceListBuilder_ == null) { + public Builder setPolicyRuleServiceList( + int index, policy.Policy.PolicyRuleService value) { + if (policyRuleServiceListBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureDeviceListIsMutable(); - deviceList_.set(index, value); + ensurePolicyRuleServiceListIsMutable(); + policyRuleServiceList_.set(index, value); onChanged(); } else { - deviceListBuilder_.setMessage(index, value); + policyRuleServiceListBuilder_.setMessage(index, value); } return this; } /** - * <code>repeated .context.DeviceId deviceList = 8;</code> + * <code>repeated .policy.PolicyRuleService policyRuleServiceList = 1;</code> */ - public Builder setDeviceList( - int index, context.ContextOuterClass.DeviceId.Builder builderForValue) { - if (deviceListBuilder_ == null) { - ensureDeviceListIsMutable(); - deviceList_.set(index, builderForValue.build()); + public Builder setPolicyRuleServiceList( + int index, policy.Policy.PolicyRuleService.Builder builderForValue) { + if (policyRuleServiceListBuilder_ == null) { + ensurePolicyRuleServiceListIsMutable(); + policyRuleServiceList_.set(index, builderForValue.build()); onChanged(); } else { - deviceListBuilder_.setMessage(index, builderForValue.build()); + policyRuleServiceListBuilder_.setMessage(index, builderForValue.build()); } return this; } /** - * <code>repeated .context.DeviceId deviceList = 8;</code> + * <code>repeated .policy.PolicyRuleService policyRuleServiceList = 1;</code> */ - public Builder addDeviceList(context.ContextOuterClass.DeviceId value) { - if (deviceListBuilder_ == null) { + public Builder addPolicyRuleServiceList(policy.Policy.PolicyRuleService value) { + if (policyRuleServiceListBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureDeviceListIsMutable(); - deviceList_.add(value); + ensurePolicyRuleServiceListIsMutable(); + policyRuleServiceList_.add(value); onChanged(); } else { - deviceListBuilder_.addMessage(value); + policyRuleServiceListBuilder_.addMessage(value); } return this; } /** - * <code>repeated .context.DeviceId deviceList = 8;</code> + * <code>repeated .policy.PolicyRuleService policyRuleServiceList = 1;</code> */ - public Builder addDeviceList( - int index, context.ContextOuterClass.DeviceId value) { - if (deviceListBuilder_ == null) { + public Builder addPolicyRuleServiceList( + int index, policy.Policy.PolicyRuleService value) { + if (policyRuleServiceListBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureDeviceListIsMutable(); - deviceList_.add(index, value); + ensurePolicyRuleServiceListIsMutable(); + policyRuleServiceList_.add(index, value); onChanged(); } else { - deviceListBuilder_.addMessage(index, value); + policyRuleServiceListBuilder_.addMessage(index, value); } return this; } /** - * <code>repeated .context.DeviceId deviceList = 8;</code> + * <code>repeated .policy.PolicyRuleService policyRuleServiceList = 1;</code> */ - public Builder addDeviceList( - context.ContextOuterClass.DeviceId.Builder builderForValue) { - if (deviceListBuilder_ == null) { - ensureDeviceListIsMutable(); - deviceList_.add(builderForValue.build()); + public Builder addPolicyRuleServiceList( + policy.Policy.PolicyRuleService.Builder builderForValue) { + if (policyRuleServiceListBuilder_ == null) { + ensurePolicyRuleServiceListIsMutable(); + policyRuleServiceList_.add(builderForValue.build()); onChanged(); } else { - deviceListBuilder_.addMessage(builderForValue.build()); + policyRuleServiceListBuilder_.addMessage(builderForValue.build()); } return this; } /** - * <code>repeated .context.DeviceId deviceList = 8;</code> + * <code>repeated .policy.PolicyRuleService policyRuleServiceList = 1;</code> */ - public Builder addDeviceList( - int index, context.ContextOuterClass.DeviceId.Builder builderForValue) { - if (deviceListBuilder_ == null) { - ensureDeviceListIsMutable(); - deviceList_.add(index, builderForValue.build()); + public Builder addPolicyRuleServiceList( + int index, policy.Policy.PolicyRuleService.Builder builderForValue) { + if (policyRuleServiceListBuilder_ == null) { + ensurePolicyRuleServiceListIsMutable(); + policyRuleServiceList_.add(index, builderForValue.build()); onChanged(); } else { - deviceListBuilder_.addMessage(index, builderForValue.build()); + policyRuleServiceListBuilder_.addMessage(index, builderForValue.build()); } return this; } /** - * <code>repeated .context.DeviceId deviceList = 8;</code> + * <code>repeated .policy.PolicyRuleService policyRuleServiceList = 1;</code> */ - public Builder addAllDeviceList( - java.lang.Iterable<? extends context.ContextOuterClass.DeviceId> values) { - if (deviceListBuilder_ == null) { - ensureDeviceListIsMutable(); + public Builder addAllPolicyRuleServiceList( + java.lang.Iterable<? extends policy.Policy.PolicyRuleService> values) { + if (policyRuleServiceListBuilder_ == null) { + ensurePolicyRuleServiceListIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, deviceList_); + values, policyRuleServiceList_); onChanged(); } else { - deviceListBuilder_.addAllMessages(values); + policyRuleServiceListBuilder_.addAllMessages(values); } return this; } /** - * <code>repeated .context.DeviceId deviceList = 8;</code> + * <code>repeated .policy.PolicyRuleService policyRuleServiceList = 1;</code> */ - public Builder clearDeviceList() { - if (deviceListBuilder_ == null) { - deviceList_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); + public Builder clearPolicyRuleServiceList() { + if (policyRuleServiceListBuilder_ == null) { + policyRuleServiceList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { - deviceListBuilder_.clear(); + policyRuleServiceListBuilder_.clear(); } return this; } /** - * <code>repeated .context.DeviceId deviceList = 8;</code> + * <code>repeated .policy.PolicyRuleService policyRuleServiceList = 1;</code> */ - public Builder removeDeviceList(int index) { - if (deviceListBuilder_ == null) { - ensureDeviceListIsMutable(); - deviceList_.remove(index); + public Builder removePolicyRuleServiceList(int index) { + if (policyRuleServiceListBuilder_ == null) { + ensurePolicyRuleServiceListIsMutable(); + policyRuleServiceList_.remove(index); onChanged(); } else { - deviceListBuilder_.remove(index); + policyRuleServiceListBuilder_.remove(index); } return this; } /** - * <code>repeated .context.DeviceId deviceList = 8;</code> + * <code>repeated .policy.PolicyRuleService policyRuleServiceList = 1;</code> */ - public context.ContextOuterClass.DeviceId.Builder getDeviceListBuilder( + public policy.Policy.PolicyRuleService.Builder getPolicyRuleServiceListBuilder( int index) { - return getDeviceListFieldBuilder().getBuilder(index); + return getPolicyRuleServiceListFieldBuilder().getBuilder(index); } /** - * <code>repeated .context.DeviceId deviceList = 8;</code> + * <code>repeated .policy.PolicyRuleService policyRuleServiceList = 1;</code> */ - public context.ContextOuterClass.DeviceIdOrBuilder getDeviceListOrBuilder( + public policy.Policy.PolicyRuleServiceOrBuilder getPolicyRuleServiceListOrBuilder( int index) { - if (deviceListBuilder_ == null) { - return deviceList_.get(index); } else { - return deviceListBuilder_.getMessageOrBuilder(index); + if (policyRuleServiceListBuilder_ == null) { + return policyRuleServiceList_.get(index); } else { + return policyRuleServiceListBuilder_.getMessageOrBuilder(index); } } /** - * <code>repeated .context.DeviceId deviceList = 8;</code> + * <code>repeated .policy.PolicyRuleService policyRuleServiceList = 1;</code> */ - public java.util.List<? extends context.ContextOuterClass.DeviceIdOrBuilder> - getDeviceListOrBuilderList() { - if (deviceListBuilder_ != null) { - return deviceListBuilder_.getMessageOrBuilderList(); + public java.util.List<? extends policy.Policy.PolicyRuleServiceOrBuilder> + getPolicyRuleServiceListOrBuilderList() { + if (policyRuleServiceListBuilder_ != null) { + return policyRuleServiceListBuilder_.getMessageOrBuilderList(); } else { - return java.util.Collections.unmodifiableList(deviceList_); + return java.util.Collections.unmodifiableList(policyRuleServiceList_); } } /** - * <code>repeated .context.DeviceId deviceList = 8;</code> + * <code>repeated .policy.PolicyRuleService policyRuleServiceList = 1;</code> */ - public context.ContextOuterClass.DeviceId.Builder addDeviceListBuilder() { - return getDeviceListFieldBuilder().addBuilder( - context.ContextOuterClass.DeviceId.getDefaultInstance()); + public policy.Policy.PolicyRuleService.Builder addPolicyRuleServiceListBuilder() { + return getPolicyRuleServiceListFieldBuilder().addBuilder( + policy.Policy.PolicyRuleService.getDefaultInstance()); } /** - * <code>repeated .context.DeviceId deviceList = 8;</code> + * <code>repeated .policy.PolicyRuleService policyRuleServiceList = 1;</code> */ - public context.ContextOuterClass.DeviceId.Builder addDeviceListBuilder( + public policy.Policy.PolicyRuleService.Builder addPolicyRuleServiceListBuilder( int index) { - return getDeviceListFieldBuilder().addBuilder( - index, context.ContextOuterClass.DeviceId.getDefaultInstance()); + return getPolicyRuleServiceListFieldBuilder().addBuilder( + index, policy.Policy.PolicyRuleService.getDefaultInstance()); } /** - * <code>repeated .context.DeviceId deviceList = 8;</code> + * <code>repeated .policy.PolicyRuleService policyRuleServiceList = 1;</code> */ - public java.util.List<context.ContextOuterClass.DeviceId.Builder> - getDeviceListBuilderList() { - return getDeviceListFieldBuilder().getBuilderList(); + public java.util.List<policy.Policy.PolicyRuleService.Builder> + getPolicyRuleServiceListBuilderList() { + return getPolicyRuleServiceListFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> - getDeviceListFieldBuilder() { - if (deviceListBuilder_ == null) { - deviceListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder>( - deviceList_, - ((bitField0_ & 0x00000008) != 0), + policy.Policy.PolicyRuleService, policy.Policy.PolicyRuleService.Builder, policy.Policy.PolicyRuleServiceOrBuilder> + getPolicyRuleServiceListFieldBuilder() { + if (policyRuleServiceListBuilder_ == null) { + policyRuleServiceListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + policy.Policy.PolicyRuleService, policy.Policy.PolicyRuleService.Builder, policy.Policy.PolicyRuleServiceOrBuilder>( + policyRuleServiceList_, + ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - deviceList_ = null; + policyRuleServiceList_ = null; } - return deviceListBuilder_; + return policyRuleServiceListBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -7983,99 +7638,99 @@ public final class Policy { } - // @@protoc_insertion_point(builder_scope:policy.PolicyRule) + // @@protoc_insertion_point(builder_scope:policy.PolicyRuleServiceList) } - // @@protoc_insertion_point(class_scope:policy.PolicyRule) - private static final policy.Policy.PolicyRule DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:policy.PolicyRuleServiceList) + private static final policy.Policy.PolicyRuleServiceList DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new policy.Policy.PolicyRule(); + DEFAULT_INSTANCE = new policy.Policy.PolicyRuleServiceList(); } - public static policy.Policy.PolicyRule getDefaultInstance() { + public static policy.Policy.PolicyRuleServiceList getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser<PolicyRule> - PARSER = new com.google.protobuf.AbstractParser<PolicyRule>() { + private static final com.google.protobuf.Parser<PolicyRuleServiceList> + PARSER = new com.google.protobuf.AbstractParser<PolicyRuleServiceList>() { @java.lang.Override - public PolicyRule parsePartialFrom( + public PolicyRuleServiceList parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new PolicyRule(input, extensionRegistry); + return new PolicyRuleServiceList(input, extensionRegistry); } }; - public static com.google.protobuf.Parser<PolicyRule> parser() { + public static com.google.protobuf.Parser<PolicyRuleServiceList> parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser<PolicyRule> getParserForType() { + public com.google.protobuf.Parser<PolicyRuleServiceList> getParserForType() { return PARSER; } @java.lang.Override - public policy.Policy.PolicyRule getDefaultInstanceForType() { + public policy.Policy.PolicyRuleServiceList getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface PolicyRuleListOrBuilder extends - // @@protoc_insertion_point(interface_extends:policy.PolicyRuleList) + public interface PolicyRuleDeviceListOrBuilder extends + // @@protoc_insertion_point(interface_extends:policy.PolicyRuleDeviceList) com.google.protobuf.MessageOrBuilder { /** - * <code>repeated .policy.PolicyRule policyRuleList = 1;</code> + * <code>repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1;</code> */ - java.util.List<policy.Policy.PolicyRule> - getPolicyRuleListList(); + java.util.List<policy.Policy.PolicyRuleDevice> + getPolicyRuleDeviceListList(); /** - * <code>repeated .policy.PolicyRule policyRuleList = 1;</code> + * <code>repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1;</code> */ - policy.Policy.PolicyRule getPolicyRuleList(int index); + policy.Policy.PolicyRuleDevice getPolicyRuleDeviceList(int index); /** - * <code>repeated .policy.PolicyRule policyRuleList = 1;</code> + * <code>repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1;</code> */ - int getPolicyRuleListCount(); + int getPolicyRuleDeviceListCount(); /** - * <code>repeated .policy.PolicyRule policyRuleList = 1;</code> + * <code>repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1;</code> */ - java.util.List<? extends policy.Policy.PolicyRuleOrBuilder> - getPolicyRuleListOrBuilderList(); + java.util.List<? extends policy.Policy.PolicyRuleDeviceOrBuilder> + getPolicyRuleDeviceListOrBuilderList(); /** - * <code>repeated .policy.PolicyRule policyRuleList = 1;</code> + * <code>repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1;</code> */ - policy.Policy.PolicyRuleOrBuilder getPolicyRuleListOrBuilder( + policy.Policy.PolicyRuleDeviceOrBuilder getPolicyRuleDeviceListOrBuilder( int index); } /** * <pre> - * A list of policy rules + * A list of device-oriented policy rules * </pre> * - * Protobuf type {@code policy.PolicyRuleList} + * Protobuf type {@code policy.PolicyRuleDeviceList} */ - public static final class PolicyRuleList extends + public static final class PolicyRuleDeviceList extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:policy.PolicyRuleList) - PolicyRuleListOrBuilder { + // @@protoc_insertion_point(message_implements:policy.PolicyRuleDeviceList) + PolicyRuleDeviceListOrBuilder { private static final long serialVersionUID = 0L; - // Use PolicyRuleList.newBuilder() to construct. - private PolicyRuleList(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + // Use PolicyRuleDeviceList.newBuilder() to construct. + private PolicyRuleDeviceList(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } - private PolicyRuleList() { - policyRuleList_ = java.util.Collections.emptyList(); + private PolicyRuleDeviceList() { + policyRuleDeviceList_ = java.util.Collections.emptyList(); } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new PolicyRuleList(); + return new PolicyRuleDeviceList(); } @java.lang.Override @@ -8083,7 +7738,7 @@ public final class Policy { getUnknownFields() { return this.unknownFields; } - private PolicyRuleList( + private PolicyRuleDeviceList( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -8104,11 +7759,11 @@ public final class Policy { break; case 10: { if (!((mutable_bitField0_ & 0x00000001) != 0)) { - policyRuleList_ = new java.util.ArrayList<policy.Policy.PolicyRule>(); + policyRuleDeviceList_ = new java.util.ArrayList<policy.Policy.PolicyRuleDevice>(); mutable_bitField0_ |= 0x00000001; } - policyRuleList_.add( - input.readMessage(policy.Policy.PolicyRule.parser(), extensionRegistry)); + policyRuleDeviceList_.add( + input.readMessage(policy.Policy.PolicyRuleDevice.parser(), extensionRegistry)); break; } default: { @@ -8127,7 +7782,7 @@ public final class Policy { e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) != 0)) { - policyRuleList_ = java.util.Collections.unmodifiableList(policyRuleList_); + policyRuleDeviceList_ = java.util.Collections.unmodifiableList(policyRuleDeviceList_); } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); @@ -8135,55 +7790,55 @@ public final class Policy { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return policy.Policy.internal_static_policy_PolicyRuleList_descriptor; + return policy.Policy.internal_static_policy_PolicyRuleDeviceList_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return policy.Policy.internal_static_policy_PolicyRuleList_fieldAccessorTable + return policy.Policy.internal_static_policy_PolicyRuleDeviceList_fieldAccessorTable .ensureFieldAccessorsInitialized( - policy.Policy.PolicyRuleList.class, policy.Policy.PolicyRuleList.Builder.class); + policy.Policy.PolicyRuleDeviceList.class, policy.Policy.PolicyRuleDeviceList.Builder.class); } - public static final int POLICYRULELIST_FIELD_NUMBER = 1; - private java.util.List<policy.Policy.PolicyRule> policyRuleList_; + public static final int POLICYRULEDEVICELIST_FIELD_NUMBER = 1; + private java.util.List<policy.Policy.PolicyRuleDevice> policyRuleDeviceList_; /** - * <code>repeated .policy.PolicyRule policyRuleList = 1;</code> + * <code>repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1;</code> */ @java.lang.Override - public java.util.List<policy.Policy.PolicyRule> getPolicyRuleListList() { - return policyRuleList_; + public java.util.List<policy.Policy.PolicyRuleDevice> getPolicyRuleDeviceListList() { + return policyRuleDeviceList_; } /** - * <code>repeated .policy.PolicyRule policyRuleList = 1;</code> + * <code>repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1;</code> */ @java.lang.Override - public java.util.List<? extends policy.Policy.PolicyRuleOrBuilder> - getPolicyRuleListOrBuilderList() { - return policyRuleList_; + public java.util.List<? extends policy.Policy.PolicyRuleDeviceOrBuilder> + getPolicyRuleDeviceListOrBuilderList() { + return policyRuleDeviceList_; } /** - * <code>repeated .policy.PolicyRule policyRuleList = 1;</code> + * <code>repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1;</code> */ @java.lang.Override - public int getPolicyRuleListCount() { - return policyRuleList_.size(); + public int getPolicyRuleDeviceListCount() { + return policyRuleDeviceList_.size(); } /** - * <code>repeated .policy.PolicyRule policyRuleList = 1;</code> + * <code>repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1;</code> */ @java.lang.Override - public policy.Policy.PolicyRule getPolicyRuleList(int index) { - return policyRuleList_.get(index); + public policy.Policy.PolicyRuleDevice getPolicyRuleDeviceList(int index) { + return policyRuleDeviceList_.get(index); } /** - * <code>repeated .policy.PolicyRule policyRuleList = 1;</code> + * <code>repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1;</code> */ @java.lang.Override - public policy.Policy.PolicyRuleOrBuilder getPolicyRuleListOrBuilder( + public policy.Policy.PolicyRuleDeviceOrBuilder getPolicyRuleDeviceListOrBuilder( int index) { - return policyRuleList_.get(index); + return policyRuleDeviceList_.get(index); } private byte memoizedIsInitialized = -1; @@ -8200,8 +7855,8 @@ public final class Policy { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < policyRuleList_.size(); i++) { - output.writeMessage(1, policyRuleList_.get(i)); + for (int i = 0; i < policyRuleDeviceList_.size(); i++) { + output.writeMessage(1, policyRuleDeviceList_.get(i)); } unknownFields.writeTo(output); } @@ -8212,9 +7867,9 @@ public final class Policy { if (size != -1) return size; size = 0; - for (int i = 0; i < policyRuleList_.size(); i++) { + for (int i = 0; i < policyRuleDeviceList_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, policyRuleList_.get(i)); + .computeMessageSize(1, policyRuleDeviceList_.get(i)); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -8226,13 +7881,13 @@ public final class Policy { if (obj == this) { return true; } - if (!(obj instanceof policy.Policy.PolicyRuleList)) { + if (!(obj instanceof policy.Policy.PolicyRuleDeviceList)) { return super.equals(obj); } - policy.Policy.PolicyRuleList other = (policy.Policy.PolicyRuleList) obj; + policy.Policy.PolicyRuleDeviceList other = (policy.Policy.PolicyRuleDeviceList) obj; - if (!getPolicyRuleListList() - .equals(other.getPolicyRuleListList())) return false; + if (!getPolicyRuleDeviceListList() + .equals(other.getPolicyRuleDeviceListList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -8244,78 +7899,78 @@ public final class Policy { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (getPolicyRuleListCount() > 0) { - hash = (37 * hash) + POLICYRULELIST_FIELD_NUMBER; - hash = (53 * hash) + getPolicyRuleListList().hashCode(); + if (getPolicyRuleDeviceListCount() > 0) { + hash = (37 * hash) + POLICYRULEDEVICELIST_FIELD_NUMBER; + hash = (53 * hash) + getPolicyRuleDeviceListList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static policy.Policy.PolicyRuleList parseFrom( + public static policy.Policy.PolicyRuleDeviceList parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static policy.Policy.PolicyRuleList parseFrom( + public static policy.Policy.PolicyRuleDeviceList parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static policy.Policy.PolicyRuleList parseFrom( + public static policy.Policy.PolicyRuleDeviceList parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static policy.Policy.PolicyRuleList parseFrom( + public static policy.Policy.PolicyRuleDeviceList parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static policy.Policy.PolicyRuleList parseFrom(byte[] data) + public static policy.Policy.PolicyRuleDeviceList parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static policy.Policy.PolicyRuleList parseFrom( + public static policy.Policy.PolicyRuleDeviceList parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static policy.Policy.PolicyRuleList parseFrom(java.io.InputStream input) + public static policy.Policy.PolicyRuleDeviceList parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static policy.Policy.PolicyRuleList parseFrom( + public static policy.Policy.PolicyRuleDeviceList parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } - public static policy.Policy.PolicyRuleList parseDelimitedFrom(java.io.InputStream input) + public static policy.Policy.PolicyRuleDeviceList parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static policy.Policy.PolicyRuleList parseDelimitedFrom( + public static policy.Policy.PolicyRuleDeviceList parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static policy.Policy.PolicyRuleList parseFrom( + public static policy.Policy.PolicyRuleDeviceList parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static policy.Policy.PolicyRuleList parseFrom( + public static policy.Policy.PolicyRuleDeviceList parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -8328,7 +7983,7 @@ public final class Policy { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(policy.Policy.PolicyRuleList prototype) { + public static Builder newBuilder(policy.Policy.PolicyRuleDeviceList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -8345,29 +8000,29 @@ public final class Policy { } /** * <pre> - * A list of policy rules + * A list of device-oriented policy rules * </pre> * - * Protobuf type {@code policy.PolicyRuleList} + * Protobuf type {@code policy.PolicyRuleDeviceList} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements - // @@protoc_insertion_point(builder_implements:policy.PolicyRuleList) - policy.Policy.PolicyRuleListOrBuilder { + // @@protoc_insertion_point(builder_implements:policy.PolicyRuleDeviceList) + policy.Policy.PolicyRuleDeviceListOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return policy.Policy.internal_static_policy_PolicyRuleList_descriptor; + return policy.Policy.internal_static_policy_PolicyRuleDeviceList_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return policy.Policy.internal_static_policy_PolicyRuleList_fieldAccessorTable + return policy.Policy.internal_static_policy_PolicyRuleDeviceList_fieldAccessorTable .ensureFieldAccessorsInitialized( - policy.Policy.PolicyRuleList.class, policy.Policy.PolicyRuleList.Builder.class); + policy.Policy.PolicyRuleDeviceList.class, policy.Policy.PolicyRuleDeviceList.Builder.class); } - // Construct using policy.Policy.PolicyRuleList.newBuilder() + // Construct using policy.Policy.PolicyRuleDeviceList.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -8380,17 +8035,17 @@ public final class Policy { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { - getPolicyRuleListFieldBuilder(); + getPolicyRuleDeviceListFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (policyRuleListBuilder_ == null) { - policyRuleList_ = java.util.Collections.emptyList(); + if (policyRuleDeviceListBuilder_ == null) { + policyRuleDeviceList_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); } else { - policyRuleListBuilder_.clear(); + policyRuleDeviceListBuilder_.clear(); } return this; } @@ -8398,17 +8053,17 @@ public final class Policy { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return policy.Policy.internal_static_policy_PolicyRuleList_descriptor; + return policy.Policy.internal_static_policy_PolicyRuleDeviceList_descriptor; } @java.lang.Override - public policy.Policy.PolicyRuleList getDefaultInstanceForType() { - return policy.Policy.PolicyRuleList.getDefaultInstance(); + public policy.Policy.PolicyRuleDeviceList getDefaultInstanceForType() { + return policy.Policy.PolicyRuleDeviceList.getDefaultInstance(); } @java.lang.Override - public policy.Policy.PolicyRuleList build() { - policy.Policy.PolicyRuleList result = buildPartial(); + public policy.Policy.PolicyRuleDeviceList build() { + policy.Policy.PolicyRuleDeviceList result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -8416,17 +8071,17 @@ public final class Policy { } @java.lang.Override - public policy.Policy.PolicyRuleList buildPartial() { - policy.Policy.PolicyRuleList result = new policy.Policy.PolicyRuleList(this); + public policy.Policy.PolicyRuleDeviceList buildPartial() { + policy.Policy.PolicyRuleDeviceList result = new policy.Policy.PolicyRuleDeviceList(this); int from_bitField0_ = bitField0_; - if (policyRuleListBuilder_ == null) { + if (policyRuleDeviceListBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { - policyRuleList_ = java.util.Collections.unmodifiableList(policyRuleList_); + policyRuleDeviceList_ = java.util.Collections.unmodifiableList(policyRuleDeviceList_); bitField0_ = (bitField0_ & ~0x00000001); } - result.policyRuleList_ = policyRuleList_; + result.policyRuleDeviceList_ = policyRuleDeviceList_; } else { - result.policyRuleList_ = policyRuleListBuilder_.build(); + result.policyRuleDeviceList_ = policyRuleDeviceListBuilder_.build(); } onBuilt(); return result; @@ -8466,39 +8121,39 @@ public final class Policy { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof policy.Policy.PolicyRuleList) { - return mergeFrom((policy.Policy.PolicyRuleList)other); + if (other instanceof policy.Policy.PolicyRuleDeviceList) { + return mergeFrom((policy.Policy.PolicyRuleDeviceList)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(policy.Policy.PolicyRuleList other) { - if (other == policy.Policy.PolicyRuleList.getDefaultInstance()) return this; - if (policyRuleListBuilder_ == null) { - if (!other.policyRuleList_.isEmpty()) { - if (policyRuleList_.isEmpty()) { - policyRuleList_ = other.policyRuleList_; + public Builder mergeFrom(policy.Policy.PolicyRuleDeviceList other) { + if (other == policy.Policy.PolicyRuleDeviceList.getDefaultInstance()) return this; + if (policyRuleDeviceListBuilder_ == null) { + if (!other.policyRuleDeviceList_.isEmpty()) { + if (policyRuleDeviceList_.isEmpty()) { + policyRuleDeviceList_ = other.policyRuleDeviceList_; bitField0_ = (bitField0_ & ~0x00000001); } else { - ensurePolicyRuleListIsMutable(); - policyRuleList_.addAll(other.policyRuleList_); + ensurePolicyRuleDeviceListIsMutable(); + policyRuleDeviceList_.addAll(other.policyRuleDeviceList_); } onChanged(); } } else { - if (!other.policyRuleList_.isEmpty()) { - if (policyRuleListBuilder_.isEmpty()) { - policyRuleListBuilder_.dispose(); - policyRuleListBuilder_ = null; - policyRuleList_ = other.policyRuleList_; + if (!other.policyRuleDeviceList_.isEmpty()) { + if (policyRuleDeviceListBuilder_.isEmpty()) { + policyRuleDeviceListBuilder_.dispose(); + policyRuleDeviceListBuilder_ = null; + policyRuleDeviceList_ = other.policyRuleDeviceList_; bitField0_ = (bitField0_ & ~0x00000001); - policyRuleListBuilder_ = + policyRuleDeviceListBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getPolicyRuleListFieldBuilder() : null; + getPolicyRuleDeviceListFieldBuilder() : null; } else { - policyRuleListBuilder_.addAllMessages(other.policyRuleList_); + policyRuleDeviceListBuilder_.addAllMessages(other.policyRuleDeviceList_); } } } @@ -8517,11 +8172,11 @@ public final class Policy { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - policy.Policy.PolicyRuleList parsedMessage = null; + policy.Policy.PolicyRuleDeviceList parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (policy.Policy.PolicyRuleList) e.getUnfinishedMessage(); + parsedMessage = (policy.Policy.PolicyRuleDeviceList) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -8532,244 +8187,244 @@ public final class Policy { } private int bitField0_; - private java.util.List<policy.Policy.PolicyRule> policyRuleList_ = + private java.util.List<policy.Policy.PolicyRuleDevice> policyRuleDeviceList_ = java.util.Collections.emptyList(); - private void ensurePolicyRuleListIsMutable() { + private void ensurePolicyRuleDeviceListIsMutable() { if (!((bitField0_ & 0x00000001) != 0)) { - policyRuleList_ = new java.util.ArrayList<policy.Policy.PolicyRule>(policyRuleList_); + policyRuleDeviceList_ = new java.util.ArrayList<policy.Policy.PolicyRuleDevice>(policyRuleDeviceList_); bitField0_ |= 0x00000001; } } private com.google.protobuf.RepeatedFieldBuilderV3< - policy.Policy.PolicyRule, policy.Policy.PolicyRule.Builder, policy.Policy.PolicyRuleOrBuilder> policyRuleListBuilder_; + policy.Policy.PolicyRuleDevice, policy.Policy.PolicyRuleDevice.Builder, policy.Policy.PolicyRuleDeviceOrBuilder> policyRuleDeviceListBuilder_; /** - * <code>repeated .policy.PolicyRule policyRuleList = 1;</code> + * <code>repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1;</code> */ - public java.util.List<policy.Policy.PolicyRule> getPolicyRuleListList() { - if (policyRuleListBuilder_ == null) { - return java.util.Collections.unmodifiableList(policyRuleList_); + public java.util.List<policy.Policy.PolicyRuleDevice> getPolicyRuleDeviceListList() { + if (policyRuleDeviceListBuilder_ == null) { + return java.util.Collections.unmodifiableList(policyRuleDeviceList_); } else { - return policyRuleListBuilder_.getMessageList(); + return policyRuleDeviceListBuilder_.getMessageList(); } } /** - * <code>repeated .policy.PolicyRule policyRuleList = 1;</code> + * <code>repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1;</code> */ - public int getPolicyRuleListCount() { - if (policyRuleListBuilder_ == null) { - return policyRuleList_.size(); + public int getPolicyRuleDeviceListCount() { + if (policyRuleDeviceListBuilder_ == null) { + return policyRuleDeviceList_.size(); } else { - return policyRuleListBuilder_.getCount(); + return policyRuleDeviceListBuilder_.getCount(); } } /** - * <code>repeated .policy.PolicyRule policyRuleList = 1;</code> + * <code>repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1;</code> */ - public policy.Policy.PolicyRule getPolicyRuleList(int index) { - if (policyRuleListBuilder_ == null) { - return policyRuleList_.get(index); + public policy.Policy.PolicyRuleDevice getPolicyRuleDeviceList(int index) { + if (policyRuleDeviceListBuilder_ == null) { + return policyRuleDeviceList_.get(index); } else { - return policyRuleListBuilder_.getMessage(index); + return policyRuleDeviceListBuilder_.getMessage(index); } } /** - * <code>repeated .policy.PolicyRule policyRuleList = 1;</code> + * <code>repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1;</code> */ - public Builder setPolicyRuleList( - int index, policy.Policy.PolicyRule value) { - if (policyRuleListBuilder_ == null) { + public Builder setPolicyRuleDeviceList( + int index, policy.Policy.PolicyRuleDevice value) { + if (policyRuleDeviceListBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensurePolicyRuleListIsMutable(); - policyRuleList_.set(index, value); + ensurePolicyRuleDeviceListIsMutable(); + policyRuleDeviceList_.set(index, value); onChanged(); } else { - policyRuleListBuilder_.setMessage(index, value); + policyRuleDeviceListBuilder_.setMessage(index, value); } return this; } /** - * <code>repeated .policy.PolicyRule policyRuleList = 1;</code> + * <code>repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1;</code> */ - public Builder setPolicyRuleList( - int index, policy.Policy.PolicyRule.Builder builderForValue) { - if (policyRuleListBuilder_ == null) { - ensurePolicyRuleListIsMutable(); - policyRuleList_.set(index, builderForValue.build()); + public Builder setPolicyRuleDeviceList( + int index, policy.Policy.PolicyRuleDevice.Builder builderForValue) { + if (policyRuleDeviceListBuilder_ == null) { + ensurePolicyRuleDeviceListIsMutable(); + policyRuleDeviceList_.set(index, builderForValue.build()); onChanged(); } else { - policyRuleListBuilder_.setMessage(index, builderForValue.build()); + policyRuleDeviceListBuilder_.setMessage(index, builderForValue.build()); } return this; } /** - * <code>repeated .policy.PolicyRule policyRuleList = 1;</code> + * <code>repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1;</code> */ - public Builder addPolicyRuleList(policy.Policy.PolicyRule value) { - if (policyRuleListBuilder_ == null) { + public Builder addPolicyRuleDeviceList(policy.Policy.PolicyRuleDevice value) { + if (policyRuleDeviceListBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensurePolicyRuleListIsMutable(); - policyRuleList_.add(value); + ensurePolicyRuleDeviceListIsMutable(); + policyRuleDeviceList_.add(value); onChanged(); } else { - policyRuleListBuilder_.addMessage(value); + policyRuleDeviceListBuilder_.addMessage(value); } return this; } /** - * <code>repeated .policy.PolicyRule policyRuleList = 1;</code> + * <code>repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1;</code> */ - public Builder addPolicyRuleList( - int index, policy.Policy.PolicyRule value) { - if (policyRuleListBuilder_ == null) { + public Builder addPolicyRuleDeviceList( + int index, policy.Policy.PolicyRuleDevice value) { + if (policyRuleDeviceListBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensurePolicyRuleListIsMutable(); - policyRuleList_.add(index, value); + ensurePolicyRuleDeviceListIsMutable(); + policyRuleDeviceList_.add(index, value); onChanged(); } else { - policyRuleListBuilder_.addMessage(index, value); + policyRuleDeviceListBuilder_.addMessage(index, value); } return this; } /** - * <code>repeated .policy.PolicyRule policyRuleList = 1;</code> + * <code>repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1;</code> */ - public Builder addPolicyRuleList( - policy.Policy.PolicyRule.Builder builderForValue) { - if (policyRuleListBuilder_ == null) { - ensurePolicyRuleListIsMutable(); - policyRuleList_.add(builderForValue.build()); + public Builder addPolicyRuleDeviceList( + policy.Policy.PolicyRuleDevice.Builder builderForValue) { + if (policyRuleDeviceListBuilder_ == null) { + ensurePolicyRuleDeviceListIsMutable(); + policyRuleDeviceList_.add(builderForValue.build()); onChanged(); } else { - policyRuleListBuilder_.addMessage(builderForValue.build()); + policyRuleDeviceListBuilder_.addMessage(builderForValue.build()); } return this; } /** - * <code>repeated .policy.PolicyRule policyRuleList = 1;</code> + * <code>repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1;</code> */ - public Builder addPolicyRuleList( - int index, policy.Policy.PolicyRule.Builder builderForValue) { - if (policyRuleListBuilder_ == null) { - ensurePolicyRuleListIsMutable(); - policyRuleList_.add(index, builderForValue.build()); + public Builder addPolicyRuleDeviceList( + int index, policy.Policy.PolicyRuleDevice.Builder builderForValue) { + if (policyRuleDeviceListBuilder_ == null) { + ensurePolicyRuleDeviceListIsMutable(); + policyRuleDeviceList_.add(index, builderForValue.build()); onChanged(); } else { - policyRuleListBuilder_.addMessage(index, builderForValue.build()); + policyRuleDeviceListBuilder_.addMessage(index, builderForValue.build()); } return this; } /** - * <code>repeated .policy.PolicyRule policyRuleList = 1;</code> + * <code>repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1;</code> */ - public Builder addAllPolicyRuleList( - java.lang.Iterable<? extends policy.Policy.PolicyRule> values) { - if (policyRuleListBuilder_ == null) { - ensurePolicyRuleListIsMutable(); + public Builder addAllPolicyRuleDeviceList( + java.lang.Iterable<? extends policy.Policy.PolicyRuleDevice> values) { + if (policyRuleDeviceListBuilder_ == null) { + ensurePolicyRuleDeviceListIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, policyRuleList_); + values, policyRuleDeviceList_); onChanged(); } else { - policyRuleListBuilder_.addAllMessages(values); + policyRuleDeviceListBuilder_.addAllMessages(values); } return this; } /** - * <code>repeated .policy.PolicyRule policyRuleList = 1;</code> + * <code>repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1;</code> */ - public Builder clearPolicyRuleList() { - if (policyRuleListBuilder_ == null) { - policyRuleList_ = java.util.Collections.emptyList(); + public Builder clearPolicyRuleDeviceList() { + if (policyRuleDeviceListBuilder_ == null) { + policyRuleDeviceList_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { - policyRuleListBuilder_.clear(); + policyRuleDeviceListBuilder_.clear(); } return this; } /** - * <code>repeated .policy.PolicyRule policyRuleList = 1;</code> + * <code>repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1;</code> */ - public Builder removePolicyRuleList(int index) { - if (policyRuleListBuilder_ == null) { - ensurePolicyRuleListIsMutable(); - policyRuleList_.remove(index); + public Builder removePolicyRuleDeviceList(int index) { + if (policyRuleDeviceListBuilder_ == null) { + ensurePolicyRuleDeviceListIsMutable(); + policyRuleDeviceList_.remove(index); onChanged(); } else { - policyRuleListBuilder_.remove(index); + policyRuleDeviceListBuilder_.remove(index); } return this; } /** - * <code>repeated .policy.PolicyRule policyRuleList = 1;</code> + * <code>repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1;</code> */ - public policy.Policy.PolicyRule.Builder getPolicyRuleListBuilder( + public policy.Policy.PolicyRuleDevice.Builder getPolicyRuleDeviceListBuilder( int index) { - return getPolicyRuleListFieldBuilder().getBuilder(index); + return getPolicyRuleDeviceListFieldBuilder().getBuilder(index); } /** - * <code>repeated .policy.PolicyRule policyRuleList = 1;</code> + * <code>repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1;</code> */ - public policy.Policy.PolicyRuleOrBuilder getPolicyRuleListOrBuilder( + public policy.Policy.PolicyRuleDeviceOrBuilder getPolicyRuleDeviceListOrBuilder( int index) { - if (policyRuleListBuilder_ == null) { - return policyRuleList_.get(index); } else { - return policyRuleListBuilder_.getMessageOrBuilder(index); + if (policyRuleDeviceListBuilder_ == null) { + return policyRuleDeviceList_.get(index); } else { + return policyRuleDeviceListBuilder_.getMessageOrBuilder(index); } } /** - * <code>repeated .policy.PolicyRule policyRuleList = 1;</code> + * <code>repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1;</code> */ - public java.util.List<? extends policy.Policy.PolicyRuleOrBuilder> - getPolicyRuleListOrBuilderList() { - if (policyRuleListBuilder_ != null) { - return policyRuleListBuilder_.getMessageOrBuilderList(); + public java.util.List<? extends policy.Policy.PolicyRuleDeviceOrBuilder> + getPolicyRuleDeviceListOrBuilderList() { + if (policyRuleDeviceListBuilder_ != null) { + return policyRuleDeviceListBuilder_.getMessageOrBuilderList(); } else { - return java.util.Collections.unmodifiableList(policyRuleList_); + return java.util.Collections.unmodifiableList(policyRuleDeviceList_); } } /** - * <code>repeated .policy.PolicyRule policyRuleList = 1;</code> + * <code>repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1;</code> */ - public policy.Policy.PolicyRule.Builder addPolicyRuleListBuilder() { - return getPolicyRuleListFieldBuilder().addBuilder( - policy.Policy.PolicyRule.getDefaultInstance()); + public policy.Policy.PolicyRuleDevice.Builder addPolicyRuleDeviceListBuilder() { + return getPolicyRuleDeviceListFieldBuilder().addBuilder( + policy.Policy.PolicyRuleDevice.getDefaultInstance()); } /** - * <code>repeated .policy.PolicyRule policyRuleList = 1;</code> + * <code>repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1;</code> */ - public policy.Policy.PolicyRule.Builder addPolicyRuleListBuilder( + public policy.Policy.PolicyRuleDevice.Builder addPolicyRuleDeviceListBuilder( int index) { - return getPolicyRuleListFieldBuilder().addBuilder( - index, policy.Policy.PolicyRule.getDefaultInstance()); + return getPolicyRuleDeviceListFieldBuilder().addBuilder( + index, policy.Policy.PolicyRuleDevice.getDefaultInstance()); } /** - * <code>repeated .policy.PolicyRule policyRuleList = 1;</code> + * <code>repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1;</code> */ - public java.util.List<policy.Policy.PolicyRule.Builder> - getPolicyRuleListBuilderList() { - return getPolicyRuleListFieldBuilder().getBuilderList(); + public java.util.List<policy.Policy.PolicyRuleDevice.Builder> + getPolicyRuleDeviceListBuilderList() { + return getPolicyRuleDeviceListFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< - policy.Policy.PolicyRule, policy.Policy.PolicyRule.Builder, policy.Policy.PolicyRuleOrBuilder> - getPolicyRuleListFieldBuilder() { - if (policyRuleListBuilder_ == null) { - policyRuleListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - policy.Policy.PolicyRule, policy.Policy.PolicyRule.Builder, policy.Policy.PolicyRuleOrBuilder>( - policyRuleList_, + policy.Policy.PolicyRuleDevice, policy.Policy.PolicyRuleDevice.Builder, policy.Policy.PolicyRuleDeviceOrBuilder> + getPolicyRuleDeviceListFieldBuilder() { + if (policyRuleDeviceListBuilder_ == null) { + policyRuleDeviceListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + policy.Policy.PolicyRuleDevice, policy.Policy.PolicyRuleDevice.Builder, policy.Policy.PolicyRuleDeviceOrBuilder>( + policyRuleDeviceList_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - policyRuleList_ = null; + policyRuleDeviceList_ = null; } - return policyRuleListBuilder_; + return policyRuleDeviceListBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -8784,41 +8439,41 @@ public final class Policy { } - // @@protoc_insertion_point(builder_scope:policy.PolicyRuleList) + // @@protoc_insertion_point(builder_scope:policy.PolicyRuleDeviceList) } - // @@protoc_insertion_point(class_scope:policy.PolicyRuleList) - private static final policy.Policy.PolicyRuleList DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:policy.PolicyRuleDeviceList) + private static final policy.Policy.PolicyRuleDeviceList DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new policy.Policy.PolicyRuleList(); + DEFAULT_INSTANCE = new policy.Policy.PolicyRuleDeviceList(); } - public static policy.Policy.PolicyRuleList getDefaultInstance() { + public static policy.Policy.PolicyRuleDeviceList getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser<PolicyRuleList> - PARSER = new com.google.protobuf.AbstractParser<PolicyRuleList>() { + private static final com.google.protobuf.Parser<PolicyRuleDeviceList> + PARSER = new com.google.protobuf.AbstractParser<PolicyRuleDeviceList>() { @java.lang.Override - public PolicyRuleList parsePartialFrom( + public PolicyRuleDeviceList parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new PolicyRuleList(input, extensionRegistry); + return new PolicyRuleDeviceList(input, extensionRegistry); } }; - public static com.google.protobuf.Parser<PolicyRuleList> parser() { + public static com.google.protobuf.Parser<PolicyRuleDeviceList> parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser<PolicyRuleList> getParserForType() { + public com.google.protobuf.Parser<PolicyRuleDeviceList> getParserForType() { return PARSER; } @java.lang.Override - public policy.Policy.PolicyRuleList getDefaultInstanceForType() { + public policy.Policy.PolicyRuleDeviceList getDefaultInstanceForType() { return DEFAULT_INSTANCE; } @@ -8835,40 +8490,35 @@ public final class Policy { com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_policy_PolicyRuleState_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_policy_PolicyRuleVariable_descriptor; + internal_static_policy_PolicyRuleBasic_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_policy_PolicyRuleVariable_fieldAccessorTable; + internal_static_policy_PolicyRuleBasic_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_policy_PolicyRuleValue_descriptor; + internal_static_policy_PolicyRuleService_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_policy_PolicyRuleValue_fieldAccessorTable; + internal_static_policy_PolicyRuleService_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_policy_PolicyRuleEvent_descriptor; + internal_static_policy_PolicyRuleDevice_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_policy_PolicyRuleEvent_fieldAccessorTable; + internal_static_policy_PolicyRuleDevice_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_policy_PolicyRuleCondition_descriptor; + internal_static_policy_PolicyRuleIdList_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_policy_PolicyRuleCondition_fieldAccessorTable; + internal_static_policy_PolicyRuleIdList_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_policy_PolicyRuleAction_descriptor; + internal_static_policy_PolicyRuleServiceList_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_policy_PolicyRuleAction_fieldAccessorTable; + internal_static_policy_PolicyRuleServiceList_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_policy_PolicyRule_descriptor; + internal_static_policy_PolicyRuleDeviceList_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_policy_PolicyRule_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_policy_PolicyRuleList_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_policy_PolicyRuleList_fieldAccessorTable; + internal_static_policy_PolicyRuleDeviceList_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -8878,50 +8528,59 @@ public final class Policy { descriptor; static { java.lang.String[] descriptorData = { - "\n\014policy.proto\022\006policy\032\rcontext.proto\"+\n" + - "\014PolicyRuleId\022\033\n\004uuid\030\001 \001(\0132\r.context.Uu" + - "id\"b\n\017PolicyRuleState\022#\n\014policyRuleId\030\001 " + - "\001(\0132\r.context.Uuid\022*\n\017policyRuleState\030\002 " + - "\001(\0162\021.policy.RuleState\"0\n\022PolicyRuleVari" + - "able\022\032\n\022policyRuleVariable\030\001 \001(\t\"*\n\017Poli" + - "cyRuleValue\022\027\n\017policyRuleValue\030\001 \001(\t\"0\n\017" + - "PolicyRuleEvent\022\035\n\005event\030\001 \001(\0132\016.context" + - ".Event\"\204\001\n\023PolicyRuleCondition\0227\n\023polRul" + - "eConditionVar\030\001 \001(\0132\032.policy.PolicyRuleV" + - "ariable\0224\n\023polRuleConditionVal\030\002 \001(\0132\027.p" + - "olicy.PolicyRuleValue\"{\n\020PolicyRuleActio" + - "n\0224\n\020polRuleActionVar\030\001 \001(\0132\032.policy.Pol" + - "icyRuleVariable\0221\n\020polRuleActionVal\030\002 \001(" + - "\0132\027.policy.PolicyRuleValue\"\354\002\n\nPolicyRul" + - "e\022*\n\014policyRuleId\030\001 \001(\0132\024.policy.PolicyR" + - "uleId\022.\n\016policyRuleType\030\002 \001(\0162\026.policy.P" + - "olicyRuleType\022\032\n\022PolicyRulePriority\030\003 \001(" + - "\r\022&\n\005event\030\004 \001(\0132\027.policy.PolicyRuleEven" + - "t\0229\n\024polRuleConditionList\030\005 \003(\0132\033.policy" + - ".PolicyRuleCondition\0223\n\021polRuleActionLis" + - "t\030\006 \003(\0132\030.policy.PolicyRuleAction\022\'\n\013ser" + - "viceList\030\007 \003(\0132\022.context.ServiceId\022%\n\nde" + - "viceList\030\010 \003(\0132\021.context.DeviceId\"<\n\016Pol" + - "icyRuleList\022*\n\016policyRuleList\030\001 \003(\0132\022.po" + - "licy.PolicyRule*G\n\tRuleState\022\023\n\017POLICY_I" + - "NACTIVE\020\000\022\022\n\016POLICY_PLANNED\020\001\022\021\n\rPOLICY_" + - "ACTIVE\020\002*?\n\016PolicyRuleType\022\025\n\021POLICYTYPE" + - "_DEVICE\020\000\022\026\n\022POLICYTYPE_NETWORK\020\0012\214\003\n\rPo" + - "licyService\022:\n\tPolicyAdd\022\022.policy.Policy" + - "Rule\032\027.policy.PolicyRuleState\"\000\022=\n\014Polic" + - "yUpdate\022\022.policy.PolicyRule\032\027.policy.Pol" + - "icyRuleState\"\000\022=\n\014PolicyDelete\022\022.policy." + - "PolicyRule\032\027.policy.PolicyRuleState\"\000\0227\n" + - "\tGetPolicy\022\024.policy.PolicyRuleId\032\022.polic" + - "y.PolicyRule\"\000\022B\n\023GetPolicyByDeviceId\022\021." + - "context.DeviceId\032\026.policy.PolicyRuleList" + - "\"\000\022D\n\024GetPolicyByServiceId\022\022.context.Ser" + - "viceId\032\026.policy.PolicyRuleList\"\000b\006proto3" + "\n\014policy.proto\022\006policy\032\rcontext.proto\032\026p" + + "olicy-condition.proto\032\023policy-action.pro" + + "to\"+\n\014PolicyRuleId\022\033\n\004uuid\030\001 \001(\0132\r.conte" + + "xt.Uuid\"=\n\017PolicyRuleState\022*\n\017policyRule" + + "State\030\001 \001(\0162\021.policy.RuleState\"\256\002\n\017Polic" + + "yRuleBasic\022*\n\014policyRuleId\030\001 \001(\0132\024.polic" + + "y.PolicyRuleId\0225\n\017policyRuleState\030\002 \001(\0132" + + "\027.policy.PolicyRuleStateH\000\210\001\001\022\020\n\010priorit" + + "y\030\003 \001(\r\0222\n\rconditionList\030\004 \003(\0132\033.policy." + + "PolicyRuleCondition\0220\n\017booleanOperator\030\005" + + " \001(\0162\027.policy.BooleanOperator\022,\n\nactionL" + + "ist\030\006 \003(\0132\030.policy.PolicyRuleActionB\022\n\020_" + + "policyRuleState\"\223\001\n\021PolicyRuleService\0220\n" + + "\017policyRuleBasic\030\001 \001(\0132\027.policy.PolicyRu" + + "leBasic\022%\n\tserviceId\030\002 \001(\0132\022.context.Ser" + + "viceId\022%\n\ndeviceList\030\003 \003(\0132\021.context.Dev" + + "iceId\"k\n\020PolicyRuleDevice\0220\n\017policyRuleB" + + "asic\030\001 \001(\0132\027.policy.PolicyRuleBasic\022%\n\nd" + + "eviceList\030\002 \003(\0132\021.context.DeviceId\"B\n\020Po" + + "licyRuleIdList\022.\n\020policyRuleIdList\030\001 \003(\013" + + "2\024.policy.PolicyRuleId\"Q\n\025PolicyRuleServ" + + "iceList\0228\n\025policyRuleServiceList\030\001 \003(\0132\031" + + ".policy.PolicyRuleService\"N\n\024PolicyRuleD" + + "eviceList\0226\n\024policyRuleDeviceList\030\001 \003(\0132" + + "\030.policy.PolicyRuleDevice*\365\001\n\tRuleState\022" + + "\024\n\020POLICY_UNDEFINED\020\000\022\021\n\rPOLICY_FAILED\020\001" + + "\022\023\n\017POLICY_INSERTED\020\002\022\024\n\020POLICY_VALIDATE" + + "D\020\003\022\026\n\022POLICY_PROVISIONED\020\004\022\021\n\rPOLICY_AC" + + "TIVE\020\005\022\023\n\017POLICY_ENFORCED\020\006\022\026\n\022POLICY_IN" + + "EFFECTIVE\020\007\022\024\n\020POLICY_EFFECTIVE\020\010\022\022\n\016POL" + + "ICY_UPDATED\020\t\022\022\n\016POLICY_REMOVED\020\n2\323\004\n\rPo" + + "licyService\022H\n\020PolicyAddService\022\031.policy" + + ".PolicyRuleService\032\027.policy.PolicyRuleSt" + + "ate\"\000\022F\n\017PolicyAddDevice\022\030.policy.Policy" + + "RuleDevice\032\027.policy.PolicyRuleState\"\000\022K\n" + + "\023PolicyUpdateService\022\031.policy.PolicyRule" + + "Service\032\027.policy.PolicyRuleState\"\000\022I\n\022Po" + + "licyUpdateDevice\022\030.policy.PolicyRuleDevi" + + "ce\032\027.policy.PolicyRuleState\"\000\022?\n\014PolicyD" + + "elete\022\024.policy.PolicyRuleId\032\027.policy.Pol" + + "icyRuleState\"\000\022E\n\020GetPolicyService\022\024.pol" + + "icy.PolicyRuleId\032\031.policy.PolicyRuleServ" + + "ice\"\000\022C\n\017GetPolicyDevice\022\024.policy.Policy" + + "RuleId\032\030.policy.PolicyRuleDevice\"\000\022K\n\024Ge" + + "tPolicyByServiceId\022\022.context.ServiceId\032\035" + + ".policy.PolicyRuleServiceList\"\000b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { context.ContextOuterClass.getDescriptor(), + policy.PolicyCondition.getDescriptor(), + policy.PolicyAction.getDescriptor(), }); internal_static_policy_PolicyRuleId_descriptor = getDescriptor().getMessageTypes().get(0); @@ -8934,50 +8593,46 @@ public final class Policy { internal_static_policy_PolicyRuleState_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_policy_PolicyRuleState_descriptor, - new java.lang.String[] { "PolicyRuleId", "PolicyRuleState", }); - internal_static_policy_PolicyRuleVariable_descriptor = + new java.lang.String[] { "PolicyRuleState", }); + internal_static_policy_PolicyRuleBasic_descriptor = getDescriptor().getMessageTypes().get(2); - internal_static_policy_PolicyRuleVariable_fieldAccessorTable = new + internal_static_policy_PolicyRuleBasic_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_policy_PolicyRuleVariable_descriptor, - new java.lang.String[] { "PolicyRuleVariable", }); - internal_static_policy_PolicyRuleValue_descriptor = + internal_static_policy_PolicyRuleBasic_descriptor, + new java.lang.String[] { "PolicyRuleId", "PolicyRuleState", "Priority", "ConditionList", "BooleanOperator", "ActionList", "PolicyRuleState", }); + internal_static_policy_PolicyRuleService_descriptor = getDescriptor().getMessageTypes().get(3); - internal_static_policy_PolicyRuleValue_fieldAccessorTable = new + internal_static_policy_PolicyRuleService_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_policy_PolicyRuleValue_descriptor, - new java.lang.String[] { "PolicyRuleValue", }); - internal_static_policy_PolicyRuleEvent_descriptor = + internal_static_policy_PolicyRuleService_descriptor, + new java.lang.String[] { "PolicyRuleBasic", "ServiceId", "DeviceList", }); + internal_static_policy_PolicyRuleDevice_descriptor = getDescriptor().getMessageTypes().get(4); - internal_static_policy_PolicyRuleEvent_fieldAccessorTable = new + internal_static_policy_PolicyRuleDevice_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_policy_PolicyRuleEvent_descriptor, - new java.lang.String[] { "Event", }); - internal_static_policy_PolicyRuleCondition_descriptor = + internal_static_policy_PolicyRuleDevice_descriptor, + new java.lang.String[] { "PolicyRuleBasic", "DeviceList", }); + internal_static_policy_PolicyRuleIdList_descriptor = getDescriptor().getMessageTypes().get(5); - internal_static_policy_PolicyRuleCondition_fieldAccessorTable = new + internal_static_policy_PolicyRuleIdList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_policy_PolicyRuleCondition_descriptor, - new java.lang.String[] { "PolRuleConditionVar", "PolRuleConditionVal", }); - internal_static_policy_PolicyRuleAction_descriptor = + internal_static_policy_PolicyRuleIdList_descriptor, + new java.lang.String[] { "PolicyRuleIdList", }); + internal_static_policy_PolicyRuleServiceList_descriptor = getDescriptor().getMessageTypes().get(6); - internal_static_policy_PolicyRuleAction_fieldAccessorTable = new + internal_static_policy_PolicyRuleServiceList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_policy_PolicyRuleAction_descriptor, - new java.lang.String[] { "PolRuleActionVar", "PolRuleActionVal", }); - internal_static_policy_PolicyRule_descriptor = + internal_static_policy_PolicyRuleServiceList_descriptor, + new java.lang.String[] { "PolicyRuleServiceList", }); + internal_static_policy_PolicyRuleDeviceList_descriptor = getDescriptor().getMessageTypes().get(7); - internal_static_policy_PolicyRule_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_policy_PolicyRule_descriptor, - new java.lang.String[] { "PolicyRuleId", "PolicyRuleType", "PolicyRulePriority", "Event", "PolRuleConditionList", "PolRuleActionList", "ServiceList", "DeviceList", }); - internal_static_policy_PolicyRuleList_descriptor = - getDescriptor().getMessageTypes().get(8); - internal_static_policy_PolicyRuleList_fieldAccessorTable = new + internal_static_policy_PolicyRuleDeviceList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_policy_PolicyRuleList_descriptor, - new java.lang.String[] { "PolicyRuleList", }); + internal_static_policy_PolicyRuleDeviceList_descriptor, + new java.lang.String[] { "PolicyRuleDeviceList", }); context.ContextOuterClass.getDescriptor(); + policy.PolicyCondition.getDescriptor(); + policy.PolicyAction.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/src/policy/target/generated-sources/grpc/policy/PolicyAction.java b/src/policy/target/generated-sources/grpc/policy/PolicyAction.java new file mode 100644 index 0000000000000000000000000000000000000000..1baaf538dc031be9443984f640826ccd893290e4 --- /dev/null +++ b/src/policy/target/generated-sources/grpc/policy/PolicyAction.java @@ -0,0 +1,932 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: policy-action.proto + +package policy; + +public final class PolicyAction { + private PolicyAction() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + /** + * Protobuf enum {@code policy.PolicyRuleActionEnum} + */ + public enum PolicyRuleActionEnum + implements com.google.protobuf.ProtocolMessageEnum { + /** + * <code>POLICYRULE_ACTION_NO_ACTION = 0;</code> + */ + POLICYRULE_ACTION_NO_ACTION(0), + /** + * <code>POLICYRULE_ACTION_SET_DEVICE_STATUS = 1;</code> + */ + POLICYRULE_ACTION_SET_DEVICE_STATUS(1), + /** + * <code>POLICYRULE_ACTION_ADD_SERVICE_CONFIGRULE = 2;</code> + */ + POLICYRULE_ACTION_ADD_SERVICE_CONFIGRULE(2), + /** + * <code>POLICYRULE_ACTION_ADD_SERVICE_CONSTRAINT = 3;</code> + */ + POLICYRULE_ACTION_ADD_SERVICE_CONSTRAINT(3), + UNRECOGNIZED(-1), + ; + + /** + * <code>POLICYRULE_ACTION_NO_ACTION = 0;</code> + */ + public static final int POLICYRULE_ACTION_NO_ACTION_VALUE = 0; + /** + * <code>POLICYRULE_ACTION_SET_DEVICE_STATUS = 1;</code> + */ + public static final int POLICYRULE_ACTION_SET_DEVICE_STATUS_VALUE = 1; + /** + * <code>POLICYRULE_ACTION_ADD_SERVICE_CONFIGRULE = 2;</code> + */ + public static final int POLICYRULE_ACTION_ADD_SERVICE_CONFIGRULE_VALUE = 2; + /** + * <code>POLICYRULE_ACTION_ADD_SERVICE_CONSTRAINT = 3;</code> + */ + public static final int POLICYRULE_ACTION_ADD_SERVICE_CONSTRAINT_VALUE = 3; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PolicyRuleActionEnum valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static PolicyRuleActionEnum forNumber(int value) { + switch (value) { + case 0: return POLICYRULE_ACTION_NO_ACTION; + case 1: return POLICYRULE_ACTION_SET_DEVICE_STATUS; + case 2: return POLICYRULE_ACTION_ADD_SERVICE_CONFIGRULE; + case 3: return POLICYRULE_ACTION_ADD_SERVICE_CONSTRAINT; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap<PolicyRuleActionEnum> + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + PolicyRuleActionEnum> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap<PolicyRuleActionEnum>() { + public PolicyRuleActionEnum findValueByNumber(int number) { + return PolicyRuleActionEnum.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return policy.PolicyAction.getDescriptor().getEnumTypes().get(0); + } + + private static final PolicyRuleActionEnum[] VALUES = values(); + + public static PolicyRuleActionEnum valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private PolicyRuleActionEnum(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:policy.PolicyRuleActionEnum) + } + + public interface PolicyRuleActionOrBuilder extends + // @@protoc_insertion_point(interface_extends:policy.PolicyRuleAction) + com.google.protobuf.MessageOrBuilder { + + /** + * <code>.policy.PolicyRuleActionEnum action = 1;</code> + * @return The enum numeric value on the wire for action. + */ + int getActionValue(); + /** + * <code>.policy.PolicyRuleActionEnum action = 1;</code> + * @return The action. + */ + policy.PolicyAction.PolicyRuleActionEnum getAction(); + + /** + * <code>repeated string parameters = 2;</code> + * @return A list containing the parameters. + */ + java.util.List<java.lang.String> + getParametersList(); + /** + * <code>repeated string parameters = 2;</code> + * @return The count of parameters. + */ + int getParametersCount(); + /** + * <code>repeated string parameters = 2;</code> + * @param index The index of the element to return. + * @return The parameters at the given index. + */ + java.lang.String getParameters(int index); + /** + * <code>repeated string parameters = 2;</code> + * @param index The index of the value to return. + * @return The bytes of the parameters at the given index. + */ + com.google.protobuf.ByteString + getParametersBytes(int index); + } + /** + * <pre> + * Action + * </pre> + * + * Protobuf type {@code policy.PolicyRuleAction} + */ + public static final class PolicyRuleAction extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:policy.PolicyRuleAction) + PolicyRuleActionOrBuilder { + private static final long serialVersionUID = 0L; + // Use PolicyRuleAction.newBuilder() to construct. + private PolicyRuleAction(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private PolicyRuleAction() { + action_ = 0; + parameters_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new PolicyRuleAction(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private PolicyRuleAction( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + int rawValue = input.readEnum(); + + action_ = rawValue; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + parameters_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + parameters_.add(s); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + parameters_ = parameters_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return policy.PolicyAction.internal_static_policy_PolicyRuleAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return policy.PolicyAction.internal_static_policy_PolicyRuleAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + policy.PolicyAction.PolicyRuleAction.class, policy.PolicyAction.PolicyRuleAction.Builder.class); + } + + public static final int ACTION_FIELD_NUMBER = 1; + private int action_; + /** + * <code>.policy.PolicyRuleActionEnum action = 1;</code> + * @return The enum numeric value on the wire for action. + */ + @java.lang.Override public int getActionValue() { + return action_; + } + /** + * <code>.policy.PolicyRuleActionEnum action = 1;</code> + * @return The action. + */ + @java.lang.Override public policy.PolicyAction.PolicyRuleActionEnum getAction() { + @SuppressWarnings("deprecation") + policy.PolicyAction.PolicyRuleActionEnum result = policy.PolicyAction.PolicyRuleActionEnum.valueOf(action_); + return result == null ? policy.PolicyAction.PolicyRuleActionEnum.UNRECOGNIZED : result; + } + + public static final int PARAMETERS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList parameters_; + /** + * <code>repeated string parameters = 2;</code> + * @return A list containing the parameters. + */ + public com.google.protobuf.ProtocolStringList + getParametersList() { + return parameters_; + } + /** + * <code>repeated string parameters = 2;</code> + * @return The count of parameters. + */ + public int getParametersCount() { + return parameters_.size(); + } + /** + * <code>repeated string parameters = 2;</code> + * @param index The index of the element to return. + * @return The parameters at the given index. + */ + public java.lang.String getParameters(int index) { + return parameters_.get(index); + } + /** + * <code>repeated string parameters = 2;</code> + * @param index The index of the value to return. + * @return The bytes of the parameters at the given index. + */ + public com.google.protobuf.ByteString + getParametersBytes(int index) { + return parameters_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (action_ != policy.PolicyAction.PolicyRuleActionEnum.POLICYRULE_ACTION_NO_ACTION.getNumber()) { + output.writeEnum(1, action_); + } + for (int i = 0; i < parameters_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, parameters_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (action_ != policy.PolicyAction.PolicyRuleActionEnum.POLICYRULE_ACTION_NO_ACTION.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, action_); + } + { + int dataSize = 0; + for (int i = 0; i < parameters_.size(); i++) { + dataSize += computeStringSizeNoTag(parameters_.getRaw(i)); + } + size += dataSize; + size += 1 * getParametersList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof policy.PolicyAction.PolicyRuleAction)) { + return super.equals(obj); + } + policy.PolicyAction.PolicyRuleAction other = (policy.PolicyAction.PolicyRuleAction) obj; + + if (action_ != other.action_) return false; + if (!getParametersList() + .equals(other.getParametersList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ACTION_FIELD_NUMBER; + hash = (53 * hash) + action_; + if (getParametersCount() > 0) { + hash = (37 * hash) + PARAMETERS_FIELD_NUMBER; + hash = (53 * hash) + getParametersList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static policy.PolicyAction.PolicyRuleAction parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static policy.PolicyAction.PolicyRuleAction parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static policy.PolicyAction.PolicyRuleAction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static policy.PolicyAction.PolicyRuleAction parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static policy.PolicyAction.PolicyRuleAction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static policy.PolicyAction.PolicyRuleAction parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static policy.PolicyAction.PolicyRuleAction parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static policy.PolicyAction.PolicyRuleAction parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static policy.PolicyAction.PolicyRuleAction parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static policy.PolicyAction.PolicyRuleAction parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static policy.PolicyAction.PolicyRuleAction parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static policy.PolicyAction.PolicyRuleAction parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(policy.PolicyAction.PolicyRuleAction prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * <pre> + * Action + * </pre> + * + * Protobuf type {@code policy.PolicyRuleAction} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:policy.PolicyRuleAction) + policy.PolicyAction.PolicyRuleActionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return policy.PolicyAction.internal_static_policy_PolicyRuleAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return policy.PolicyAction.internal_static_policy_PolicyRuleAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + policy.PolicyAction.PolicyRuleAction.class, policy.PolicyAction.PolicyRuleAction.Builder.class); + } + + // Construct using policy.PolicyAction.PolicyRuleAction.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + action_ = 0; + + parameters_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return policy.PolicyAction.internal_static_policy_PolicyRuleAction_descriptor; + } + + @java.lang.Override + public policy.PolicyAction.PolicyRuleAction getDefaultInstanceForType() { + return policy.PolicyAction.PolicyRuleAction.getDefaultInstance(); + } + + @java.lang.Override + public policy.PolicyAction.PolicyRuleAction build() { + policy.PolicyAction.PolicyRuleAction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public policy.PolicyAction.PolicyRuleAction buildPartial() { + policy.PolicyAction.PolicyRuleAction result = new policy.PolicyAction.PolicyRuleAction(this); + int from_bitField0_ = bitField0_; + result.action_ = action_; + if (((bitField0_ & 0x00000001) != 0)) { + parameters_ = parameters_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.parameters_ = parameters_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof policy.PolicyAction.PolicyRuleAction) { + return mergeFrom((policy.PolicyAction.PolicyRuleAction)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(policy.PolicyAction.PolicyRuleAction other) { + if (other == policy.PolicyAction.PolicyRuleAction.getDefaultInstance()) return this; + if (other.action_ != 0) { + setActionValue(other.getActionValue()); + } + if (!other.parameters_.isEmpty()) { + if (parameters_.isEmpty()) { + parameters_ = other.parameters_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureParametersIsMutable(); + parameters_.addAll(other.parameters_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + policy.PolicyAction.PolicyRuleAction parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (policy.PolicyAction.PolicyRuleAction) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int action_ = 0; + /** + * <code>.policy.PolicyRuleActionEnum action = 1;</code> + * @return The enum numeric value on the wire for action. + */ + @java.lang.Override public int getActionValue() { + return action_; + } + /** + * <code>.policy.PolicyRuleActionEnum action = 1;</code> + * @param value The enum numeric value on the wire for action to set. + * @return This builder for chaining. + */ + public Builder setActionValue(int value) { + + action_ = value; + onChanged(); + return this; + } + /** + * <code>.policy.PolicyRuleActionEnum action = 1;</code> + * @return The action. + */ + @java.lang.Override + public policy.PolicyAction.PolicyRuleActionEnum getAction() { + @SuppressWarnings("deprecation") + policy.PolicyAction.PolicyRuleActionEnum result = policy.PolicyAction.PolicyRuleActionEnum.valueOf(action_); + return result == null ? policy.PolicyAction.PolicyRuleActionEnum.UNRECOGNIZED : result; + } + /** + * <code>.policy.PolicyRuleActionEnum action = 1;</code> + * @param value The action to set. + * @return This builder for chaining. + */ + public Builder setAction(policy.PolicyAction.PolicyRuleActionEnum value) { + if (value == null) { + throw new NullPointerException(); + } + + action_ = value.getNumber(); + onChanged(); + return this; + } + /** + * <code>.policy.PolicyRuleActionEnum action = 1;</code> + * @return This builder for chaining. + */ + public Builder clearAction() { + + action_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList parameters_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureParametersIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + parameters_ = new com.google.protobuf.LazyStringArrayList(parameters_); + bitField0_ |= 0x00000001; + } + } + /** + * <code>repeated string parameters = 2;</code> + * @return A list containing the parameters. + */ + public com.google.protobuf.ProtocolStringList + getParametersList() { + return parameters_.getUnmodifiableView(); + } + /** + * <code>repeated string parameters = 2;</code> + * @return The count of parameters. + */ + public int getParametersCount() { + return parameters_.size(); + } + /** + * <code>repeated string parameters = 2;</code> + * @param index The index of the element to return. + * @return The parameters at the given index. + */ + public java.lang.String getParameters(int index) { + return parameters_.get(index); + } + /** + * <code>repeated string parameters = 2;</code> + * @param index The index of the value to return. + * @return The bytes of the parameters at the given index. + */ + public com.google.protobuf.ByteString + getParametersBytes(int index) { + return parameters_.getByteString(index); + } + /** + * <code>repeated string parameters = 2;</code> + * @param index The index to set the value at. + * @param value The parameters to set. + * @return This builder for chaining. + */ + public Builder setParameters( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureParametersIsMutable(); + parameters_.set(index, value); + onChanged(); + return this; + } + /** + * <code>repeated string parameters = 2;</code> + * @param value The parameters to add. + * @return This builder for chaining. + */ + public Builder addParameters( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureParametersIsMutable(); + parameters_.add(value); + onChanged(); + return this; + } + /** + * <code>repeated string parameters = 2;</code> + * @param values The parameters to add. + * @return This builder for chaining. + */ + public Builder addAllParameters( + java.lang.Iterable<java.lang.String> values) { + ensureParametersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, parameters_); + onChanged(); + return this; + } + /** + * <code>repeated string parameters = 2;</code> + * @return This builder for chaining. + */ + public Builder clearParameters() { + parameters_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * <code>repeated string parameters = 2;</code> + * @param value The bytes of the parameters to add. + * @return This builder for chaining. + */ + public Builder addParametersBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureParametersIsMutable(); + parameters_.add(value); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:policy.PolicyRuleAction) + } + + // @@protoc_insertion_point(class_scope:policy.PolicyRuleAction) + private static final policy.PolicyAction.PolicyRuleAction DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new policy.PolicyAction.PolicyRuleAction(); + } + + public static policy.PolicyAction.PolicyRuleAction getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<PolicyRuleAction> + PARSER = new com.google.protobuf.AbstractParser<PolicyRuleAction>() { + @java.lang.Override + public PolicyRuleAction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PolicyRuleAction(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<PolicyRuleAction> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<PolicyRuleAction> getParserForType() { + return PARSER; + } + + @java.lang.Override + public policy.PolicyAction.PolicyRuleAction getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_policy_PolicyRuleAction_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_policy_PolicyRuleAction_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\023policy-action.proto\022\006policy\"T\n\020PolicyR" + + "uleAction\022,\n\006action\030\001 \001(\0162\034.policy.Polic" + + "yRuleActionEnum\022\022\n\nparameters\030\002 \003(\t*\274\001\n\024" + + "PolicyRuleActionEnum\022\037\n\033POLICYRULE_ACTIO" + + "N_NO_ACTION\020\000\022\'\n#POLICYRULE_ACTION_SET_D" + + "EVICE_STATUS\020\001\022,\n(POLICYRULE_ACTION_ADD_" + + "SERVICE_CONFIGRULE\020\002\022,\n(POLICYRULE_ACTIO" + + "N_ADD_SERVICE_CONSTRAINT\020\003b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_policy_PolicyRuleAction_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_policy_PolicyRuleAction_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_policy_PolicyRuleAction_descriptor, + new java.lang.String[] { "Action", "Parameters", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/src/policy/target/generated-sources/grpc/policy/PolicyCondition.java b/src/policy/target/generated-sources/grpc/policy/PolicyCondition.java new file mode 100644 index 0000000000000000000000000000000000000000..2bde987ea6b48fa4a5285775a235d26892ee3b81 --- /dev/null +++ b/src/policy/target/generated-sources/grpc/policy/PolicyCondition.java @@ -0,0 +1,1362 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: policy-condition.proto + +package policy; + +public final class PolicyCondition { + private PolicyCondition() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + /** + * <pre> + * Operator to be used when comparing Kpis with condition values + * </pre> + * + * Protobuf enum {@code policy.NumericalOperator} + */ + public enum NumericalOperator + implements com.google.protobuf.ProtocolMessageEnum { + /** + * <pre> + * Kpi numerical operator undefined + * </pre> + * + * <code>POLICYRULE_CONDITION_NUMERICAL_UNDEFINED = 0;</code> + */ + POLICYRULE_CONDITION_NUMERICAL_UNDEFINED(0), + /** + * <pre> + * Kpi is equal with value + * </pre> + * + * <code>POLICYRULE_CONDITION_NUMERICAL_EQUAL = 1;</code> + */ + POLICYRULE_CONDITION_NUMERICAL_EQUAL(1), + /** + * <pre> + * Kpi is not equal with value + * </pre> + * + * <code>POLICYRULE_CONDITION_NUMERICAL_NOT_EQUAL = 2;</code> + */ + POLICYRULE_CONDITION_NUMERICAL_NOT_EQUAL(2), + /** + * <pre> + * Kpi is less than value + * </pre> + * + * <code>POLICYRULE_CONDITION_NUMERICAL_LESS_THAN = 3;</code> + */ + POLICYRULE_CONDITION_NUMERICAL_LESS_THAN(3), + /** + * <pre> + * Kpi is less than or equal with value + * </pre> + * + * <code>POLICYRULE_CONDITION_NUMERICAL_LESS_THAN_EQUAL = 4;</code> + */ + POLICYRULE_CONDITION_NUMERICAL_LESS_THAN_EQUAL(4), + /** + * <pre> + * Kpi is greater than value + * </pre> + * + * <code>POLICYRULE_CONDITION_NUMERICAL_GREATER_THAN = 5;</code> + */ + POLICYRULE_CONDITION_NUMERICAL_GREATER_THAN(5), + /** + * <pre> + * Kpi is less than or equal with value + * </pre> + * + * <code>POLICYRULE_CONDITION_NUMERICAL_GREATER_THAN_EQUAL = 6;</code> + */ + POLICYRULE_CONDITION_NUMERICAL_GREATER_THAN_EQUAL(6), + UNRECOGNIZED(-1), + ; + + /** + * <pre> + * Kpi numerical operator undefined + * </pre> + * + * <code>POLICYRULE_CONDITION_NUMERICAL_UNDEFINED = 0;</code> + */ + public static final int POLICYRULE_CONDITION_NUMERICAL_UNDEFINED_VALUE = 0; + /** + * <pre> + * Kpi is equal with value + * </pre> + * + * <code>POLICYRULE_CONDITION_NUMERICAL_EQUAL = 1;</code> + */ + public static final int POLICYRULE_CONDITION_NUMERICAL_EQUAL_VALUE = 1; + /** + * <pre> + * Kpi is not equal with value + * </pre> + * + * <code>POLICYRULE_CONDITION_NUMERICAL_NOT_EQUAL = 2;</code> + */ + public static final int POLICYRULE_CONDITION_NUMERICAL_NOT_EQUAL_VALUE = 2; + /** + * <pre> + * Kpi is less than value + * </pre> + * + * <code>POLICYRULE_CONDITION_NUMERICAL_LESS_THAN = 3;</code> + */ + public static final int POLICYRULE_CONDITION_NUMERICAL_LESS_THAN_VALUE = 3; + /** + * <pre> + * Kpi is less than or equal with value + * </pre> + * + * <code>POLICYRULE_CONDITION_NUMERICAL_LESS_THAN_EQUAL = 4;</code> + */ + public static final int POLICYRULE_CONDITION_NUMERICAL_LESS_THAN_EQUAL_VALUE = 4; + /** + * <pre> + * Kpi is greater than value + * </pre> + * + * <code>POLICYRULE_CONDITION_NUMERICAL_GREATER_THAN = 5;</code> + */ + public static final int POLICYRULE_CONDITION_NUMERICAL_GREATER_THAN_VALUE = 5; + /** + * <pre> + * Kpi is less than or equal with value + * </pre> + * + * <code>POLICYRULE_CONDITION_NUMERICAL_GREATER_THAN_EQUAL = 6;</code> + */ + public static final int POLICYRULE_CONDITION_NUMERICAL_GREATER_THAN_EQUAL_VALUE = 6; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static NumericalOperator valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static NumericalOperator forNumber(int value) { + switch (value) { + case 0: return POLICYRULE_CONDITION_NUMERICAL_UNDEFINED; + case 1: return POLICYRULE_CONDITION_NUMERICAL_EQUAL; + case 2: return POLICYRULE_CONDITION_NUMERICAL_NOT_EQUAL; + case 3: return POLICYRULE_CONDITION_NUMERICAL_LESS_THAN; + case 4: return POLICYRULE_CONDITION_NUMERICAL_LESS_THAN_EQUAL; + case 5: return POLICYRULE_CONDITION_NUMERICAL_GREATER_THAN; + case 6: return POLICYRULE_CONDITION_NUMERICAL_GREATER_THAN_EQUAL; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap<NumericalOperator> + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + NumericalOperator> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap<NumericalOperator>() { + public NumericalOperator findValueByNumber(int number) { + return NumericalOperator.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return policy.PolicyCondition.getDescriptor().getEnumTypes().get(0); + } + + private static final NumericalOperator[] VALUES = values(); + + public static NumericalOperator valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private NumericalOperator(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:policy.NumericalOperator) + } + + /** + * <pre> + * Operator to be used when evaluating each condition + * </pre> + * + * Protobuf enum {@code policy.BooleanOperator} + */ + public enum BooleanOperator + implements com.google.protobuf.ProtocolMessageEnum { + /** + * <pre> + * Boolean operator undefined + * </pre> + * + * <code>POLICYRULE_CONDITION_BOOLEAN_UNDEFINED = 0;</code> + */ + POLICYRULE_CONDITION_BOOLEAN_UNDEFINED(0), + /** + * <pre> + * Boolean AND operator + * </pre> + * + * <code>POLICYRULE_CONDITION_BOOLEAN_AND = 1;</code> + */ + POLICYRULE_CONDITION_BOOLEAN_AND(1), + /** + * <pre> + * Boolean OR operator + * </pre> + * + * <code>POLICYRULE_CONDITION_BOOLEAN_OR = 2;</code> + */ + POLICYRULE_CONDITION_BOOLEAN_OR(2), + UNRECOGNIZED(-1), + ; + + /** + * <pre> + * Boolean operator undefined + * </pre> + * + * <code>POLICYRULE_CONDITION_BOOLEAN_UNDEFINED = 0;</code> + */ + public static final int POLICYRULE_CONDITION_BOOLEAN_UNDEFINED_VALUE = 0; + /** + * <pre> + * Boolean AND operator + * </pre> + * + * <code>POLICYRULE_CONDITION_BOOLEAN_AND = 1;</code> + */ + public static final int POLICYRULE_CONDITION_BOOLEAN_AND_VALUE = 1; + /** + * <pre> + * Boolean OR operator + * </pre> + * + * <code>POLICYRULE_CONDITION_BOOLEAN_OR = 2;</code> + */ + public static final int POLICYRULE_CONDITION_BOOLEAN_OR_VALUE = 2; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static BooleanOperator valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static BooleanOperator forNumber(int value) { + switch (value) { + case 0: return POLICYRULE_CONDITION_BOOLEAN_UNDEFINED; + case 1: return POLICYRULE_CONDITION_BOOLEAN_AND; + case 2: return POLICYRULE_CONDITION_BOOLEAN_OR; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap<BooleanOperator> + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + BooleanOperator> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap<BooleanOperator>() { + public BooleanOperator findValueByNumber(int number) { + return BooleanOperator.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return policy.PolicyCondition.getDescriptor().getEnumTypes().get(1); + } + + private static final BooleanOperator[] VALUES = values(); + + public static BooleanOperator valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private BooleanOperator(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:policy.BooleanOperator) + } + + public interface PolicyRuleConditionOrBuilder extends + // @@protoc_insertion_point(interface_extends:policy.PolicyRuleCondition) + com.google.protobuf.MessageOrBuilder { + + /** + * <code>.monitoring.KpiId kpiId = 1;</code> + * @return Whether the kpiId field is set. + */ + boolean hasKpiId(); + /** + * <code>.monitoring.KpiId kpiId = 1;</code> + * @return The kpiId. + */ + monitoring.Monitoring.KpiId getKpiId(); + /** + * <code>.monitoring.KpiId kpiId = 1;</code> + */ + monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder(); + + /** + * <code>.policy.NumericalOperator numericalOperator = 2;</code> + * @return The enum numeric value on the wire for numericalOperator. + */ + int getNumericalOperatorValue(); + /** + * <code>.policy.NumericalOperator numericalOperator = 2;</code> + * @return The numericalOperator. + */ + policy.PolicyCondition.NumericalOperator getNumericalOperator(); + + /** + * <code>.monitoring.KpiValue kpiValue = 3;</code> + * @return Whether the kpiValue field is set. + */ + boolean hasKpiValue(); + /** + * <code>.monitoring.KpiValue kpiValue = 3;</code> + * @return The kpiValue. + */ + monitoring.Monitoring.KpiValue getKpiValue(); + /** + * <code>.monitoring.KpiValue kpiValue = 3;</code> + */ + monitoring.Monitoring.KpiValueOrBuilder getKpiValueOrBuilder(); + } + /** + * <pre> + * Condition + * </pre> + * + * Protobuf type {@code policy.PolicyRuleCondition} + */ + public static final class PolicyRuleCondition extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:policy.PolicyRuleCondition) + PolicyRuleConditionOrBuilder { + private static final long serialVersionUID = 0L; + // Use PolicyRuleCondition.newBuilder() to construct. + private PolicyRuleCondition(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private PolicyRuleCondition() { + numericalOperator_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new PolicyRuleCondition(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private PolicyRuleCondition( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + monitoring.Monitoring.KpiId.Builder subBuilder = null; + if (kpiId_ != null) { + subBuilder = kpiId_.toBuilder(); + } + kpiId_ = input.readMessage(monitoring.Monitoring.KpiId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(kpiId_); + kpiId_ = subBuilder.buildPartial(); + } + + break; + } + case 16: { + int rawValue = input.readEnum(); + + numericalOperator_ = rawValue; + break; + } + case 26: { + monitoring.Monitoring.KpiValue.Builder subBuilder = null; + if (kpiValue_ != null) { + subBuilder = kpiValue_.toBuilder(); + } + kpiValue_ = input.readMessage(monitoring.Monitoring.KpiValue.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(kpiValue_); + kpiValue_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return policy.PolicyCondition.internal_static_policy_PolicyRuleCondition_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return policy.PolicyCondition.internal_static_policy_PolicyRuleCondition_fieldAccessorTable + .ensureFieldAccessorsInitialized( + policy.PolicyCondition.PolicyRuleCondition.class, policy.PolicyCondition.PolicyRuleCondition.Builder.class); + } + + public static final int KPIID_FIELD_NUMBER = 1; + private monitoring.Monitoring.KpiId kpiId_; + /** + * <code>.monitoring.KpiId kpiId = 1;</code> + * @return Whether the kpiId field is set. + */ + @java.lang.Override + public boolean hasKpiId() { + return kpiId_ != null; + } + /** + * <code>.monitoring.KpiId kpiId = 1;</code> + * @return The kpiId. + */ + @java.lang.Override + public monitoring.Monitoring.KpiId getKpiId() { + return kpiId_ == null ? monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } + /** + * <code>.monitoring.KpiId kpiId = 1;</code> + */ + @java.lang.Override + public monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder() { + return getKpiId(); + } + + public static final int NUMERICALOPERATOR_FIELD_NUMBER = 2; + private int numericalOperator_; + /** + * <code>.policy.NumericalOperator numericalOperator = 2;</code> + * @return The enum numeric value on the wire for numericalOperator. + */ + @java.lang.Override public int getNumericalOperatorValue() { + return numericalOperator_; + } + /** + * <code>.policy.NumericalOperator numericalOperator = 2;</code> + * @return The numericalOperator. + */ + @java.lang.Override public policy.PolicyCondition.NumericalOperator getNumericalOperator() { + @SuppressWarnings("deprecation") + policy.PolicyCondition.NumericalOperator result = policy.PolicyCondition.NumericalOperator.valueOf(numericalOperator_); + return result == null ? policy.PolicyCondition.NumericalOperator.UNRECOGNIZED : result; + } + + public static final int KPIVALUE_FIELD_NUMBER = 3; + private monitoring.Monitoring.KpiValue kpiValue_; + /** + * <code>.monitoring.KpiValue kpiValue = 3;</code> + * @return Whether the kpiValue field is set. + */ + @java.lang.Override + public boolean hasKpiValue() { + return kpiValue_ != null; + } + /** + * <code>.monitoring.KpiValue kpiValue = 3;</code> + * @return The kpiValue. + */ + @java.lang.Override + public monitoring.Monitoring.KpiValue getKpiValue() { + return kpiValue_ == null ? monitoring.Monitoring.KpiValue.getDefaultInstance() : kpiValue_; + } + /** + * <code>.monitoring.KpiValue kpiValue = 3;</code> + */ + @java.lang.Override + public monitoring.Monitoring.KpiValueOrBuilder getKpiValueOrBuilder() { + return getKpiValue(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (kpiId_ != null) { + output.writeMessage(1, getKpiId()); + } + if (numericalOperator_ != policy.PolicyCondition.NumericalOperator.POLICYRULE_CONDITION_NUMERICAL_UNDEFINED.getNumber()) { + output.writeEnum(2, numericalOperator_); + } + if (kpiValue_ != null) { + output.writeMessage(3, getKpiValue()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (kpiId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getKpiId()); + } + if (numericalOperator_ != policy.PolicyCondition.NumericalOperator.POLICYRULE_CONDITION_NUMERICAL_UNDEFINED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, numericalOperator_); + } + if (kpiValue_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getKpiValue()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof policy.PolicyCondition.PolicyRuleCondition)) { + return super.equals(obj); + } + policy.PolicyCondition.PolicyRuleCondition other = (policy.PolicyCondition.PolicyRuleCondition) obj; + + if (hasKpiId() != other.hasKpiId()) return false; + if (hasKpiId()) { + if (!getKpiId() + .equals(other.getKpiId())) return false; + } + if (numericalOperator_ != other.numericalOperator_) return false; + if (hasKpiValue() != other.hasKpiValue()) return false; + if (hasKpiValue()) { + if (!getKpiValue() + .equals(other.getKpiValue())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasKpiId()) { + hash = (37 * hash) + KPIID_FIELD_NUMBER; + hash = (53 * hash) + getKpiId().hashCode(); + } + hash = (37 * hash) + NUMERICALOPERATOR_FIELD_NUMBER; + hash = (53 * hash) + numericalOperator_; + if (hasKpiValue()) { + hash = (37 * hash) + KPIVALUE_FIELD_NUMBER; + hash = (53 * hash) + getKpiValue().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static policy.PolicyCondition.PolicyRuleCondition parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static policy.PolicyCondition.PolicyRuleCondition parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static policy.PolicyCondition.PolicyRuleCondition parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static policy.PolicyCondition.PolicyRuleCondition parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static policy.PolicyCondition.PolicyRuleCondition parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static policy.PolicyCondition.PolicyRuleCondition parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static policy.PolicyCondition.PolicyRuleCondition parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static policy.PolicyCondition.PolicyRuleCondition parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static policy.PolicyCondition.PolicyRuleCondition parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static policy.PolicyCondition.PolicyRuleCondition parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static policy.PolicyCondition.PolicyRuleCondition parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static policy.PolicyCondition.PolicyRuleCondition parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(policy.PolicyCondition.PolicyRuleCondition prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * <pre> + * Condition + * </pre> + * + * Protobuf type {@code policy.PolicyRuleCondition} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:policy.PolicyRuleCondition) + policy.PolicyCondition.PolicyRuleConditionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return policy.PolicyCondition.internal_static_policy_PolicyRuleCondition_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return policy.PolicyCondition.internal_static_policy_PolicyRuleCondition_fieldAccessorTable + .ensureFieldAccessorsInitialized( + policy.PolicyCondition.PolicyRuleCondition.class, policy.PolicyCondition.PolicyRuleCondition.Builder.class); + } + + // Construct using policy.PolicyCondition.PolicyRuleCondition.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (kpiIdBuilder_ == null) { + kpiId_ = null; + } else { + kpiId_ = null; + kpiIdBuilder_ = null; + } + numericalOperator_ = 0; + + if (kpiValueBuilder_ == null) { + kpiValue_ = null; + } else { + kpiValue_ = null; + kpiValueBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return policy.PolicyCondition.internal_static_policy_PolicyRuleCondition_descriptor; + } + + @java.lang.Override + public policy.PolicyCondition.PolicyRuleCondition getDefaultInstanceForType() { + return policy.PolicyCondition.PolicyRuleCondition.getDefaultInstance(); + } + + @java.lang.Override + public policy.PolicyCondition.PolicyRuleCondition build() { + policy.PolicyCondition.PolicyRuleCondition result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public policy.PolicyCondition.PolicyRuleCondition buildPartial() { + policy.PolicyCondition.PolicyRuleCondition result = new policy.PolicyCondition.PolicyRuleCondition(this); + if (kpiIdBuilder_ == null) { + result.kpiId_ = kpiId_; + } else { + result.kpiId_ = kpiIdBuilder_.build(); + } + result.numericalOperator_ = numericalOperator_; + if (kpiValueBuilder_ == null) { + result.kpiValue_ = kpiValue_; + } else { + result.kpiValue_ = kpiValueBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof policy.PolicyCondition.PolicyRuleCondition) { + return mergeFrom((policy.PolicyCondition.PolicyRuleCondition)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(policy.PolicyCondition.PolicyRuleCondition other) { + if (other == policy.PolicyCondition.PolicyRuleCondition.getDefaultInstance()) return this; + if (other.hasKpiId()) { + mergeKpiId(other.getKpiId()); + } + if (other.numericalOperator_ != 0) { + setNumericalOperatorValue(other.getNumericalOperatorValue()); + } + if (other.hasKpiValue()) { + mergeKpiValue(other.getKpiValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + policy.PolicyCondition.PolicyRuleCondition parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (policy.PolicyCondition.PolicyRuleCondition) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private monitoring.Monitoring.KpiId kpiId_; + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder> kpiIdBuilder_; + /** + * <code>.monitoring.KpiId kpiId = 1;</code> + * @return Whether the kpiId field is set. + */ + public boolean hasKpiId() { + return kpiIdBuilder_ != null || kpiId_ != null; + } + /** + * <code>.monitoring.KpiId kpiId = 1;</code> + * @return The kpiId. + */ + public monitoring.Monitoring.KpiId getKpiId() { + if (kpiIdBuilder_ == null) { + return kpiId_ == null ? monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } else { + return kpiIdBuilder_.getMessage(); + } + } + /** + * <code>.monitoring.KpiId kpiId = 1;</code> + */ + public Builder setKpiId(monitoring.Monitoring.KpiId value) { + if (kpiIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kpiId_ = value; + onChanged(); + } else { + kpiIdBuilder_.setMessage(value); + } + + return this; + } + /** + * <code>.monitoring.KpiId kpiId = 1;</code> + */ + public Builder setKpiId( + monitoring.Monitoring.KpiId.Builder builderForValue) { + if (kpiIdBuilder_ == null) { + kpiId_ = builderForValue.build(); + onChanged(); + } else { + kpiIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * <code>.monitoring.KpiId kpiId = 1;</code> + */ + public Builder mergeKpiId(monitoring.Monitoring.KpiId value) { + if (kpiIdBuilder_ == null) { + if (kpiId_ != null) { + kpiId_ = + monitoring.Monitoring.KpiId.newBuilder(kpiId_).mergeFrom(value).buildPartial(); + } else { + kpiId_ = value; + } + onChanged(); + } else { + kpiIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * <code>.monitoring.KpiId kpiId = 1;</code> + */ + public Builder clearKpiId() { + if (kpiIdBuilder_ == null) { + kpiId_ = null; + onChanged(); + } else { + kpiId_ = null; + kpiIdBuilder_ = null; + } + + return this; + } + /** + * <code>.monitoring.KpiId kpiId = 1;</code> + */ + public monitoring.Monitoring.KpiId.Builder getKpiIdBuilder() { + + onChanged(); + return getKpiIdFieldBuilder().getBuilder(); + } + /** + * <code>.monitoring.KpiId kpiId = 1;</code> + */ + public monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder() { + if (kpiIdBuilder_ != null) { + return kpiIdBuilder_.getMessageOrBuilder(); + } else { + return kpiId_ == null ? + monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } + } + /** + * <code>.monitoring.KpiId kpiId = 1;</code> + */ + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder> + getKpiIdFieldBuilder() { + if (kpiIdBuilder_ == null) { + kpiIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder>( + getKpiId(), + getParentForChildren(), + isClean()); + kpiId_ = null; + } + return kpiIdBuilder_; + } + + private int numericalOperator_ = 0; + /** + * <code>.policy.NumericalOperator numericalOperator = 2;</code> + * @return The enum numeric value on the wire for numericalOperator. + */ + @java.lang.Override public int getNumericalOperatorValue() { + return numericalOperator_; + } + /** + * <code>.policy.NumericalOperator numericalOperator = 2;</code> + * @param value The enum numeric value on the wire for numericalOperator to set. + * @return This builder for chaining. + */ + public Builder setNumericalOperatorValue(int value) { + + numericalOperator_ = value; + onChanged(); + return this; + } + /** + * <code>.policy.NumericalOperator numericalOperator = 2;</code> + * @return The numericalOperator. + */ + @java.lang.Override + public policy.PolicyCondition.NumericalOperator getNumericalOperator() { + @SuppressWarnings("deprecation") + policy.PolicyCondition.NumericalOperator result = policy.PolicyCondition.NumericalOperator.valueOf(numericalOperator_); + return result == null ? policy.PolicyCondition.NumericalOperator.UNRECOGNIZED : result; + } + /** + * <code>.policy.NumericalOperator numericalOperator = 2;</code> + * @param value The numericalOperator to set. + * @return This builder for chaining. + */ + public Builder setNumericalOperator(policy.PolicyCondition.NumericalOperator value) { + if (value == null) { + throw new NullPointerException(); + } + + numericalOperator_ = value.getNumber(); + onChanged(); + return this; + } + /** + * <code>.policy.NumericalOperator numericalOperator = 2;</code> + * @return This builder for chaining. + */ + public Builder clearNumericalOperator() { + + numericalOperator_ = 0; + onChanged(); + return this; + } + + private monitoring.Monitoring.KpiValue kpiValue_; + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiValue, monitoring.Monitoring.KpiValue.Builder, monitoring.Monitoring.KpiValueOrBuilder> kpiValueBuilder_; + /** + * <code>.monitoring.KpiValue kpiValue = 3;</code> + * @return Whether the kpiValue field is set. + */ + public boolean hasKpiValue() { + return kpiValueBuilder_ != null || kpiValue_ != null; + } + /** + * <code>.monitoring.KpiValue kpiValue = 3;</code> + * @return The kpiValue. + */ + public monitoring.Monitoring.KpiValue getKpiValue() { + if (kpiValueBuilder_ == null) { + return kpiValue_ == null ? monitoring.Monitoring.KpiValue.getDefaultInstance() : kpiValue_; + } else { + return kpiValueBuilder_.getMessage(); + } + } + /** + * <code>.monitoring.KpiValue kpiValue = 3;</code> + */ + public Builder setKpiValue(monitoring.Monitoring.KpiValue value) { + if (kpiValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kpiValue_ = value; + onChanged(); + } else { + kpiValueBuilder_.setMessage(value); + } + + return this; + } + /** + * <code>.monitoring.KpiValue kpiValue = 3;</code> + */ + public Builder setKpiValue( + monitoring.Monitoring.KpiValue.Builder builderForValue) { + if (kpiValueBuilder_ == null) { + kpiValue_ = builderForValue.build(); + onChanged(); + } else { + kpiValueBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * <code>.monitoring.KpiValue kpiValue = 3;</code> + */ + public Builder mergeKpiValue(monitoring.Monitoring.KpiValue value) { + if (kpiValueBuilder_ == null) { + if (kpiValue_ != null) { + kpiValue_ = + monitoring.Monitoring.KpiValue.newBuilder(kpiValue_).mergeFrom(value).buildPartial(); + } else { + kpiValue_ = value; + } + onChanged(); + } else { + kpiValueBuilder_.mergeFrom(value); + } + + return this; + } + /** + * <code>.monitoring.KpiValue kpiValue = 3;</code> + */ + public Builder clearKpiValue() { + if (kpiValueBuilder_ == null) { + kpiValue_ = null; + onChanged(); + } else { + kpiValue_ = null; + kpiValueBuilder_ = null; + } + + return this; + } + /** + * <code>.monitoring.KpiValue kpiValue = 3;</code> + */ + public monitoring.Monitoring.KpiValue.Builder getKpiValueBuilder() { + + onChanged(); + return getKpiValueFieldBuilder().getBuilder(); + } + /** + * <code>.monitoring.KpiValue kpiValue = 3;</code> + */ + public monitoring.Monitoring.KpiValueOrBuilder getKpiValueOrBuilder() { + if (kpiValueBuilder_ != null) { + return kpiValueBuilder_.getMessageOrBuilder(); + } else { + return kpiValue_ == null ? + monitoring.Monitoring.KpiValue.getDefaultInstance() : kpiValue_; + } + } + /** + * <code>.monitoring.KpiValue kpiValue = 3;</code> + */ + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiValue, monitoring.Monitoring.KpiValue.Builder, monitoring.Monitoring.KpiValueOrBuilder> + getKpiValueFieldBuilder() { + if (kpiValueBuilder_ == null) { + kpiValueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiValue, monitoring.Monitoring.KpiValue.Builder, monitoring.Monitoring.KpiValueOrBuilder>( + getKpiValue(), + getParentForChildren(), + isClean()); + kpiValue_ = null; + } + return kpiValueBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:policy.PolicyRuleCondition) + } + + // @@protoc_insertion_point(class_scope:policy.PolicyRuleCondition) + private static final policy.PolicyCondition.PolicyRuleCondition DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new policy.PolicyCondition.PolicyRuleCondition(); + } + + public static policy.PolicyCondition.PolicyRuleCondition getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<PolicyRuleCondition> + PARSER = new com.google.protobuf.AbstractParser<PolicyRuleCondition>() { + @java.lang.Override + public PolicyRuleCondition parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PolicyRuleCondition(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<PolicyRuleCondition> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<PolicyRuleCondition> getParserForType() { + return PARSER; + } + + @java.lang.Override + public policy.PolicyCondition.PolicyRuleCondition getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_policy_PolicyRuleCondition_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_policy_PolicyRuleCondition_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\026policy-condition.proto\022\006policy\032\020monito" + + "ring.proto\"\225\001\n\023PolicyRuleCondition\022 \n\005kp" + + "iId\030\001 \001(\0132\021.monitoring.KpiId\0224\n\021numerica" + + "lOperator\030\002 \001(\0162\031.policy.NumericalOperat" + + "or\022&\n\010kpiValue\030\003 \001(\0132\024.monitoring.KpiVal" + + "ue*\343\002\n\021NumericalOperator\022,\n(POLICYRULE_C" + + "ONDITION_NUMERICAL_UNDEFINED\020\000\022(\n$POLICY" + + "RULE_CONDITION_NUMERICAL_EQUAL\020\001\022,\n(POLI" + + "CYRULE_CONDITION_NUMERICAL_NOT_EQUAL\020\002\022," + + "\n(POLICYRULE_CONDITION_NUMERICAL_LESS_TH" + + "AN\020\003\0222\n.POLICYRULE_CONDITION_NUMERICAL_L" + + "ESS_THAN_EQUAL\020\004\022/\n+POLICYRULE_CONDITION" + + "_NUMERICAL_GREATER_THAN\020\005\0225\n1POLICYRULE_" + + "CONDITION_NUMERICAL_GREATER_THAN_EQUAL\020\006" + + "*\210\001\n\017BooleanOperator\022*\n&POLICYRULE_CONDI" + + "TION_BOOLEAN_UNDEFINED\020\000\022$\n POLICYRULE_C" + + "ONDITION_BOOLEAN_AND\020\001\022#\n\037POLICYRULE_CON" + + "DITION_BOOLEAN_OR\020\002b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + monitoring.Monitoring.getDescriptor(), + }); + internal_static_policy_PolicyRuleCondition_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_policy_PolicyRuleCondition_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_policy_PolicyRuleCondition_descriptor, + new java.lang.String[] { "KpiId", "NumericalOperator", "KpiValue", }); + monitoring.Monitoring.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/src/policy/target/generated-sources/grpc/policy/PolicyService.java b/src/policy/target/generated-sources/grpc/policy/PolicyService.java index 8c2e637f5dcf6b5783dd68900a03a72e58cc6206..277fbbfc5012570bf43a81fbb1da5e3e9211a49e 100644 --- a/src/policy/target/generated-sources/grpc/policy/PolicyService.java +++ b/src/policy/target/generated-sources/grpc/policy/PolicyService.java @@ -8,17 +8,21 @@ comments = "Source: policy.proto") public interface PolicyService extends MutinyService { - io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleState> policyAdd(policy.Policy.PolicyRule request); + io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleState> policyAddService(policy.Policy.PolicyRuleService request); - io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleState> policyUpdate(policy.Policy.PolicyRule request); + io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleState> policyAddDevice(policy.Policy.PolicyRuleDevice request); - io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleState> policyDelete(policy.Policy.PolicyRule request); + io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleState> policyUpdateService(policy.Policy.PolicyRuleService request); - io.smallrye.mutiny.Uni<policy.Policy.PolicyRule> getPolicy(policy.Policy.PolicyRuleId request); + io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleState> policyUpdateDevice(policy.Policy.PolicyRuleDevice request); - io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleList> getPolicyByDeviceId(context.ContextOuterClass.DeviceId request); + io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleState> policyDelete(policy.Policy.PolicyRuleId request); - io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleList> getPolicyByServiceId(context.ContextOuterClass.ServiceId request); + io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleService> getPolicyService(policy.Policy.PolicyRuleId request); + + io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleDevice> getPolicyDevice(policy.Policy.PolicyRuleId request); + + io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleServiceList> getPolicyByServiceId(context.ContextOuterClass.ServiceId request); diff --git a/src/policy/target/generated-sources/grpc/policy/PolicyServiceBean.java b/src/policy/target/generated-sources/grpc/policy/PolicyServiceBean.java index 08c0e47d9fbf9b232553fd4ce1a9c7e948f42519..ada3eeaec2f779759a0b6ff7cb5724098fc9c186 100644 --- a/src/policy/target/generated-sources/grpc/policy/PolicyServiceBean.java +++ b/src/policy/target/generated-sources/grpc/policy/PolicyServiceBean.java @@ -16,23 +16,39 @@ public class PolicyServiceBean extends MutinyPolicyServiceGrpc.PolicyServiceImpl } @Override - public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleState> policyAdd(policy.Policy.PolicyRule request) { + public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleState> policyAddService(policy.Policy.PolicyRuleService request) { try { - return delegate.policyAdd(request); + return delegate.policyAddService(request); } catch (UnsupportedOperationException e) { throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } } @Override - public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleState> policyUpdate(policy.Policy.PolicyRule request) { + public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleState> policyAddDevice(policy.Policy.PolicyRuleDevice request) { try { - return delegate.policyUpdate(request); + return delegate.policyAddDevice(request); } catch (UnsupportedOperationException e) { throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } } @Override - public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleState> policyDelete(policy.Policy.PolicyRule request) { + public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleState> policyUpdateService(policy.Policy.PolicyRuleService request) { + try { + return delegate.policyUpdateService(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleState> policyUpdateDevice(policy.Policy.PolicyRuleDevice request) { + try { + return delegate.policyUpdateDevice(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleState> policyDelete(policy.Policy.PolicyRuleId request) { try { return delegate.policyDelete(request); } catch (UnsupportedOperationException e) { @@ -40,23 +56,23 @@ public class PolicyServiceBean extends MutinyPolicyServiceGrpc.PolicyServiceImpl } } @Override - public io.smallrye.mutiny.Uni<policy.Policy.PolicyRule> getPolicy(policy.Policy.PolicyRuleId request) { + public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleService> getPolicyService(policy.Policy.PolicyRuleId request) { try { - return delegate.getPolicy(request); + return delegate.getPolicyService(request); } catch (UnsupportedOperationException e) { throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } } @Override - public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleList> getPolicyByDeviceId(context.ContextOuterClass.DeviceId request) { + public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleDevice> getPolicyDevice(policy.Policy.PolicyRuleId request) { try { - return delegate.getPolicyByDeviceId(request); + return delegate.getPolicyDevice(request); } catch (UnsupportedOperationException e) { throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } } @Override - public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleList> getPolicyByServiceId(context.ContextOuterClass.ServiceId request) { + public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleServiceList> getPolicyByServiceId(context.ContextOuterClass.ServiceId request) { try { return delegate.getPolicyByServiceId(request); } catch (UnsupportedOperationException e) { diff --git a/src/policy/target/generated-sources/grpc/policy/PolicyServiceClient.java b/src/policy/target/generated-sources/grpc/policy/PolicyServiceClient.java index 6d447719767146f965aa0f82c72c684d2c0a37bb..5f5af2002955123b646ebba86f013d79326f5b8b 100644 --- a/src/policy/target/generated-sources/grpc/policy/PolicyServiceClient.java +++ b/src/policy/target/generated-sources/grpc/policy/PolicyServiceClient.java @@ -21,27 +21,35 @@ public class PolicyServiceClient implements PolicyService, MutinyClient<MutinyPo } @Override - public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleState> policyAdd(policy.Policy.PolicyRule request) { - return stub.policyAdd(request); + public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleState> policyAddService(policy.Policy.PolicyRuleService request) { + return stub.policyAddService(request); } @Override - public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleState> policyUpdate(policy.Policy.PolicyRule request) { - return stub.policyUpdate(request); + public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleState> policyAddDevice(policy.Policy.PolicyRuleDevice request) { + return stub.policyAddDevice(request); } @Override - public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleState> policyDelete(policy.Policy.PolicyRule request) { + public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleState> policyUpdateService(policy.Policy.PolicyRuleService request) { + return stub.policyUpdateService(request); + } + @Override + public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleState> policyUpdateDevice(policy.Policy.PolicyRuleDevice request) { + return stub.policyUpdateDevice(request); + } + @Override + public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleState> policyDelete(policy.Policy.PolicyRuleId request) { return stub.policyDelete(request); } @Override - public io.smallrye.mutiny.Uni<policy.Policy.PolicyRule> getPolicy(policy.Policy.PolicyRuleId request) { - return stub.getPolicy(request); + public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleService> getPolicyService(policy.Policy.PolicyRuleId request) { + return stub.getPolicyService(request); } @Override - public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleList> getPolicyByDeviceId(context.ContextOuterClass.DeviceId request) { - return stub.getPolicyByDeviceId(request); + public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleDevice> getPolicyDevice(policy.Policy.PolicyRuleId request) { + return stub.getPolicyDevice(request); } @Override - public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleList> getPolicyByServiceId(context.ContextOuterClass.ServiceId request) { + public io.smallrye.mutiny.Uni<policy.Policy.PolicyRuleServiceList> getPolicyByServiceId(context.ContextOuterClass.ServiceId request) { return stub.getPolicyByServiceId(request); } diff --git a/src/policy/target/generated-sources/grpc/policy/PolicyServiceGrpc.java b/src/policy/target/generated-sources/grpc/policy/PolicyServiceGrpc.java index 76cba32684b0d766bfc9ed58dc6f93cd239d4431..af57ac56746c2d1943a455a53b9ce6fc02228692 100644 --- a/src/policy/target/generated-sources/grpc/policy/PolicyServiceGrpc.java +++ b/src/policy/target/generated-sources/grpc/policy/PolicyServiceGrpc.java @@ -14,89 +14,151 @@ public final class PolicyServiceGrpc { public static final String SERVICE_NAME = "policy.PolicyService"; // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor<policy.Policy.PolicyRule, - policy.Policy.PolicyRuleState> getPolicyAddMethod; + private static volatile io.grpc.MethodDescriptor<policy.Policy.PolicyRuleService, + policy.Policy.PolicyRuleState> getPolicyAddServiceMethod; @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "PolicyAdd", - requestType = policy.Policy.PolicyRule.class, + fullMethodName = SERVICE_NAME + '/' + "PolicyAddService", + requestType = policy.Policy.PolicyRuleService.class, responseType = policy.Policy.PolicyRuleState.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor<policy.Policy.PolicyRule, - policy.Policy.PolicyRuleState> getPolicyAddMethod() { - io.grpc.MethodDescriptor<policy.Policy.PolicyRule, policy.Policy.PolicyRuleState> getPolicyAddMethod; - if ((getPolicyAddMethod = PolicyServiceGrpc.getPolicyAddMethod) == null) { + public static io.grpc.MethodDescriptor<policy.Policy.PolicyRuleService, + policy.Policy.PolicyRuleState> getPolicyAddServiceMethod() { + io.grpc.MethodDescriptor<policy.Policy.PolicyRuleService, policy.Policy.PolicyRuleState> getPolicyAddServiceMethod; + if ((getPolicyAddServiceMethod = PolicyServiceGrpc.getPolicyAddServiceMethod) == null) { synchronized (PolicyServiceGrpc.class) { - if ((getPolicyAddMethod = PolicyServiceGrpc.getPolicyAddMethod) == null) { - PolicyServiceGrpc.getPolicyAddMethod = getPolicyAddMethod = - io.grpc.MethodDescriptor.<policy.Policy.PolicyRule, policy.Policy.PolicyRuleState>newBuilder() + if ((getPolicyAddServiceMethod = PolicyServiceGrpc.getPolicyAddServiceMethod) == null) { + PolicyServiceGrpc.getPolicyAddServiceMethod = getPolicyAddServiceMethod = + io.grpc.MethodDescriptor.<policy.Policy.PolicyRuleService, policy.Policy.PolicyRuleState>newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PolicyAdd")) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PolicyAddService")) .setSampledToLocalTracing(true) .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - policy.Policy.PolicyRule.getDefaultInstance())) + policy.Policy.PolicyRuleService.getDefaultInstance())) .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( policy.Policy.PolicyRuleState.getDefaultInstance())) - .setSchemaDescriptor(new PolicyServiceMethodDescriptorSupplier("PolicyAdd")) + .setSchemaDescriptor(new PolicyServiceMethodDescriptorSupplier("PolicyAddService")) .build(); } } } - return getPolicyAddMethod; + return getPolicyAddServiceMethod; } - private static volatile io.grpc.MethodDescriptor<policy.Policy.PolicyRule, - policy.Policy.PolicyRuleState> getPolicyUpdateMethod; + private static volatile io.grpc.MethodDescriptor<policy.Policy.PolicyRuleDevice, + policy.Policy.PolicyRuleState> getPolicyAddDeviceMethod; @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "PolicyUpdate", - requestType = policy.Policy.PolicyRule.class, + fullMethodName = SERVICE_NAME + '/' + "PolicyAddDevice", + requestType = policy.Policy.PolicyRuleDevice.class, responseType = policy.Policy.PolicyRuleState.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor<policy.Policy.PolicyRule, - policy.Policy.PolicyRuleState> getPolicyUpdateMethod() { - io.grpc.MethodDescriptor<policy.Policy.PolicyRule, policy.Policy.PolicyRuleState> getPolicyUpdateMethod; - if ((getPolicyUpdateMethod = PolicyServiceGrpc.getPolicyUpdateMethod) == null) { + public static io.grpc.MethodDescriptor<policy.Policy.PolicyRuleDevice, + policy.Policy.PolicyRuleState> getPolicyAddDeviceMethod() { + io.grpc.MethodDescriptor<policy.Policy.PolicyRuleDevice, policy.Policy.PolicyRuleState> getPolicyAddDeviceMethod; + if ((getPolicyAddDeviceMethod = PolicyServiceGrpc.getPolicyAddDeviceMethod) == null) { synchronized (PolicyServiceGrpc.class) { - if ((getPolicyUpdateMethod = PolicyServiceGrpc.getPolicyUpdateMethod) == null) { - PolicyServiceGrpc.getPolicyUpdateMethod = getPolicyUpdateMethod = - io.grpc.MethodDescriptor.<policy.Policy.PolicyRule, policy.Policy.PolicyRuleState>newBuilder() + if ((getPolicyAddDeviceMethod = PolicyServiceGrpc.getPolicyAddDeviceMethod) == null) { + PolicyServiceGrpc.getPolicyAddDeviceMethod = getPolicyAddDeviceMethod = + io.grpc.MethodDescriptor.<policy.Policy.PolicyRuleDevice, policy.Policy.PolicyRuleState>newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PolicyUpdate")) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PolicyAddDevice")) .setSampledToLocalTracing(true) .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - policy.Policy.PolicyRule.getDefaultInstance())) + policy.Policy.PolicyRuleDevice.getDefaultInstance())) .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( policy.Policy.PolicyRuleState.getDefaultInstance())) - .setSchemaDescriptor(new PolicyServiceMethodDescriptorSupplier("PolicyUpdate")) + .setSchemaDescriptor(new PolicyServiceMethodDescriptorSupplier("PolicyAddDevice")) .build(); } } } - return getPolicyUpdateMethod; + return getPolicyAddDeviceMethod; } - private static volatile io.grpc.MethodDescriptor<policy.Policy.PolicyRule, + private static volatile io.grpc.MethodDescriptor<policy.Policy.PolicyRuleService, + policy.Policy.PolicyRuleState> getPolicyUpdateServiceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "PolicyUpdateService", + requestType = policy.Policy.PolicyRuleService.class, + responseType = policy.Policy.PolicyRuleState.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor<policy.Policy.PolicyRuleService, + policy.Policy.PolicyRuleState> getPolicyUpdateServiceMethod() { + io.grpc.MethodDescriptor<policy.Policy.PolicyRuleService, policy.Policy.PolicyRuleState> getPolicyUpdateServiceMethod; + if ((getPolicyUpdateServiceMethod = PolicyServiceGrpc.getPolicyUpdateServiceMethod) == null) { + synchronized (PolicyServiceGrpc.class) { + if ((getPolicyUpdateServiceMethod = PolicyServiceGrpc.getPolicyUpdateServiceMethod) == null) { + PolicyServiceGrpc.getPolicyUpdateServiceMethod = getPolicyUpdateServiceMethod = + io.grpc.MethodDescriptor.<policy.Policy.PolicyRuleService, policy.Policy.PolicyRuleState>newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PolicyUpdateService")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + policy.Policy.PolicyRuleService.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + policy.Policy.PolicyRuleState.getDefaultInstance())) + .setSchemaDescriptor(new PolicyServiceMethodDescriptorSupplier("PolicyUpdateService")) + .build(); + } + } + } + return getPolicyUpdateServiceMethod; + } + + private static volatile io.grpc.MethodDescriptor<policy.Policy.PolicyRuleDevice, + policy.Policy.PolicyRuleState> getPolicyUpdateDeviceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "PolicyUpdateDevice", + requestType = policy.Policy.PolicyRuleDevice.class, + responseType = policy.Policy.PolicyRuleState.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor<policy.Policy.PolicyRuleDevice, + policy.Policy.PolicyRuleState> getPolicyUpdateDeviceMethod() { + io.grpc.MethodDescriptor<policy.Policy.PolicyRuleDevice, policy.Policy.PolicyRuleState> getPolicyUpdateDeviceMethod; + if ((getPolicyUpdateDeviceMethod = PolicyServiceGrpc.getPolicyUpdateDeviceMethod) == null) { + synchronized (PolicyServiceGrpc.class) { + if ((getPolicyUpdateDeviceMethod = PolicyServiceGrpc.getPolicyUpdateDeviceMethod) == null) { + PolicyServiceGrpc.getPolicyUpdateDeviceMethod = getPolicyUpdateDeviceMethod = + io.grpc.MethodDescriptor.<policy.Policy.PolicyRuleDevice, policy.Policy.PolicyRuleState>newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PolicyUpdateDevice")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + policy.Policy.PolicyRuleDevice.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + policy.Policy.PolicyRuleState.getDefaultInstance())) + .setSchemaDescriptor(new PolicyServiceMethodDescriptorSupplier("PolicyUpdateDevice")) + .build(); + } + } + } + return getPolicyUpdateDeviceMethod; + } + + private static volatile io.grpc.MethodDescriptor<policy.Policy.PolicyRuleId, policy.Policy.PolicyRuleState> getPolicyDeleteMethod; @io.grpc.stub.annotations.RpcMethod( fullMethodName = SERVICE_NAME + '/' + "PolicyDelete", - requestType = policy.Policy.PolicyRule.class, + requestType = policy.Policy.PolicyRuleId.class, responseType = policy.Policy.PolicyRuleState.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor<policy.Policy.PolicyRule, + public static io.grpc.MethodDescriptor<policy.Policy.PolicyRuleId, policy.Policy.PolicyRuleState> getPolicyDeleteMethod() { - io.grpc.MethodDescriptor<policy.Policy.PolicyRule, policy.Policy.PolicyRuleState> getPolicyDeleteMethod; + io.grpc.MethodDescriptor<policy.Policy.PolicyRuleId, policy.Policy.PolicyRuleState> getPolicyDeleteMethod; if ((getPolicyDeleteMethod = PolicyServiceGrpc.getPolicyDeleteMethod) == null) { synchronized (PolicyServiceGrpc.class) { if ((getPolicyDeleteMethod = PolicyServiceGrpc.getPolicyDeleteMethod) == null) { PolicyServiceGrpc.getPolicyDeleteMethod = getPolicyDeleteMethod = - io.grpc.MethodDescriptor.<policy.Policy.PolicyRule, policy.Policy.PolicyRuleState>newBuilder() + io.grpc.MethodDescriptor.<policy.Policy.PolicyRuleId, policy.Policy.PolicyRuleState>newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.UNARY) .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PolicyDelete")) .setSampledToLocalTracing(true) .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - policy.Policy.PolicyRule.getDefaultInstance())) + policy.Policy.PolicyRuleId.getDefaultInstance())) .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( policy.Policy.PolicyRuleState.getDefaultInstance())) .setSchemaDescriptor(new PolicyServiceMethodDescriptorSupplier("PolicyDelete")) @@ -108,90 +170,90 @@ public final class PolicyServiceGrpc { } private static volatile io.grpc.MethodDescriptor<policy.Policy.PolicyRuleId, - policy.Policy.PolicyRule> getGetPolicyMethod; + policy.Policy.PolicyRuleService> getGetPolicyServiceMethod; @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "GetPolicy", + fullMethodName = SERVICE_NAME + '/' + "GetPolicyService", requestType = policy.Policy.PolicyRuleId.class, - responseType = policy.Policy.PolicyRule.class, + responseType = policy.Policy.PolicyRuleService.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor<policy.Policy.PolicyRuleId, - policy.Policy.PolicyRule> getGetPolicyMethod() { - io.grpc.MethodDescriptor<policy.Policy.PolicyRuleId, policy.Policy.PolicyRule> getGetPolicyMethod; - if ((getGetPolicyMethod = PolicyServiceGrpc.getGetPolicyMethod) == null) { + policy.Policy.PolicyRuleService> getGetPolicyServiceMethod() { + io.grpc.MethodDescriptor<policy.Policy.PolicyRuleId, policy.Policy.PolicyRuleService> getGetPolicyServiceMethod; + if ((getGetPolicyServiceMethod = PolicyServiceGrpc.getGetPolicyServiceMethod) == null) { synchronized (PolicyServiceGrpc.class) { - if ((getGetPolicyMethod = PolicyServiceGrpc.getGetPolicyMethod) == null) { - PolicyServiceGrpc.getGetPolicyMethod = getGetPolicyMethod = - io.grpc.MethodDescriptor.<policy.Policy.PolicyRuleId, policy.Policy.PolicyRule>newBuilder() + if ((getGetPolicyServiceMethod = PolicyServiceGrpc.getGetPolicyServiceMethod) == null) { + PolicyServiceGrpc.getGetPolicyServiceMethod = getGetPolicyServiceMethod = + io.grpc.MethodDescriptor.<policy.Policy.PolicyRuleId, policy.Policy.PolicyRuleService>newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetPolicy")) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetPolicyService")) .setSampledToLocalTracing(true) .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( policy.Policy.PolicyRuleId.getDefaultInstance())) .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - policy.Policy.PolicyRule.getDefaultInstance())) - .setSchemaDescriptor(new PolicyServiceMethodDescriptorSupplier("GetPolicy")) + policy.Policy.PolicyRuleService.getDefaultInstance())) + .setSchemaDescriptor(new PolicyServiceMethodDescriptorSupplier("GetPolicyService")) .build(); } } } - return getGetPolicyMethod; + return getGetPolicyServiceMethod; } - private static volatile io.grpc.MethodDescriptor<context.ContextOuterClass.DeviceId, - policy.Policy.PolicyRuleList> getGetPolicyByDeviceIdMethod; + private static volatile io.grpc.MethodDescriptor<policy.Policy.PolicyRuleId, + policy.Policy.PolicyRuleDevice> getGetPolicyDeviceMethod; @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "GetPolicyByDeviceId", - requestType = context.ContextOuterClass.DeviceId.class, - responseType = policy.Policy.PolicyRuleList.class, + fullMethodName = SERVICE_NAME + '/' + "GetPolicyDevice", + requestType = policy.Policy.PolicyRuleId.class, + responseType = policy.Policy.PolicyRuleDevice.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor<context.ContextOuterClass.DeviceId, - policy.Policy.PolicyRuleList> getGetPolicyByDeviceIdMethod() { - io.grpc.MethodDescriptor<context.ContextOuterClass.DeviceId, policy.Policy.PolicyRuleList> getGetPolicyByDeviceIdMethod; - if ((getGetPolicyByDeviceIdMethod = PolicyServiceGrpc.getGetPolicyByDeviceIdMethod) == null) { + public static io.grpc.MethodDescriptor<policy.Policy.PolicyRuleId, + policy.Policy.PolicyRuleDevice> getGetPolicyDeviceMethod() { + io.grpc.MethodDescriptor<policy.Policy.PolicyRuleId, policy.Policy.PolicyRuleDevice> getGetPolicyDeviceMethod; + if ((getGetPolicyDeviceMethod = PolicyServiceGrpc.getGetPolicyDeviceMethod) == null) { synchronized (PolicyServiceGrpc.class) { - if ((getGetPolicyByDeviceIdMethod = PolicyServiceGrpc.getGetPolicyByDeviceIdMethod) == null) { - PolicyServiceGrpc.getGetPolicyByDeviceIdMethod = getGetPolicyByDeviceIdMethod = - io.grpc.MethodDescriptor.<context.ContextOuterClass.DeviceId, policy.Policy.PolicyRuleList>newBuilder() + if ((getGetPolicyDeviceMethod = PolicyServiceGrpc.getGetPolicyDeviceMethod) == null) { + PolicyServiceGrpc.getGetPolicyDeviceMethod = getGetPolicyDeviceMethod = + io.grpc.MethodDescriptor.<policy.Policy.PolicyRuleId, policy.Policy.PolicyRuleDevice>newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetPolicyByDeviceId")) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetPolicyDevice")) .setSampledToLocalTracing(true) .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - context.ContextOuterClass.DeviceId.getDefaultInstance())) + policy.Policy.PolicyRuleId.getDefaultInstance())) .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - policy.Policy.PolicyRuleList.getDefaultInstance())) - .setSchemaDescriptor(new PolicyServiceMethodDescriptorSupplier("GetPolicyByDeviceId")) + policy.Policy.PolicyRuleDevice.getDefaultInstance())) + .setSchemaDescriptor(new PolicyServiceMethodDescriptorSupplier("GetPolicyDevice")) .build(); } } } - return getGetPolicyByDeviceIdMethod; + return getGetPolicyDeviceMethod; } private static volatile io.grpc.MethodDescriptor<context.ContextOuterClass.ServiceId, - policy.Policy.PolicyRuleList> getGetPolicyByServiceIdMethod; + policy.Policy.PolicyRuleServiceList> getGetPolicyByServiceIdMethod; @io.grpc.stub.annotations.RpcMethod( fullMethodName = SERVICE_NAME + '/' + "GetPolicyByServiceId", requestType = context.ContextOuterClass.ServiceId.class, - responseType = policy.Policy.PolicyRuleList.class, + responseType = policy.Policy.PolicyRuleServiceList.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor<context.ContextOuterClass.ServiceId, - policy.Policy.PolicyRuleList> getGetPolicyByServiceIdMethod() { - io.grpc.MethodDescriptor<context.ContextOuterClass.ServiceId, policy.Policy.PolicyRuleList> getGetPolicyByServiceIdMethod; + policy.Policy.PolicyRuleServiceList> getGetPolicyByServiceIdMethod() { + io.grpc.MethodDescriptor<context.ContextOuterClass.ServiceId, policy.Policy.PolicyRuleServiceList> getGetPolicyByServiceIdMethod; if ((getGetPolicyByServiceIdMethod = PolicyServiceGrpc.getGetPolicyByServiceIdMethod) == null) { synchronized (PolicyServiceGrpc.class) { if ((getGetPolicyByServiceIdMethod = PolicyServiceGrpc.getGetPolicyByServiceIdMethod) == null) { PolicyServiceGrpc.getGetPolicyByServiceIdMethod = getGetPolicyByServiceIdMethod = - io.grpc.MethodDescriptor.<context.ContextOuterClass.ServiceId, policy.Policy.PolicyRuleList>newBuilder() + io.grpc.MethodDescriptor.<context.ContextOuterClass.ServiceId, policy.Policy.PolicyRuleServiceList>newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.UNARY) .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetPolicyByServiceId")) .setSampledToLocalTracing(true) .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( context.ContextOuterClass.ServiceId.getDefaultInstance())) .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - policy.Policy.PolicyRuleList.getDefaultInstance())) + policy.Policy.PolicyRuleServiceList.getDefaultInstance())) .setSchemaDescriptor(new PolicyServiceMethodDescriptorSupplier("GetPolicyByServiceId")) .build(); } @@ -250,89 +312,117 @@ public final class PolicyServiceGrpc { /** */ - public void policyAdd(policy.Policy.PolicyRule request, + public void policyAddService(policy.Policy.PolicyRuleService request, + io.grpc.stub.StreamObserver<policy.Policy.PolicyRuleState> responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPolicyAddServiceMethod(), responseObserver); + } + + /** + */ + public void policyAddDevice(policy.Policy.PolicyRuleDevice request, + io.grpc.stub.StreamObserver<policy.Policy.PolicyRuleState> responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPolicyAddDeviceMethod(), responseObserver); + } + + /** + */ + public void policyUpdateService(policy.Policy.PolicyRuleService request, io.grpc.stub.StreamObserver<policy.Policy.PolicyRuleState> responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPolicyAddMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPolicyUpdateServiceMethod(), responseObserver); } /** */ - public void policyUpdate(policy.Policy.PolicyRule request, + public void policyUpdateDevice(policy.Policy.PolicyRuleDevice request, io.grpc.stub.StreamObserver<policy.Policy.PolicyRuleState> responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPolicyUpdateMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPolicyUpdateDeviceMethod(), responseObserver); } /** */ - public void policyDelete(policy.Policy.PolicyRule request, + public void policyDelete(policy.Policy.PolicyRuleId request, io.grpc.stub.StreamObserver<policy.Policy.PolicyRuleState> responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPolicyDeleteMethod(), responseObserver); } /** */ - public void getPolicy(policy.Policy.PolicyRuleId request, - io.grpc.stub.StreamObserver<policy.Policy.PolicyRule> responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetPolicyMethod(), responseObserver); + public void getPolicyService(policy.Policy.PolicyRuleId request, + io.grpc.stub.StreamObserver<policy.Policy.PolicyRuleService> responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetPolicyServiceMethod(), responseObserver); } /** */ - public void getPolicyByDeviceId(context.ContextOuterClass.DeviceId request, - io.grpc.stub.StreamObserver<policy.Policy.PolicyRuleList> responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetPolicyByDeviceIdMethod(), responseObserver); + public void getPolicyDevice(policy.Policy.PolicyRuleId request, + io.grpc.stub.StreamObserver<policy.Policy.PolicyRuleDevice> responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetPolicyDeviceMethod(), responseObserver); } /** */ public void getPolicyByServiceId(context.ContextOuterClass.ServiceId request, - io.grpc.stub.StreamObserver<policy.Policy.PolicyRuleList> responseObserver) { + io.grpc.stub.StreamObserver<policy.Policy.PolicyRuleServiceList> responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetPolicyByServiceIdMethod(), responseObserver); } @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) .addMethod( - getPolicyAddMethod(), + getPolicyAddServiceMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( new MethodHandlers< - policy.Policy.PolicyRule, + policy.Policy.PolicyRuleService, policy.Policy.PolicyRuleState>( - this, METHODID_POLICY_ADD))) + this, METHODID_POLICY_ADD_SERVICE))) .addMethod( - getPolicyUpdateMethod(), + getPolicyAddDeviceMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( new MethodHandlers< - policy.Policy.PolicyRule, + policy.Policy.PolicyRuleDevice, policy.Policy.PolicyRuleState>( - this, METHODID_POLICY_UPDATE))) + this, METHODID_POLICY_ADD_DEVICE))) + .addMethod( + getPolicyUpdateServiceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + policy.Policy.PolicyRuleService, + policy.Policy.PolicyRuleState>( + this, METHODID_POLICY_UPDATE_SERVICE))) + .addMethod( + getPolicyUpdateDeviceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + policy.Policy.PolicyRuleDevice, + policy.Policy.PolicyRuleState>( + this, METHODID_POLICY_UPDATE_DEVICE))) .addMethod( getPolicyDeleteMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( new MethodHandlers< - policy.Policy.PolicyRule, + policy.Policy.PolicyRuleId, policy.Policy.PolicyRuleState>( this, METHODID_POLICY_DELETE))) .addMethod( - getGetPolicyMethod(), + getGetPolicyServiceMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( new MethodHandlers< policy.Policy.PolicyRuleId, - policy.Policy.PolicyRule>( - this, METHODID_GET_POLICY))) + policy.Policy.PolicyRuleService>( + this, METHODID_GET_POLICY_SERVICE))) .addMethod( - getGetPolicyByDeviceIdMethod(), + getGetPolicyDeviceMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( new MethodHandlers< - context.ContextOuterClass.DeviceId, - policy.Policy.PolicyRuleList>( - this, METHODID_GET_POLICY_BY_DEVICE_ID))) + policy.Policy.PolicyRuleId, + policy.Policy.PolicyRuleDevice>( + this, METHODID_GET_POLICY_DEVICE))) .addMethod( getGetPolicyByServiceIdMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( new MethodHandlers< context.ContextOuterClass.ServiceId, - policy.Policy.PolicyRuleList>( + policy.Policy.PolicyRuleServiceList>( this, METHODID_GET_POLICY_BY_SERVICE_ID))) .build(); } @@ -354,23 +444,39 @@ public final class PolicyServiceGrpc { /** */ - public void policyAdd(policy.Policy.PolicyRule request, + public void policyAddService(policy.Policy.PolicyRuleService request, io.grpc.stub.StreamObserver<policy.Policy.PolicyRuleState> responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getPolicyAddMethod(), getCallOptions()), request, responseObserver); + getChannel().newCall(getPolicyAddServiceMethod(), getCallOptions()), request, responseObserver); } /** */ - public void policyUpdate(policy.Policy.PolicyRule request, + public void policyAddDevice(policy.Policy.PolicyRuleDevice request, io.grpc.stub.StreamObserver<policy.Policy.PolicyRuleState> responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getPolicyUpdateMethod(), getCallOptions()), request, responseObserver); + getChannel().newCall(getPolicyAddDeviceMethod(), getCallOptions()), request, responseObserver); } /** */ - public void policyDelete(policy.Policy.PolicyRule request, + public void policyUpdateService(policy.Policy.PolicyRuleService request, + io.grpc.stub.StreamObserver<policy.Policy.PolicyRuleState> responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPolicyUpdateServiceMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void policyUpdateDevice(policy.Policy.PolicyRuleDevice request, + io.grpc.stub.StreamObserver<policy.Policy.PolicyRuleState> responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPolicyUpdateDeviceMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void policyDelete(policy.Policy.PolicyRuleId request, io.grpc.stub.StreamObserver<policy.Policy.PolicyRuleState> responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getPolicyDeleteMethod(), getCallOptions()), request, responseObserver); @@ -378,24 +484,24 @@ public final class PolicyServiceGrpc { /** */ - public void getPolicy(policy.Policy.PolicyRuleId request, - io.grpc.stub.StreamObserver<policy.Policy.PolicyRule> responseObserver) { + public void getPolicyService(policy.Policy.PolicyRuleId request, + io.grpc.stub.StreamObserver<policy.Policy.PolicyRuleService> responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getGetPolicyMethod(), getCallOptions()), request, responseObserver); + getChannel().newCall(getGetPolicyServiceMethod(), getCallOptions()), request, responseObserver); } /** */ - public void getPolicyByDeviceId(context.ContextOuterClass.DeviceId request, - io.grpc.stub.StreamObserver<policy.Policy.PolicyRuleList> responseObserver) { + public void getPolicyDevice(policy.Policy.PolicyRuleId request, + io.grpc.stub.StreamObserver<policy.Policy.PolicyRuleDevice> responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getGetPolicyByDeviceIdMethod(), getCallOptions()), request, responseObserver); + getChannel().newCall(getGetPolicyDeviceMethod(), getCallOptions()), request, responseObserver); } /** */ public void getPolicyByServiceId(context.ContextOuterClass.ServiceId request, - io.grpc.stub.StreamObserver<policy.Policy.PolicyRuleList> responseObserver) { + io.grpc.stub.StreamObserver<policy.Policy.PolicyRuleServiceList> responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getGetPolicyByServiceIdMethod(), getCallOptions()), request, responseObserver); } @@ -417,42 +523,56 @@ public final class PolicyServiceGrpc { /** */ - public policy.Policy.PolicyRuleState policyAdd(policy.Policy.PolicyRule request) { + public policy.Policy.PolicyRuleState policyAddService(policy.Policy.PolicyRuleService request) { return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getPolicyAddMethod(), getCallOptions(), request); + getChannel(), getPolicyAddServiceMethod(), getCallOptions(), request); } /** */ - public policy.Policy.PolicyRuleState policyUpdate(policy.Policy.PolicyRule request) { + public policy.Policy.PolicyRuleState policyAddDevice(policy.Policy.PolicyRuleDevice request) { return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getPolicyUpdateMethod(), getCallOptions(), request); + getChannel(), getPolicyAddDeviceMethod(), getCallOptions(), request); } /** */ - public policy.Policy.PolicyRuleState policyDelete(policy.Policy.PolicyRule request) { + public policy.Policy.PolicyRuleState policyUpdateService(policy.Policy.PolicyRuleService request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPolicyUpdateServiceMethod(), getCallOptions(), request); + } + + /** + */ + public policy.Policy.PolicyRuleState policyUpdateDevice(policy.Policy.PolicyRuleDevice request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPolicyUpdateDeviceMethod(), getCallOptions(), request); + } + + /** + */ + public policy.Policy.PolicyRuleState policyDelete(policy.Policy.PolicyRuleId request) { return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getPolicyDeleteMethod(), getCallOptions(), request); } /** */ - public policy.Policy.PolicyRule getPolicy(policy.Policy.PolicyRuleId request) { + public policy.Policy.PolicyRuleService getPolicyService(policy.Policy.PolicyRuleId request) { return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getGetPolicyMethod(), getCallOptions(), request); + getChannel(), getGetPolicyServiceMethod(), getCallOptions(), request); } /** */ - public policy.Policy.PolicyRuleList getPolicyByDeviceId(context.ContextOuterClass.DeviceId request) { + public policy.Policy.PolicyRuleDevice getPolicyDevice(policy.Policy.PolicyRuleId request) { return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getGetPolicyByDeviceIdMethod(), getCallOptions(), request); + getChannel(), getGetPolicyDeviceMethod(), getCallOptions(), request); } /** */ - public policy.Policy.PolicyRuleList getPolicyByServiceId(context.ContextOuterClass.ServiceId request) { + public policy.Policy.PolicyRuleServiceList getPolicyByServiceId(context.ContextOuterClass.ServiceId request) { return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getGetPolicyByServiceIdMethod(), getCallOptions(), request); } @@ -474,59 +594,77 @@ public final class PolicyServiceGrpc { /** */ - public com.google.common.util.concurrent.ListenableFuture<policy.Policy.PolicyRuleState> policyAdd( - policy.Policy.PolicyRule request) { + public com.google.common.util.concurrent.ListenableFuture<policy.Policy.PolicyRuleState> policyAddService( + policy.Policy.PolicyRuleService request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPolicyAddServiceMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture<policy.Policy.PolicyRuleState> policyAddDevice( + policy.Policy.PolicyRuleDevice request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPolicyAddDeviceMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture<policy.Policy.PolicyRuleState> policyUpdateService( + policy.Policy.PolicyRuleService request) { return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getPolicyAddMethod(), getCallOptions()), request); + getChannel().newCall(getPolicyUpdateServiceMethod(), getCallOptions()), request); } /** */ - public com.google.common.util.concurrent.ListenableFuture<policy.Policy.PolicyRuleState> policyUpdate( - policy.Policy.PolicyRule request) { + public com.google.common.util.concurrent.ListenableFuture<policy.Policy.PolicyRuleState> policyUpdateDevice( + policy.Policy.PolicyRuleDevice request) { return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getPolicyUpdateMethod(), getCallOptions()), request); + getChannel().newCall(getPolicyUpdateDeviceMethod(), getCallOptions()), request); } /** */ public com.google.common.util.concurrent.ListenableFuture<policy.Policy.PolicyRuleState> policyDelete( - policy.Policy.PolicyRule request) { + policy.Policy.PolicyRuleId request) { return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getPolicyDeleteMethod(), getCallOptions()), request); } /** */ - public com.google.common.util.concurrent.ListenableFuture<policy.Policy.PolicyRule> getPolicy( + public com.google.common.util.concurrent.ListenableFuture<policy.Policy.PolicyRuleService> getPolicyService( policy.Policy.PolicyRuleId request) { return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getGetPolicyMethod(), getCallOptions()), request); + getChannel().newCall(getGetPolicyServiceMethod(), getCallOptions()), request); } /** */ - public com.google.common.util.concurrent.ListenableFuture<policy.Policy.PolicyRuleList> getPolicyByDeviceId( - context.ContextOuterClass.DeviceId request) { + public com.google.common.util.concurrent.ListenableFuture<policy.Policy.PolicyRuleDevice> getPolicyDevice( + policy.Policy.PolicyRuleId request) { return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getGetPolicyByDeviceIdMethod(), getCallOptions()), request); + getChannel().newCall(getGetPolicyDeviceMethod(), getCallOptions()), request); } /** */ - public com.google.common.util.concurrent.ListenableFuture<policy.Policy.PolicyRuleList> getPolicyByServiceId( + public com.google.common.util.concurrent.ListenableFuture<policy.Policy.PolicyRuleServiceList> getPolicyByServiceId( context.ContextOuterClass.ServiceId request) { return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getGetPolicyByServiceIdMethod(), getCallOptions()), request); } } - private static final int METHODID_POLICY_ADD = 0; - private static final int METHODID_POLICY_UPDATE = 1; - private static final int METHODID_POLICY_DELETE = 2; - private static final int METHODID_GET_POLICY = 3; - private static final int METHODID_GET_POLICY_BY_DEVICE_ID = 4; - private static final int METHODID_GET_POLICY_BY_SERVICE_ID = 5; + private static final int METHODID_POLICY_ADD_SERVICE = 0; + private static final int METHODID_POLICY_ADD_DEVICE = 1; + private static final int METHODID_POLICY_UPDATE_SERVICE = 2; + private static final int METHODID_POLICY_UPDATE_DEVICE = 3; + private static final int METHODID_POLICY_DELETE = 4; + private static final int METHODID_GET_POLICY_SERVICE = 5; + private static final int METHODID_GET_POLICY_DEVICE = 6; + private static final int METHODID_GET_POLICY_BY_SERVICE_ID = 7; private static final class MethodHandlers<Req, Resp> implements io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>, @@ -545,29 +683,37 @@ public final class PolicyServiceGrpc { @java.lang.SuppressWarnings("unchecked") public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) { switch (methodId) { - case METHODID_POLICY_ADD: - serviceImpl.policyAdd((policy.Policy.PolicyRule) request, + case METHODID_POLICY_ADD_SERVICE: + serviceImpl.policyAddService((policy.Policy.PolicyRuleService) request, + (io.grpc.stub.StreamObserver<policy.Policy.PolicyRuleState>) responseObserver); + break; + case METHODID_POLICY_ADD_DEVICE: + serviceImpl.policyAddDevice((policy.Policy.PolicyRuleDevice) request, + (io.grpc.stub.StreamObserver<policy.Policy.PolicyRuleState>) responseObserver); + break; + case METHODID_POLICY_UPDATE_SERVICE: + serviceImpl.policyUpdateService((policy.Policy.PolicyRuleService) request, (io.grpc.stub.StreamObserver<policy.Policy.PolicyRuleState>) responseObserver); break; - case METHODID_POLICY_UPDATE: - serviceImpl.policyUpdate((policy.Policy.PolicyRule) request, + case METHODID_POLICY_UPDATE_DEVICE: + serviceImpl.policyUpdateDevice((policy.Policy.PolicyRuleDevice) request, (io.grpc.stub.StreamObserver<policy.Policy.PolicyRuleState>) responseObserver); break; case METHODID_POLICY_DELETE: - serviceImpl.policyDelete((policy.Policy.PolicyRule) request, + serviceImpl.policyDelete((policy.Policy.PolicyRuleId) request, (io.grpc.stub.StreamObserver<policy.Policy.PolicyRuleState>) responseObserver); break; - case METHODID_GET_POLICY: - serviceImpl.getPolicy((policy.Policy.PolicyRuleId) request, - (io.grpc.stub.StreamObserver<policy.Policy.PolicyRule>) responseObserver); + case METHODID_GET_POLICY_SERVICE: + serviceImpl.getPolicyService((policy.Policy.PolicyRuleId) request, + (io.grpc.stub.StreamObserver<policy.Policy.PolicyRuleService>) responseObserver); break; - case METHODID_GET_POLICY_BY_DEVICE_ID: - serviceImpl.getPolicyByDeviceId((context.ContextOuterClass.DeviceId) request, - (io.grpc.stub.StreamObserver<policy.Policy.PolicyRuleList>) responseObserver); + case METHODID_GET_POLICY_DEVICE: + serviceImpl.getPolicyDevice((policy.Policy.PolicyRuleId) request, + (io.grpc.stub.StreamObserver<policy.Policy.PolicyRuleDevice>) responseObserver); break; case METHODID_GET_POLICY_BY_SERVICE_ID: serviceImpl.getPolicyByServiceId((context.ContextOuterClass.ServiceId) request, - (io.grpc.stub.StreamObserver<policy.Policy.PolicyRuleList>) responseObserver); + (io.grpc.stub.StreamObserver<policy.Policy.PolicyRuleServiceList>) responseObserver); break; default: throw new AssertionError(); @@ -630,11 +776,13 @@ public final class PolicyServiceGrpc { if (result == null) { serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) .setSchemaDescriptor(new PolicyServiceFileDescriptorSupplier()) - .addMethod(getPolicyAddMethod()) - .addMethod(getPolicyUpdateMethod()) + .addMethod(getPolicyAddServiceMethod()) + .addMethod(getPolicyAddDeviceMethod()) + .addMethod(getPolicyUpdateServiceMethod()) + .addMethod(getPolicyUpdateDeviceMethod()) .addMethod(getPolicyDeleteMethod()) - .addMethod(getGetPolicyMethod()) - .addMethod(getGetPolicyByDeviceIdMethod()) + .addMethod(getGetPolicyServiceMethod()) + .addMethod(getGetPolicyDeviceMethod()) .addMethod(getGetPolicyByServiceIdMethod()) .build(); } diff --git a/src/policy/target/generated-sources/grpc/service/MutinyServiceServiceGrpc.java b/src/policy/target/generated-sources/grpc/service/MutinyServiceServiceGrpc.java new file mode 100644 index 0000000000000000000000000000000000000000..8caa9641d654e5b0f3e07635b366684d8ab5f980 --- /dev/null +++ b/src/policy/target/generated-sources/grpc/service/MutinyServiceServiceGrpc.java @@ -0,0 +1,168 @@ +package service; + +import static service.ServiceServiceGrpc.getServiceDescriptor; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; +import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; +import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; + +@javax.annotation.Generated( +value = "by Mutiny Grpc generator", +comments = "Source: service.proto") +public final class MutinyServiceServiceGrpc implements io.quarkus.grpc.runtime.MutinyGrpc { + private MutinyServiceServiceGrpc() {} + + public static MutinyServiceServiceStub newMutinyStub(io.grpc.Channel channel) { + return new MutinyServiceServiceStub(channel); + } + + + public static final class MutinyServiceServiceStub extends io.grpc.stub.AbstractStub<MutinyServiceServiceStub> implements io.quarkus.grpc.runtime.MutinyStub { + private ServiceServiceGrpc.ServiceServiceStub delegateStub; + + private MutinyServiceServiceStub(io.grpc.Channel channel) { + super(channel); + delegateStub = ServiceServiceGrpc.newStub(channel); + } + + private MutinyServiceServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + delegateStub = ServiceServiceGrpc.newStub(channel).build(channel, callOptions); + } + + @Override + protected MutinyServiceServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MutinyServiceServiceStub(channel, callOptions); + } + + + public io.smallrye.mutiny.Uni<context.ContextOuterClass.ServiceId> createService(context.ContextOuterClass.Service request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::createService); + } + + + public io.smallrye.mutiny.Uni<context.ContextOuterClass.ServiceId> updateService(context.ContextOuterClass.Service request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::updateService); + } + + + public io.smallrye.mutiny.Uni<context.ContextOuterClass.Empty> deleteService(context.ContextOuterClass.ServiceId request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::deleteService); + } + + } + + + public static abstract class ServiceServiceImplBase implements io.grpc.BindableService { + + private String compression; + /** + * Set whether the server will try to use a compressed response. + * + * @param compression the compression, e.g {@code gzip} + */ + public ServiceServiceImplBase withCompression(String compression) { + this.compression = compression; + return this; + } + + + + public io.smallrye.mutiny.Uni<context.ContextOuterClass.ServiceId> createService(context.ContextOuterClass.Service request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni<context.ContextOuterClass.ServiceId> updateService(context.ContextOuterClass.Service request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni<context.ContextOuterClass.Empty> deleteService(context.ContextOuterClass.ServiceId request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + service.ServiceServiceGrpc.getCreateServiceMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.Service, + context.ContextOuterClass.ServiceId>( + this, METHODID_CREATE_SERVICE, compression))) + .addMethod( + service.ServiceServiceGrpc.getUpdateServiceMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.Service, + context.ContextOuterClass.ServiceId>( + this, METHODID_UPDATE_SERVICE, compression))) + .addMethod( + service.ServiceServiceGrpc.getDeleteServiceMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.ServiceId, + context.ContextOuterClass.Empty>( + this, METHODID_DELETE_SERVICE, compression))) + .build(); + } + } + + private static final int METHODID_CREATE_SERVICE = 0; + private static final int METHODID_UPDATE_SERVICE = 1; + private static final int METHODID_DELETE_SERVICE = 2; + + private static final class MethodHandlers<Req, Resp> implements + io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>, + io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>, + io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>, + io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> { + private final ServiceServiceImplBase serviceImpl; + private final int methodId; + private final String compression; + + MethodHandlers(ServiceServiceImplBase serviceImpl, int methodId, String compression) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + this.compression = compression; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) { + switch (methodId) { + case METHODID_CREATE_SERVICE: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.Service) request, + (io.grpc.stub.StreamObserver<context.ContextOuterClass.ServiceId>) responseObserver, + compression, + serviceImpl::createService); + break; + case METHODID_UPDATE_SERVICE: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.Service) request, + (io.grpc.stub.StreamObserver<context.ContextOuterClass.ServiceId>) responseObserver, + compression, + serviceImpl::updateService); + break; + case METHODID_DELETE_SERVICE: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.ServiceId) request, + (io.grpc.stub.StreamObserver<context.ContextOuterClass.Empty>) responseObserver, + compression, + serviceImpl::deleteService); + break; + default: + throw new java.lang.AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver<Req> invoke(io.grpc.stub.StreamObserver<Resp> responseObserver) { + switch (methodId) { + default: + throw new java.lang.AssertionError(); + } + } + } + +} \ No newline at end of file diff --git a/src/policy/target/generated-sources/grpc/service/Service.java b/src/policy/target/generated-sources/grpc/service/Service.java new file mode 100644 index 0000000000000000000000000000000000000000..32393a23714ffd1c1aa69d0909a3ffe7bc876146 --- /dev/null +++ b/src/policy/target/generated-sources/grpc/service/Service.java @@ -0,0 +1,42 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: service.proto + +package service; + +public final class Service { + private Service() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\rservice.proto\022\007service\032\rcontext.proto2" + + "\271\001\n\016ServiceService\0227\n\rCreateService\022\020.co" + + "ntext.Service\032\022.context.ServiceId\"\000\0227\n\rU" + + "pdateService\022\020.context.Service\032\022.context" + + ".ServiceId\"\000\0225\n\rDeleteService\022\022.context." + + "ServiceId\032\016.context.Empty\"\000b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + context.ContextOuterClass.getDescriptor(), + }); + context.ContextOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/src/policy/target/generated-sources/grpc/service/ServiceService.java b/src/policy/target/generated-sources/grpc/service/ServiceService.java new file mode 100644 index 0000000000000000000000000000000000000000..b51f2353623b201978b84ff8587553a8ef606b51 --- /dev/null +++ b/src/policy/target/generated-sources/grpc/service/ServiceService.java @@ -0,0 +1,20 @@ +package service; + +import io.quarkus.grpc.runtime.MutinyService; + +@javax.annotation.Generated( +value = "by Mutiny Grpc generator", +comments = "Source: service.proto") +public interface ServiceService extends MutinyService { + + + io.smallrye.mutiny.Uni<context.ContextOuterClass.ServiceId> createService(context.ContextOuterClass.Service request); + + io.smallrye.mutiny.Uni<context.ContextOuterClass.ServiceId> updateService(context.ContextOuterClass.Service request); + + io.smallrye.mutiny.Uni<context.ContextOuterClass.Empty> deleteService(context.ContextOuterClass.ServiceId request); + + + + +} \ No newline at end of file diff --git a/src/policy/target/generated-sources/grpc/service/ServiceServiceBean.java b/src/policy/target/generated-sources/grpc/service/ServiceServiceBean.java new file mode 100644 index 0000000000000000000000000000000000000000..a4c34aaa82129ae725d7b2ff7abeff7dc6c159cc --- /dev/null +++ b/src/policy/target/generated-sources/grpc/service/ServiceServiceBean.java @@ -0,0 +1,43 @@ +package service; + +import io.grpc.BindableService; +import io.quarkus.grpc.GrpcService; +import io.quarkus.grpc.runtime.MutinyBean; + +@javax.annotation.Generated( +value = "by Mutiny Grpc generator", +comments = "Source: service.proto") +public class ServiceServiceBean extends MutinyServiceServiceGrpc.ServiceServiceImplBase implements BindableService, MutinyBean { + + private final ServiceService delegate; + + ServiceServiceBean(@GrpcService ServiceService delegate) { + this.delegate = delegate; + } + + @Override + public io.smallrye.mutiny.Uni<context.ContextOuterClass.ServiceId> createService(context.ContextOuterClass.Service request) { + try { + return delegate.createService(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni<context.ContextOuterClass.ServiceId> updateService(context.ContextOuterClass.Service request) { + try { + return delegate.updateService(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni<context.ContextOuterClass.Empty> deleteService(context.ContextOuterClass.ServiceId request) { + try { + return delegate.deleteService(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + +} \ No newline at end of file diff --git a/src/policy/target/generated-sources/grpc/service/ServiceServiceClient.java b/src/policy/target/generated-sources/grpc/service/ServiceServiceClient.java new file mode 100644 index 0000000000000000000000000000000000000000..91522d4779a6ee7c85c9589588ea7cc0cba39efc --- /dev/null +++ b/src/policy/target/generated-sources/grpc/service/ServiceServiceClient.java @@ -0,0 +1,36 @@ +package service; + +import java.util.function.BiFunction; + +import io.quarkus.grpc.runtime.MutinyClient; + +@javax.annotation.Generated( +value = "by Mutiny Grpc generator", +comments = "Source: service.proto") +public class ServiceServiceClient implements ServiceService, MutinyClient<MutinyServiceServiceGrpc.MutinyServiceServiceStub> { + + private final MutinyServiceServiceGrpc.MutinyServiceServiceStub stub; + + public ServiceServiceClient(String name, io.grpc.Channel channel, BiFunction<String, MutinyServiceServiceGrpc.MutinyServiceServiceStub, MutinyServiceServiceGrpc.MutinyServiceServiceStub> stubConfigurator) { + this.stub = stubConfigurator.apply(name,MutinyServiceServiceGrpc.newMutinyStub(channel)); + } + + @Override + public MutinyServiceServiceGrpc.MutinyServiceServiceStub getStub() { + return stub; + } + + @Override + public io.smallrye.mutiny.Uni<context.ContextOuterClass.ServiceId> createService(context.ContextOuterClass.Service request) { + return stub.createService(request); + } + @Override + public io.smallrye.mutiny.Uni<context.ContextOuterClass.ServiceId> updateService(context.ContextOuterClass.Service request) { + return stub.updateService(request); + } + @Override + public io.smallrye.mutiny.Uni<context.ContextOuterClass.Empty> deleteService(context.ContextOuterClass.ServiceId request) { + return stub.deleteService(request); + } + +} \ No newline at end of file diff --git a/src/policy/target/generated-sources/grpc/service/ServiceServiceGrpc.java b/src/policy/target/generated-sources/grpc/service/ServiceServiceGrpc.java new file mode 100644 index 0000000000000000000000000000000000000000..66419a93bacee7dad02d302044b8024e8ed12154 --- /dev/null +++ b/src/policy/target/generated-sources/grpc/service/ServiceServiceGrpc.java @@ -0,0 +1,423 @@ +package service; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.38.1)", + comments = "Source: service.proto") +public final class ServiceServiceGrpc { + + private ServiceServiceGrpc() {} + + public static final String SERVICE_NAME = "service.ServiceService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor<context.ContextOuterClass.Service, + context.ContextOuterClass.ServiceId> getCreateServiceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateService", + requestType = context.ContextOuterClass.Service.class, + responseType = context.ContextOuterClass.ServiceId.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor<context.ContextOuterClass.Service, + context.ContextOuterClass.ServiceId> getCreateServiceMethod() { + io.grpc.MethodDescriptor<context.ContextOuterClass.Service, context.ContextOuterClass.ServiceId> getCreateServiceMethod; + if ((getCreateServiceMethod = ServiceServiceGrpc.getCreateServiceMethod) == null) { + synchronized (ServiceServiceGrpc.class) { + if ((getCreateServiceMethod = ServiceServiceGrpc.getCreateServiceMethod) == null) { + ServiceServiceGrpc.getCreateServiceMethod = getCreateServiceMethod = + io.grpc.MethodDescriptor.<context.ContextOuterClass.Service, context.ContextOuterClass.ServiceId>newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateService")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Service.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.ServiceId.getDefaultInstance())) + .setSchemaDescriptor(new ServiceServiceMethodDescriptorSupplier("CreateService")) + .build(); + } + } + } + return getCreateServiceMethod; + } + + private static volatile io.grpc.MethodDescriptor<context.ContextOuterClass.Service, + context.ContextOuterClass.ServiceId> getUpdateServiceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateService", + requestType = context.ContextOuterClass.Service.class, + responseType = context.ContextOuterClass.ServiceId.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor<context.ContextOuterClass.Service, + context.ContextOuterClass.ServiceId> getUpdateServiceMethod() { + io.grpc.MethodDescriptor<context.ContextOuterClass.Service, context.ContextOuterClass.ServiceId> getUpdateServiceMethod; + if ((getUpdateServiceMethod = ServiceServiceGrpc.getUpdateServiceMethod) == null) { + synchronized (ServiceServiceGrpc.class) { + if ((getUpdateServiceMethod = ServiceServiceGrpc.getUpdateServiceMethod) == null) { + ServiceServiceGrpc.getUpdateServiceMethod = getUpdateServiceMethod = + io.grpc.MethodDescriptor.<context.ContextOuterClass.Service, context.ContextOuterClass.ServiceId>newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateService")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Service.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.ServiceId.getDefaultInstance())) + .setSchemaDescriptor(new ServiceServiceMethodDescriptorSupplier("UpdateService")) + .build(); + } + } + } + return getUpdateServiceMethod; + } + + private static volatile io.grpc.MethodDescriptor<context.ContextOuterClass.ServiceId, + context.ContextOuterClass.Empty> getDeleteServiceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteService", + requestType = context.ContextOuterClass.ServiceId.class, + responseType = context.ContextOuterClass.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor<context.ContextOuterClass.ServiceId, + context.ContextOuterClass.Empty> getDeleteServiceMethod() { + io.grpc.MethodDescriptor<context.ContextOuterClass.ServiceId, context.ContextOuterClass.Empty> getDeleteServiceMethod; + if ((getDeleteServiceMethod = ServiceServiceGrpc.getDeleteServiceMethod) == null) { + synchronized (ServiceServiceGrpc.class) { + if ((getDeleteServiceMethod = ServiceServiceGrpc.getDeleteServiceMethod) == null) { + ServiceServiceGrpc.getDeleteServiceMethod = getDeleteServiceMethod = + io.grpc.MethodDescriptor.<context.ContextOuterClass.ServiceId, context.ContextOuterClass.Empty>newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteService")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.ServiceId.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Empty.getDefaultInstance())) + .setSchemaDescriptor(new ServiceServiceMethodDescriptorSupplier("DeleteService")) + .build(); + } + } + } + return getDeleteServiceMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static ServiceServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory<ServiceServiceStub> factory = + new io.grpc.stub.AbstractStub.StubFactory<ServiceServiceStub>() { + @java.lang.Override + public ServiceServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ServiceServiceStub(channel, callOptions); + } + }; + return ServiceServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static ServiceServiceBlockingStub newBlockingStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory<ServiceServiceBlockingStub> factory = + new io.grpc.stub.AbstractStub.StubFactory<ServiceServiceBlockingStub>() { + @java.lang.Override + public ServiceServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ServiceServiceBlockingStub(channel, callOptions); + } + }; + return ServiceServiceBlockingStub.newStub(factory, channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static ServiceServiceFutureStub newFutureStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory<ServiceServiceFutureStub> factory = + new io.grpc.stub.AbstractStub.StubFactory<ServiceServiceFutureStub>() { + @java.lang.Override + public ServiceServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ServiceServiceFutureStub(channel, callOptions); + } + }; + return ServiceServiceFutureStub.newStub(factory, channel); + } + + /** + */ + public static abstract class ServiceServiceImplBase implements io.grpc.BindableService { + + /** + */ + public void createService(context.ContextOuterClass.Service request, + io.grpc.stub.StreamObserver<context.ContextOuterClass.ServiceId> responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateServiceMethod(), responseObserver); + } + + /** + */ + public void updateService(context.ContextOuterClass.Service request, + io.grpc.stub.StreamObserver<context.ContextOuterClass.ServiceId> responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateServiceMethod(), responseObserver); + } + + /** + */ + public void deleteService(context.ContextOuterClass.ServiceId request, + io.grpc.stub.StreamObserver<context.ContextOuterClass.Empty> responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteServiceMethod(), responseObserver); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateServiceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.Service, + context.ContextOuterClass.ServiceId>( + this, METHODID_CREATE_SERVICE))) + .addMethod( + getUpdateServiceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.Service, + context.ContextOuterClass.ServiceId>( + this, METHODID_UPDATE_SERVICE))) + .addMethod( + getDeleteServiceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.ServiceId, + context.ContextOuterClass.Empty>( + this, METHODID_DELETE_SERVICE))) + .build(); + } + } + + /** + */ + public static final class ServiceServiceStub extends io.grpc.stub.AbstractAsyncStub<ServiceServiceStub> { + private ServiceServiceStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ServiceServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ServiceServiceStub(channel, callOptions); + } + + /** + */ + public void createService(context.ContextOuterClass.Service request, + io.grpc.stub.StreamObserver<context.ContextOuterClass.ServiceId> responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateServiceMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void updateService(context.ContextOuterClass.Service request, + io.grpc.stub.StreamObserver<context.ContextOuterClass.ServiceId> responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateServiceMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void deleteService(context.ContextOuterClass.ServiceId request, + io.grpc.stub.StreamObserver<context.ContextOuterClass.Empty> responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteServiceMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + */ + public static final class ServiceServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub<ServiceServiceBlockingStub> { + private ServiceServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ServiceServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ServiceServiceBlockingStub(channel, callOptions); + } + + /** + */ + public context.ContextOuterClass.ServiceId createService(context.ContextOuterClass.Service request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateServiceMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.ServiceId updateService(context.ContextOuterClass.Service request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateServiceMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.Empty deleteService(context.ContextOuterClass.ServiceId request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteServiceMethod(), getCallOptions(), request); + } + } + + /** + */ + public static final class ServiceServiceFutureStub extends io.grpc.stub.AbstractFutureStub<ServiceServiceFutureStub> { + private ServiceServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ServiceServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ServiceServiceFutureStub(channel, callOptions); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture<context.ContextOuterClass.ServiceId> createService( + context.ContextOuterClass.Service request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateServiceMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture<context.ContextOuterClass.ServiceId> updateService( + context.ContextOuterClass.Service request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateServiceMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture<context.ContextOuterClass.Empty> deleteService( + context.ContextOuterClass.ServiceId request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteServiceMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_SERVICE = 0; + private static final int METHODID_UPDATE_SERVICE = 1; + private static final int METHODID_DELETE_SERVICE = 2; + + private static final class MethodHandlers<Req, Resp> implements + io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>, + io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>, + io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>, + io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> { + private final ServiceServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(ServiceServiceImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) { + switch (methodId) { + case METHODID_CREATE_SERVICE: + serviceImpl.createService((context.ContextOuterClass.Service) request, + (io.grpc.stub.StreamObserver<context.ContextOuterClass.ServiceId>) responseObserver); + break; + case METHODID_UPDATE_SERVICE: + serviceImpl.updateService((context.ContextOuterClass.Service) request, + (io.grpc.stub.StreamObserver<context.ContextOuterClass.ServiceId>) responseObserver); + break; + case METHODID_DELETE_SERVICE: + serviceImpl.deleteService((context.ContextOuterClass.ServiceId) request, + (io.grpc.stub.StreamObserver<context.ContextOuterClass.Empty>) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver<Req> invoke( + io.grpc.stub.StreamObserver<Resp> responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private static abstract class ServiceServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + ServiceServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return service.Service.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("ServiceService"); + } + } + + private static final class ServiceServiceFileDescriptorSupplier + extends ServiceServiceBaseDescriptorSupplier { + ServiceServiceFileDescriptorSupplier() {} + } + + private static final class ServiceServiceMethodDescriptorSupplier + extends ServiceServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + ServiceServiceMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (ServiceServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new ServiceServiceFileDescriptorSupplier()) + .addMethod(getCreateServiceMethod()) + .addMethod(getUpdateServiceMethod()) + .addMethod(getDeleteServiceMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/src/policy/target/kubernetes/kubernetes.yml b/src/policy/target/kubernetes/kubernetes.yml index 269478f972d87478f02223336448174ccf03a174..c002153bf11635a83a80648b828c6c7fad0acbb9 100644 --- a/src/policy/target/kubernetes/kubernetes.yml +++ b/src/policy/target/kubernetes/kubernetes.yml @@ -1,24 +1,10 @@ -# 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: v1 kind: Service metadata: annotations: - app.quarkus.io/commit-id: 43bda7817c976a9fb8ed7a410ad4f0ea13f62498 - app.quarkus.io/build-timestamp: 2022-02-15 - 14:44:53 +0000 + app.quarkus.io/commit-id: 665bca2f1245843e8c99eaa1a2c5315a6c002417 + app.quarkus.io/build-timestamp: 2022-07-13 - 10:42:51 +0000 labels: app.kubernetes.io/name: policyservice app: policyservice @@ -26,8 +12,8 @@ metadata: spec: ports: - name: grpc-server - port: 9999 - targetPort: 9999 + port: 6060 + targetPort: 6060 - name: http port: 8080 targetPort: 8080 @@ -39,8 +25,8 @@ apiVersion: apps/v1 kind: Deployment metadata: annotations: - app.quarkus.io/commit-id: 43bda7817c976a9fb8ed7a410ad4f0ea13f62498 - app.quarkus.io/build-timestamp: 2022-02-15 - 14:44:53 +0000 + app.quarkus.io/commit-id: 665bca2f1245843e8c99eaa1a2c5315a6c002417 + app.quarkus.io/build-timestamp: 2022-07-13 - 10:42:51 +0000 labels: app: policyservice app.kubernetes.io/name: policyservice @@ -53,8 +39,8 @@ spec: template: metadata: annotations: - app.quarkus.io/commit-id: 43bda7817c976a9fb8ed7a410ad4f0ea13f62498 - app.quarkus.io/build-timestamp: 2022-02-15 - 14:44:53 +0000 + app.quarkus.io/commit-id: 665bca2f1245843e8c99eaa1a2c5315a6c002417 + app.quarkus.io/build-timestamp: 2022-07-13 - 10:42:51 +0000 labels: app: policyservice app.kubernetes.io/name: policyservice @@ -65,6 +51,12 @@ spec: valueFrom: fieldRef: fieldPath: metadata.namespace + - name: CONTEXT_SERVICE_HOST + value: contextservice + - name: SERVICE_SERVICE_HOST + value: serviceservice + - name: MONITORING_SERVICE_HOST + value: monitoringservice image: registry.gitlab.com/teraflow-h2020/controller/policy:0.1.0 imagePullPolicy: Always livenessProbe: @@ -73,13 +65,13 @@ spec: path: /q/health/live port: 8080 scheme: HTTP - initialDelaySeconds: 5 - periodSeconds: 45 + initialDelaySeconds: 2 + periodSeconds: 10 successThreshold: 1 timeoutSeconds: 10 name: policyservice ports: - - containerPort: 9999 + - containerPort: 6060 name: grpc-server protocol: TCP - containerPort: 8080 @@ -91,7 +83,7 @@ spec: path: /q/health/ready port: 8080 scheme: HTTP - initialDelaySeconds: 5 - periodSeconds: 45 + initialDelaySeconds: 2 + periodSeconds: 10 successThreshold: 1 timeoutSeconds: 10 diff --git a/src/service/.gitlab-ci.yml b/src/service/.gitlab-ci.yml index 3f845a9dd960b6a9dcfd140720b3b8db923f8ddf..a91f9e4edb8cae14029897df3aafa2b6f1bea3a9 100644 --- a/src/service/.gitlab-ci.yml +++ b/src/service/.gitlab-ci.yml @@ -55,7 +55,6 @@ unit test service: - docker ps -a - docker logs $IMAGE_NAME - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml" - - docker exec -i $IMAGE_NAME bash -c "coverage xml -o /opt/results/${IMAGE_NAME}_coverage.xml" - docker exec -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing" coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' after_script: @@ -75,7 +74,6 @@ unit test service: when: always reports: junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml - cobertura: src/$IMAGE_NAME/tests/${IMAGE_NAME}_coverage.xml # Deployment of the service in Kubernetes Cluster deploy service: diff --git a/src/service/Config.py b/src/service/Config.py index 5d551b023fc21202a1411ae46781682055fdef91..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/service/Config.py +++ b/src/service/Config.py @@ -12,22 +12,3 @@ # See the License for the specific language governing permissions and # limitations under the License. -import logging - -# General settings -LOG_LEVEL = logging.WARNING - -# gRPC settings -GRPC_SERVICE_PORT = 3030 -GRPC_MAX_WORKERS = 10 -GRPC_GRACE_PERIOD = 60 - -# Prometheus settings -METRICS_PORT = 9192 - -# Dependency micro-service connection settings -CONTEXT_SERVICE_HOST = '127.0.0.1' -CONTEXT_SERVICE_PORT = 1010 - -DEVICE_SERVICE_HOST = '127.0.0.1' -DEVICE_SERVICE_PORT = 2020 diff --git a/src/service/client/ServiceClient.py b/src/service/client/ServiceClient.py index af489c0c672ac601939fe907e179cd0c83a3d140..a6335bfceedeec02cd223f4e960e9f69afe7a35e 100644 --- a/src/service/client/ServiceClient.py +++ b/src/service/client/ServiceClient.py @@ -13,7 +13,10 @@ # limitations under the License. import grpc, logging +from common.Constants import ServiceNameEnum +from common.Settings import get_service_host, get_service_port_grpc from common.tools.client.RetryDecorator import retry, delay_exponential +from common.tools.grpc.Tools import grpc_message_to_json_string from service.proto.context_pb2 import Empty, Service, ServiceId from service.proto.service_pb2_grpc import ServiceServiceStub @@ -23,9 +26,11 @@ DELAY_FUNCTION = delay_exponential(initial=0.01, increment=2.0, maximum=5.0) RETRY_DECORATOR = retry(max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') class ServiceClient: - def __init__(self, address, port): - self.endpoint = '{:s}:{:s}'.format(str(address), str(port)) - LOGGER.debug('Creating channel to {:s}...'.format(self.endpoint)) + def __init__(self, host=None, port=None): + if not host: host = get_service_host(ServiceNameEnum.SERVICE) + if not port: port = get_service_port_grpc(ServiceNameEnum.SERVICE) + self.endpoint = '{:s}:{:s}'.format(str(host), str(port)) + LOGGER.debug('Creating channel to {:s}...'.format(str(self.endpoint))) self.channel = None self.stub = None self.connect() @@ -42,21 +47,21 @@ class ServiceClient: @RETRY_DECORATOR def CreateService(self, request : Service) -> ServiceId: - LOGGER.debug('CreateService request: {:s}'.format(str(request))) + LOGGER.debug('CreateService request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.CreateService(request) - LOGGER.debug('CreateService result: {:s}'.format(str(response))) + LOGGER.debug('CreateService result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def UpdateService(self, request : Service) -> ServiceId: - LOGGER.debug('UpdateService request: {:s}'.format(str(request))) + LOGGER.debug('UpdateService request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.UpdateService(request) - LOGGER.debug('UpdateService result: {:s}'.format(str(response))) + LOGGER.debug('UpdateService result: {:s}'.format(grpc_message_to_json_string(response))) return response @RETRY_DECORATOR def DeleteService(self, request : ServiceId) -> Empty: - LOGGER.debug('DeleteService request: {:s}'.format(str(request))) + LOGGER.debug('DeleteService request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.DeleteService(request) - LOGGER.debug('DeleteService result: {:s}'.format(str(response))) + LOGGER.debug('DeleteService result: {:s}'.format(grpc_message_to_json_string(response))) return response diff --git a/src/service/genproto.sh b/src/service/genproto.sh index 7ea496d6fc49bccbd57acfea9c2ac4dce6ae1fa1..529054968d95ae337e8c7954d8ba21e5fa67abf3 100755 --- a/src/service/genproto.sh +++ b/src/service/genproto.sh @@ -1,6 +1,6 @@ #!/bin/bash -eu # -# Copyright 2018 Google LLC +# 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. @@ -14,14 +14,27 @@ # See the License for the specific language governing permissions and # limitations under the License. -#!/bin/bash -e - # Make folder containing the script the root folder for its execution cd $(dirname $0) rm -rf proto/*.py rm -rf proto/__pycache__ -touch proto/__init__.py +tee proto/__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 python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto context.proto python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto service.proto diff --git a/src/service/proto/context_pb2.py b/src/service/proto/context_pb2.py index 68602b16f264ceac9acc3ef6669b09d5984e72c2..50d501d3ac053ad644554331af26e3c40cd426a1 100644 --- a/src/service/proto/context_pb2.py +++ b/src/service/proto/context_pb2.py @@ -21,7 +21,7 @@ DESCRIPTOR = _descriptor.FileDescriptor( syntax='proto3', serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\rcontext.proto\x12\x07\x63ontext\x1a\x16kpi_sample_types.proto\"\x07\n\x05\x45mpty\"\x14\n\x04Uuid\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"F\n\x05\x45vent\x12\x11\n\ttimestamp\x18\x01 \x01(\x01\x12*\n\nevent_type\x18\x02 \x01(\x0e\x32\x16.context.EventTypeEnum\"0\n\tContextId\x12#\n\x0c\x63ontext_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xb6\x01\n\x07\x43ontext\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12)\n\x0ctopology_ids\x18\x02 \x03(\x0b\x32\x13.context.TopologyId\x12\'\n\x0bservice_ids\x18\x03 \x03(\x0b\x32\x12.context.ServiceId\x12/\n\ncontroller\x18\x04 \x01(\x0b\x32\x1b.context.TeraFlowController\"8\n\rContextIdList\x12\'\n\x0b\x63ontext_ids\x18\x01 \x03(\x0b\x32\x12.context.ContextId\"1\n\x0b\x43ontextList\x12\"\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32\x10.context.Context\"U\n\x0c\x43ontextEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\ncontext_id\x18\x02 \x01(\x0b\x32\x12.context.ContextId\"Z\n\nTopologyId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12$\n\rtopology_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"~\n\x08Topology\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12%\n\ndevice_ids\x18\x02 \x03(\x0b\x32\x11.context.DeviceId\x12!\n\x08link_ids\x18\x03 \x03(\x0b\x32\x0f.context.LinkId\";\n\x0eTopologyIdList\x12)\n\x0ctopology_ids\x18\x01 \x03(\x0b\x32\x13.context.TopologyId\"5\n\x0cTopologyList\x12%\n\ntopologies\x18\x01 \x03(\x0b\x32\x11.context.Topology\"X\n\rTopologyEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12(\n\x0btopology_id\x18\x02 \x01(\x0b\x32\x13.context.TopologyId\".\n\x08\x44\x65viceId\x12\"\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x9a\x02\n\x06\x44\x65vice\x12$\n\tdevice_id\x18\x01 \x01(\x0b\x32\x11.context.DeviceId\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12,\n\rdevice_config\x18\x03 \x01(\x0b\x32\x15.context.DeviceConfig\x12G\n\x19\x64\x65vice_operational_status\x18\x04 \x01(\x0e\x32$.context.DeviceOperationalStatusEnum\x12\x31\n\x0e\x64\x65vice_drivers\x18\x05 \x03(\x0e\x32\x19.context.DeviceDriverEnum\x12+\n\x10\x64\x65vice_endpoints\x18\x06 \x03(\x0b\x32\x11.context.EndPoint\"9\n\x0c\x44\x65viceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"5\n\x0c\x44\x65viceIdList\x12%\n\ndevice_ids\x18\x01 \x03(\x0b\x32\x11.context.DeviceId\".\n\nDeviceList\x12 \n\x07\x64\x65vices\x18\x01 \x03(\x0b\x32\x0f.context.Device\"R\n\x0b\x44\x65viceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"*\n\x06LinkId\x12 \n\tlink_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"X\n\x04Link\x12 \n\x07link_id\x18\x01 \x01(\x0b\x32\x0f.context.LinkId\x12.\n\x11link_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\"/\n\nLinkIdList\x12!\n\x08link_ids\x18\x01 \x03(\x0b\x32\x0f.context.LinkId\"(\n\x08LinkList\x12\x1c\n\x05links\x18\x01 \x03(\x0b\x32\r.context.Link\"L\n\tLinkEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12 \n\x07link_id\x18\x02 \x01(\x0b\x32\x0f.context.LinkId\"X\n\tServiceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12#\n\x0cservice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\xa6\x02\n\x07Service\x12&\n\nservice_id\x18\x01 \x01(\x0b\x32\x12.context.ServiceId\x12.\n\x0cservice_type\x18\x02 \x01(\x0e\x32\x18.context.ServiceTypeEnum\x12\x31\n\x14service_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12\x30\n\x13service_constraints\x18\x04 \x03(\x0b\x32\x13.context.Constraint\x12.\n\x0eservice_status\x18\x05 \x01(\x0b\x32\x16.context.ServiceStatus\x12.\n\x0eservice_config\x18\x06 \x01(\x0b\x32\x16.context.ServiceConfig\"C\n\rServiceStatus\x12\x32\n\x0eservice_status\x18\x01 \x01(\x0e\x32\x1a.context.ServiceStatusEnum\":\n\rServiceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"8\n\rServiceIdList\x12\'\n\x0bservice_ids\x18\x01 \x03(\x0b\x32\x12.context.ServiceId\"1\n\x0bServiceList\x12\"\n\x08services\x18\x01 \x03(\x0b\x32\x10.context.Service\"U\n\x0cServiceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\"6\n\x0c\x43onnectionId\x12&\n\x0f\x63onnection_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xc4\x01\n\nConnection\x12,\n\rconnection_id\x18\x01 \x01(\x0b\x32\x15.context.ConnectionId\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\x12\x33\n\x16path_hops_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12+\n\x0fsub_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\"A\n\x10\x43onnectionIdList\x12-\n\x0e\x63onnection_ids\x18\x01 \x03(\x0b\x32\x15.context.ConnectionId\":\n\x0e\x43onnectionList\x12(\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x13.context.Connection\"^\n\x0f\x43onnectionEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12,\n\rconnection_id\x18\x02 \x01(\x0b\x32\x15.context.ConnectionId\"\x82\x01\n\nEndPointId\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\x12$\n\rendpoint_uuid\x18\x03 \x01(\x0b\x32\r.context.Uuid\"\x86\x01\n\x08\x45ndPoint\x12(\n\x0b\x65ndpoint_id\x18\x01 \x01(\x0b\x32\x13.context.EndPointId\x12\x15\n\rendpoint_type\x18\x02 \x01(\t\x12\x39\n\x10kpi_sample_types\x18\x03 \x03(\x0e\x32\x1f.kpi_sample_types.KpiSampleType\"e\n\nConfigRule\x12)\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x19.context.ConfigActionEnum\x12\x14\n\x0cresource_key\x18\x02 \x01(\t\x12\x16\n\x0eresource_value\x18\x03 \x01(\t\"?\n\nConstraint\x12\x17\n\x0f\x63onstraint_type\x18\x01 \x01(\t\x12\x18\n\x10\x63onstraint_value\x18\x02 \x01(\t\"^\n\x12TeraFlowController\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x12\n\nip_address\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\"U\n\x14\x41uthenticationResult\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x15\n\rauthenticated\x18\x02 \x01(\x08*j\n\rEventTypeEnum\x12\x17\n\x13\x45VENTTYPE_UNDEFINED\x10\x00\x12\x14\n\x10\x45VENTTYPE_CREATE\x10\x01\x12\x14\n\x10\x45VENTTYPE_UPDATE\x10\x02\x12\x14\n\x10\x45VENTTYPE_REMOVE\x10\x03*\xc5\x01\n\x10\x44\x65viceDriverEnum\x12\x1a\n\x16\x44\x45VICEDRIVER_UNDEFINED\x10\x00\x12\x1b\n\x17\x44\x45VICEDRIVER_OPENCONFIG\x10\x01\x12\x1e\n\x1a\x44\x45VICEDRIVER_TRANSPORT_API\x10\x02\x12\x13\n\x0f\x44\x45VICEDRIVER_P4\x10\x03\x12&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOGY\x10\x04\x12\x1b\n\x17\x44\x45VICEDRIVER_ONF_TR_352\x10\x05*\x8f\x01\n\x1b\x44\x65viceOperationalStatusEnum\x12%\n!DEVICEOPERATIONALSTATUS_UNDEFINED\x10\x00\x12$\n DEVICEOPERATIONALSTATUS_DISABLED\x10\x01\x12#\n\x1f\x44\x45VICEOPERATIONALSTATUS_ENABLED\x10\x02*\x81\x01\n\x0fServiceTypeEnum\x12\x17\n\x13SERVICETYPE_UNKNOWN\x10\x00\x12\x14\n\x10SERVICETYPE_L3NM\x10\x01\x12\x14\n\x10SERVICETYPE_L2NM\x10\x02\x12)\n%SERVICETYPE_TAPI_CONNECTIVITY_SERVICE\x10\x03*\x88\x01\n\x11ServiceStatusEnum\x12\x1b\n\x17SERVICESTATUS_UNDEFINED\x10\x00\x12\x19\n\x15SERVICESTATUS_PLANNED\x10\x01\x12\x18\n\x14SERVICESTATUS_ACTIVE\x10\x02\x12!\n\x1dSERVICESTATUS_PENDING_REMOVAL\x10\x03*]\n\x10\x43onfigActionEnum\x12\x1a\n\x16\x43ONFIGACTION_UNDEFINED\x10\x00\x12\x14\n\x10\x43ONFIGACTION_SET\x10\x01\x12\x17\n\x13\x43ONFIGACTION_DELETE\x10\x02\x32\xad\x10\n\x0e\x43ontextService\x12:\n\x0eListContextIds\x12\x0e.context.Empty\x1a\x16.context.ContextIdList\"\x00\x12\x36\n\x0cListContexts\x12\x0e.context.Empty\x1a\x14.context.ContextList\"\x00\x12\x34\n\nGetContext\x12\x12.context.ContextId\x1a\x10.context.Context\"\x00\x12\x34\n\nSetContext\x12\x10.context.Context\x1a\x12.context.ContextId\"\x00\x12\x35\n\rRemoveContext\x12\x12.context.ContextId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetContextEvents\x12\x0e.context.Empty\x1a\x15.context.ContextEvent\"\x00\x30\x01\x12@\n\x0fListTopologyIds\x12\x12.context.ContextId\x1a\x17.context.TopologyIdList\"\x00\x12=\n\x0eListTopologies\x12\x12.context.ContextId\x1a\x15.context.TopologyList\"\x00\x12\x37\n\x0bGetTopology\x12\x13.context.TopologyId\x1a\x11.context.Topology\"\x00\x12\x37\n\x0bSetTopology\x12\x11.context.Topology\x1a\x13.context.TopologyId\"\x00\x12\x37\n\x0eRemoveTopology\x12\x13.context.TopologyId\x1a\x0e.context.Empty\"\x00\x12?\n\x11GetTopologyEvents\x12\x0e.context.Empty\x1a\x16.context.TopologyEvent\"\x00\x30\x01\x12\x38\n\rListDeviceIds\x12\x0e.context.Empty\x1a\x15.context.DeviceIdList\"\x00\x12\x34\n\x0bListDevices\x12\x0e.context.Empty\x1a\x13.context.DeviceList\"\x00\x12\x31\n\tGetDevice\x12\x11.context.DeviceId\x1a\x0f.context.Device\"\x00\x12\x31\n\tSetDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0cRemoveDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x12;\n\x0fGetDeviceEvents\x12\x0e.context.Empty\x1a\x14.context.DeviceEvent\"\x00\x30\x01\x12\x34\n\x0bListLinkIds\x12\x0e.context.Empty\x1a\x13.context.LinkIdList\"\x00\x12\x30\n\tListLinks\x12\x0e.context.Empty\x1a\x11.context.LinkList\"\x00\x12+\n\x07GetLink\x12\x0f.context.LinkId\x1a\r.context.Link\"\x00\x12+\n\x07SetLink\x12\r.context.Link\x1a\x0f.context.LinkId\"\x00\x12/\n\nRemoveLink\x12\x0f.context.LinkId\x1a\x0e.context.Empty\"\x00\x12\x37\n\rGetLinkEvents\x12\x0e.context.Empty\x1a\x12.context.LinkEvent\"\x00\x30\x01\x12>\n\x0eListServiceIds\x12\x12.context.ContextId\x1a\x16.context.ServiceIdList\"\x00\x12:\n\x0cListServices\x12\x12.context.ContextId\x1a\x14.context.ServiceList\"\x00\x12\x34\n\nGetService\x12\x12.context.ServiceId\x1a\x10.context.Service\"\x00\x12\x34\n\nSetService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rRemoveService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetServiceEvents\x12\x0e.context.Empty\x1a\x15.context.ServiceEvent\"\x00\x30\x01\x12\x44\n\x11ListConnectionIds\x12\x12.context.ServiceId\x1a\x19.context.ConnectionIdList\"\x00\x12@\n\x0fListConnections\x12\x12.context.ServiceId\x1a\x17.context.ConnectionList\"\x00\x12=\n\rGetConnection\x12\x15.context.ConnectionId\x1a\x13.context.Connection\"\x00\x12=\n\rSetConnection\x12\x13.context.Connection\x1a\x15.context.ConnectionId\"\x00\x12;\n\x10RemoveConnection\x12\x15.context.ConnectionId\x1a\x0e.context.Empty\"\x00\x12\x43\n\x13GetConnectionEvents\x12\x0e.context.Empty\x1a\x18.context.ConnectionEvent\"\x00\x30\x01\x62\x06proto3' + serialized_pb=b'\n\rcontext.proto\x12\x07\x63ontext\x1a\x16kpi_sample_types.proto\"\x07\n\x05\x45mpty\"\x14\n\x04Uuid\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"F\n\x05\x45vent\x12\x11\n\ttimestamp\x18\x01 \x01(\x01\x12*\n\nevent_type\x18\x02 \x01(\x0e\x32\x16.context.EventTypeEnum\"0\n\tContextId\x12#\n\x0c\x63ontext_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xb6\x01\n\x07\x43ontext\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12)\n\x0ctopology_ids\x18\x02 \x03(\x0b\x32\x13.context.TopologyId\x12\'\n\x0bservice_ids\x18\x03 \x03(\x0b\x32\x12.context.ServiceId\x12/\n\ncontroller\x18\x04 \x01(\x0b\x32\x1b.context.TeraFlowController\"8\n\rContextIdList\x12\'\n\x0b\x63ontext_ids\x18\x01 \x03(\x0b\x32\x12.context.ContextId\"1\n\x0b\x43ontextList\x12\"\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32\x10.context.Context\"U\n\x0c\x43ontextEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\ncontext_id\x18\x02 \x01(\x0b\x32\x12.context.ContextId\"Z\n\nTopologyId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12$\n\rtopology_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"~\n\x08Topology\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12%\n\ndevice_ids\x18\x02 \x03(\x0b\x32\x11.context.DeviceId\x12!\n\x08link_ids\x18\x03 \x03(\x0b\x32\x0f.context.LinkId\";\n\x0eTopologyIdList\x12)\n\x0ctopology_ids\x18\x01 \x03(\x0b\x32\x13.context.TopologyId\"5\n\x0cTopologyList\x12%\n\ntopologies\x18\x01 \x03(\x0b\x32\x11.context.Topology\"X\n\rTopologyEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12(\n\x0btopology_id\x18\x02 \x01(\x0b\x32\x13.context.TopologyId\".\n\x08\x44\x65viceId\x12\"\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x9a\x02\n\x06\x44\x65vice\x12$\n\tdevice_id\x18\x01 \x01(\x0b\x32\x11.context.DeviceId\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12,\n\rdevice_config\x18\x03 \x01(\x0b\x32\x15.context.DeviceConfig\x12G\n\x19\x64\x65vice_operational_status\x18\x04 \x01(\x0e\x32$.context.DeviceOperationalStatusEnum\x12\x31\n\x0e\x64\x65vice_drivers\x18\x05 \x03(\x0e\x32\x19.context.DeviceDriverEnum\x12+\n\x10\x64\x65vice_endpoints\x18\x06 \x03(\x0b\x32\x11.context.EndPoint\"9\n\x0c\x44\x65viceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"5\n\x0c\x44\x65viceIdList\x12%\n\ndevice_ids\x18\x01 \x03(\x0b\x32\x11.context.DeviceId\".\n\nDeviceList\x12 \n\x07\x64\x65vices\x18\x01 \x03(\x0b\x32\x0f.context.Device\"R\n\x0b\x44\x65viceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"*\n\x06LinkId\x12 \n\tlink_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"X\n\x04Link\x12 \n\x07link_id\x18\x01 \x01(\x0b\x32\x0f.context.LinkId\x12.\n\x11link_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\"/\n\nLinkIdList\x12!\n\x08link_ids\x18\x01 \x03(\x0b\x32\x0f.context.LinkId\"(\n\x08LinkList\x12\x1c\n\x05links\x18\x01 \x03(\x0b\x32\r.context.Link\"L\n\tLinkEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12 \n\x07link_id\x18\x02 \x01(\x0b\x32\x0f.context.LinkId\"X\n\tServiceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12#\n\x0cservice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\xa6\x02\n\x07Service\x12&\n\nservice_id\x18\x01 \x01(\x0b\x32\x12.context.ServiceId\x12.\n\x0cservice_type\x18\x02 \x01(\x0e\x32\x18.context.ServiceTypeEnum\x12\x31\n\x14service_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12\x30\n\x13service_constraints\x18\x04 \x03(\x0b\x32\x13.context.Constraint\x12.\n\x0eservice_status\x18\x05 \x01(\x0b\x32\x16.context.ServiceStatus\x12.\n\x0eservice_config\x18\x06 \x01(\x0b\x32\x16.context.ServiceConfig\"C\n\rServiceStatus\x12\x32\n\x0eservice_status\x18\x01 \x01(\x0e\x32\x1a.context.ServiceStatusEnum\":\n\rServiceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"8\n\rServiceIdList\x12\'\n\x0bservice_ids\x18\x01 \x03(\x0b\x32\x12.context.ServiceId\"1\n\x0bServiceList\x12\"\n\x08services\x18\x01 \x03(\x0b\x32\x10.context.Service\"U\n\x0cServiceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\"T\n\x07SliceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12!\n\nslice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\x95\x02\n\x05Slice\x12\"\n\x08slice_id\x18\x01 \x01(\x0b\x32\x10.context.SliceId\x12/\n\x12slice_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\x12.\n\x11slice_constraints\x18\x03 \x03(\x0b\x32\x13.context.Constraint\x12-\n\x11slice_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\x12,\n\x12slice_subslice_ids\x18\x05 \x03(\x0b\x32\x10.context.SliceId\x12*\n\x0cslice_status\x18\x06 \x01(\x0b\x32\x14.context.SliceStatus\"=\n\x0bSliceStatus\x12.\n\x0cslice_status\x18\x01 \x01(\x0e\x32\x18.context.SliceStatusEnum\"2\n\x0bSliceIdList\x12#\n\tslice_ids\x18\x01 \x03(\x0b\x32\x10.context.SliceId\"+\n\tSliceList\x12\x1e\n\x06slices\x18\x01 \x03(\x0b\x32\x0e.context.Slice\"O\n\nSliceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12\"\n\x08slice_id\x18\x02 \x01(\x0b\x32\x10.context.SliceId\"6\n\x0c\x43onnectionId\x12&\n\x0f\x63onnection_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xc4\x01\n\nConnection\x12,\n\rconnection_id\x18\x01 \x01(\x0b\x32\x15.context.ConnectionId\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\x12\x33\n\x16path_hops_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12+\n\x0fsub_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\"A\n\x10\x43onnectionIdList\x12-\n\x0e\x63onnection_ids\x18\x01 \x03(\x0b\x32\x15.context.ConnectionId\":\n\x0e\x43onnectionList\x12(\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x13.context.Connection\"^\n\x0f\x43onnectionEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12,\n\rconnection_id\x18\x02 \x01(\x0b\x32\x15.context.ConnectionId\"\x82\x01\n\nEndPointId\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\x12$\n\rendpoint_uuid\x18\x03 \x01(\x0b\x32\r.context.Uuid\"\x86\x01\n\x08\x45ndPoint\x12(\n\x0b\x65ndpoint_id\x18\x01 \x01(\x0b\x32\x13.context.EndPointId\x12\x15\n\rendpoint_type\x18\x02 \x01(\t\x12\x39\n\x10kpi_sample_types\x18\x03 \x03(\x0e\x32\x1f.kpi_sample_types.KpiSampleType\"e\n\nConfigRule\x12)\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x19.context.ConfigActionEnum\x12\x14\n\x0cresource_key\x18\x02 \x01(\t\x12\x16\n\x0eresource_value\x18\x03 \x01(\t\"?\n\nConstraint\x12\x17\n\x0f\x63onstraint_type\x18\x01 \x01(\t\x12\x18\n\x10\x63onstraint_value\x18\x02 \x01(\t\"^\n\x12TeraFlowController\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x12\n\nip_address\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\"U\n\x14\x41uthenticationResult\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x15\n\rauthenticated\x18\x02 \x01(\x08*j\n\rEventTypeEnum\x12\x17\n\x13\x45VENTTYPE_UNDEFINED\x10\x00\x12\x14\n\x10\x45VENTTYPE_CREATE\x10\x01\x12\x14\n\x10\x45VENTTYPE_UPDATE\x10\x02\x12\x14\n\x10\x45VENTTYPE_REMOVE\x10\x03*\xc5\x01\n\x10\x44\x65viceDriverEnum\x12\x1a\n\x16\x44\x45VICEDRIVER_UNDEFINED\x10\x00\x12\x1b\n\x17\x44\x45VICEDRIVER_OPENCONFIG\x10\x01\x12\x1e\n\x1a\x44\x45VICEDRIVER_TRANSPORT_API\x10\x02\x12\x13\n\x0f\x44\x45VICEDRIVER_P4\x10\x03\x12&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOGY\x10\x04\x12\x1b\n\x17\x44\x45VICEDRIVER_ONF_TR_352\x10\x05*\x8f\x01\n\x1b\x44\x65viceOperationalStatusEnum\x12%\n!DEVICEOPERATIONALSTATUS_UNDEFINED\x10\x00\x12$\n DEVICEOPERATIONALSTATUS_DISABLED\x10\x01\x12#\n\x1f\x44\x45VICEOPERATIONALSTATUS_ENABLED\x10\x02*\x81\x01\n\x0fServiceTypeEnum\x12\x17\n\x13SERVICETYPE_UNKNOWN\x10\x00\x12\x14\n\x10SERVICETYPE_L3NM\x10\x01\x12\x14\n\x10SERVICETYPE_L2NM\x10\x02\x12)\n%SERVICETYPE_TAPI_CONNECTIVITY_SERVICE\x10\x03*\x88\x01\n\x11ServiceStatusEnum\x12\x1b\n\x17SERVICESTATUS_UNDEFINED\x10\x00\x12\x19\n\x15SERVICESTATUS_PLANNED\x10\x01\x12\x18\n\x14SERVICESTATUS_ACTIVE\x10\x02\x12!\n\x1dSERVICESTATUS_PENDING_REMOVAL\x10\x03*\x8b\x01\n\x0fSliceStatusEnum\x12\x19\n\x15SLICESTATUS_UNDEFINED\x10\x00\x12\x17\n\x13SLICESTATUS_PLANNED\x10\x01\x12\x14\n\x10SLICESTATUS_INIT\x10\x02\x12\x16\n\x12SLICESTATUS_ACTIVE\x10\x03\x12\x16\n\x12SLICESTATUS_DEINIT\x10\x04*]\n\x10\x43onfigActionEnum\x12\x1a\n\x16\x43ONFIGACTION_UNDEFINED\x10\x00\x12\x14\n\x10\x43ONFIGACTION_SET\x10\x01\x12\x17\n\x13\x43ONFIGACTION_DELETE\x10\x02\x32\xef\x12\n\x0e\x43ontextService\x12:\n\x0eListContextIds\x12\x0e.context.Empty\x1a\x16.context.ContextIdList\"\x00\x12\x36\n\x0cListContexts\x12\x0e.context.Empty\x1a\x14.context.ContextList\"\x00\x12\x34\n\nGetContext\x12\x12.context.ContextId\x1a\x10.context.Context\"\x00\x12\x34\n\nSetContext\x12\x10.context.Context\x1a\x12.context.ContextId\"\x00\x12\x35\n\rRemoveContext\x12\x12.context.ContextId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetContextEvents\x12\x0e.context.Empty\x1a\x15.context.ContextEvent\"\x00\x30\x01\x12@\n\x0fListTopologyIds\x12\x12.context.ContextId\x1a\x17.context.TopologyIdList\"\x00\x12=\n\x0eListTopologies\x12\x12.context.ContextId\x1a\x15.context.TopologyList\"\x00\x12\x37\n\x0bGetTopology\x12\x13.context.TopologyId\x1a\x11.context.Topology\"\x00\x12\x37\n\x0bSetTopology\x12\x11.context.Topology\x1a\x13.context.TopologyId\"\x00\x12\x37\n\x0eRemoveTopology\x12\x13.context.TopologyId\x1a\x0e.context.Empty\"\x00\x12?\n\x11GetTopologyEvents\x12\x0e.context.Empty\x1a\x16.context.TopologyEvent\"\x00\x30\x01\x12\x38\n\rListDeviceIds\x12\x0e.context.Empty\x1a\x15.context.DeviceIdList\"\x00\x12\x34\n\x0bListDevices\x12\x0e.context.Empty\x1a\x13.context.DeviceList\"\x00\x12\x31\n\tGetDevice\x12\x11.context.DeviceId\x1a\x0f.context.Device\"\x00\x12\x31\n\tSetDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0cRemoveDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x12;\n\x0fGetDeviceEvents\x12\x0e.context.Empty\x1a\x14.context.DeviceEvent\"\x00\x30\x01\x12\x34\n\x0bListLinkIds\x12\x0e.context.Empty\x1a\x13.context.LinkIdList\"\x00\x12\x30\n\tListLinks\x12\x0e.context.Empty\x1a\x11.context.LinkList\"\x00\x12+\n\x07GetLink\x12\x0f.context.LinkId\x1a\r.context.Link\"\x00\x12+\n\x07SetLink\x12\r.context.Link\x1a\x0f.context.LinkId\"\x00\x12/\n\nRemoveLink\x12\x0f.context.LinkId\x1a\x0e.context.Empty\"\x00\x12\x37\n\rGetLinkEvents\x12\x0e.context.Empty\x1a\x12.context.LinkEvent\"\x00\x30\x01\x12>\n\x0eListServiceIds\x12\x12.context.ContextId\x1a\x16.context.ServiceIdList\"\x00\x12:\n\x0cListServices\x12\x12.context.ContextId\x1a\x14.context.ServiceList\"\x00\x12\x34\n\nGetService\x12\x12.context.ServiceId\x1a\x10.context.Service\"\x00\x12\x34\n\nSetService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rRemoveService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetServiceEvents\x12\x0e.context.Empty\x1a\x15.context.ServiceEvent\"\x00\x30\x01\x12:\n\x0cListSliceIds\x12\x12.context.ContextId\x1a\x14.context.SliceIdList\"\x00\x12\x36\n\nListSlices\x12\x12.context.ContextId\x1a\x12.context.SliceList\"\x00\x12.\n\x08GetSlice\x12\x10.context.SliceId\x1a\x0e.context.Slice\"\x00\x12.\n\x08SetSlice\x12\x0e.context.Slice\x1a\x10.context.SliceId\"\x00\x12\x31\n\x0bRemoveSlice\x12\x10.context.SliceId\x1a\x0e.context.Empty\"\x00\x12\x39\n\x0eGetSliceEvents\x12\x0e.context.Empty\x1a\x13.context.SliceEvent\"\x00\x30\x01\x12\x44\n\x11ListConnectionIds\x12\x12.context.ServiceId\x1a\x19.context.ConnectionIdList\"\x00\x12@\n\x0fListConnections\x12\x12.context.ServiceId\x1a\x17.context.ConnectionList\"\x00\x12=\n\rGetConnection\x12\x15.context.ConnectionId\x1a\x13.context.Connection\"\x00\x12=\n\rSetConnection\x12\x13.context.Connection\x1a\x15.context.ConnectionId\"\x00\x12;\n\x10RemoveConnection\x12\x15.context.ConnectionId\x1a\x0e.context.Empty\"\x00\x12\x43\n\x13GetConnectionEvents\x12\x0e.context.Empty\x1a\x18.context.ConnectionEvent\"\x00\x30\x01\x62\x06proto3' , dependencies=[kpi__sample__types__pb2.DESCRIPTOR,]) @@ -55,8 +55,8 @@ _EVENTTYPEENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=3703, - serialized_end=3809, + serialized_start=4310, + serialized_end=4416, ) _sym_db.RegisterEnumDescriptor(_EVENTTYPEENUM) @@ -101,8 +101,8 @@ _DEVICEDRIVERENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=3812, - serialized_end=4009, + serialized_start=4419, + serialized_end=4616, ) _sym_db.RegisterEnumDescriptor(_DEVICEDRIVERENUM) @@ -132,8 +132,8 @@ _DEVICEOPERATIONALSTATUSENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4012, - serialized_end=4155, + serialized_start=4619, + serialized_end=4762, ) _sym_db.RegisterEnumDescriptor(_DEVICEOPERATIONALSTATUSENUM) @@ -168,8 +168,8 @@ _SERVICETYPEENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4158, - serialized_end=4287, + serialized_start=4765, + serialized_end=4894, ) _sym_db.RegisterEnumDescriptor(_SERVICETYPEENUM) @@ -204,12 +204,53 @@ _SERVICESTATUSENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4290, - serialized_end=4426, + serialized_start=4897, + serialized_end=5033, ) _sym_db.RegisterEnumDescriptor(_SERVICESTATUSENUM) ServiceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICESTATUSENUM) +_SLICESTATUSENUM = _descriptor.EnumDescriptor( + name='SliceStatusEnum', + full_name='context.SliceStatusEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_PLANNED', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_INIT', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_ACTIVE', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_DEINIT', index=4, number=4, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=5036, + serialized_end=5175, +) +_sym_db.RegisterEnumDescriptor(_SLICESTATUSENUM) + +SliceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SLICESTATUSENUM) _CONFIGACTIONENUM = _descriptor.EnumDescriptor( name='ConfigActionEnum', full_name='context.ConfigActionEnum', @@ -235,8 +276,8 @@ _CONFIGACTIONENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4428, - serialized_end=4521, + serialized_start=5177, + serialized_end=5270, ) _sym_db.RegisterEnumDescriptor(_CONFIGACTIONENUM) @@ -262,6 +303,11 @@ SERVICESTATUS_UNDEFINED = 0 SERVICESTATUS_PLANNED = 1 SERVICESTATUS_ACTIVE = 2 SERVICESTATUS_PENDING_REMOVAL = 3 +SLICESTATUS_UNDEFINED = 0 +SLICESTATUS_PLANNED = 1 +SLICESTATUS_INIT = 2 +SLICESTATUS_ACTIVE = 3 +SLICESTATUS_DEINIT = 4 CONFIGACTION_UNDEFINED = 0 CONFIGACTION_SET = 1 CONFIGACTION_DELETE = 2 @@ -1421,6 +1467,247 @@ _SERVICEEVENT = _descriptor.Descriptor( ) +_SLICEID = _descriptor.Descriptor( + name='SliceId', + full_name='context.SliceId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_id', full_name='context.SliceId.context_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_uuid', full_name='context.SliceId.slice_uuid', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2604, + serialized_end=2688, +) + + +_SLICE = _descriptor.Descriptor( + name='Slice', + full_name='context.Slice', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_id', full_name='context.Slice.slice_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_endpoint_ids', full_name='context.Slice.slice_endpoint_ids', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_constraints', full_name='context.Slice.slice_constraints', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_service_ids', full_name='context.Slice.slice_service_ids', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_subslice_ids', full_name='context.Slice.slice_subslice_ids', index=4, + number=5, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_status', full_name='context.Slice.slice_status', index=5, + number=6, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2691, + serialized_end=2968, +) + + +_SLICESTATUS = _descriptor.Descriptor( + name='SliceStatus', + full_name='context.SliceStatus', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_status', full_name='context.SliceStatus.slice_status', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2970, + serialized_end=3031, +) + + +_SLICEIDLIST = _descriptor.Descriptor( + name='SliceIdList', + full_name='context.SliceIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_ids', full_name='context.SliceIdList.slice_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3033, + serialized_end=3083, +) + + +_SLICELIST = _descriptor.Descriptor( + name='SliceList', + full_name='context.SliceList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slices', full_name='context.SliceList.slices', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3085, + serialized_end=3128, +) + + +_SLICEEVENT = _descriptor.Descriptor( + name='SliceEvent', + full_name='context.SliceEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.SliceEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_id', full_name='context.SliceEvent.slice_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3130, + serialized_end=3209, +) + + _CONNECTIONID = _descriptor.Descriptor( name='ConnectionId', full_name='context.ConnectionId', @@ -1448,8 +1735,8 @@ _CONNECTIONID = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2604, - serialized_end=2658, + serialized_start=3211, + serialized_end=3265, ) @@ -1501,8 +1788,8 @@ _CONNECTION = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2661, - serialized_end=2857, + serialized_start=3268, + serialized_end=3464, ) @@ -1533,8 +1820,8 @@ _CONNECTIONIDLIST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2859, - serialized_end=2924, + serialized_start=3466, + serialized_end=3531, ) @@ -1565,8 +1852,8 @@ _CONNECTIONLIST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2926, - serialized_end=2984, + serialized_start=3533, + serialized_end=3591, ) @@ -1604,8 +1891,8 @@ _CONNECTIONEVENT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2986, - serialized_end=3080, + serialized_start=3593, + serialized_end=3687, ) @@ -1650,8 +1937,8 @@ _ENDPOINTID = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3083, - serialized_end=3213, + serialized_start=3690, + serialized_end=3820, ) @@ -1696,8 +1983,8 @@ _ENDPOINT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3216, - serialized_end=3350, + serialized_start=3823, + serialized_end=3957, ) @@ -1742,8 +2029,8 @@ _CONFIGRULE = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3352, - serialized_end=3453, + serialized_start=3959, + serialized_end=4060, ) @@ -1781,8 +2068,8 @@ _CONSTRAINT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3455, - serialized_end=3518, + serialized_start=4062, + serialized_end=4125, ) @@ -1827,8 +2114,8 @@ _TERAFLOWCONTROLLER = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3520, - serialized_end=3614, + serialized_start=4127, + serialized_end=4221, ) @@ -1866,8 +2153,8 @@ _AUTHENTICATIONRESULT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3616, - serialized_end=3701, + serialized_start=4223, + serialized_end=4308, ) _EVENT.fields_by_name['event_type'].enum_type = _EVENTTYPEENUM @@ -1921,6 +2208,19 @@ _SERVICEIDLIST.fields_by_name['service_ids'].message_type = _SERVICEID _SERVICELIST.fields_by_name['services'].message_type = _SERVICE _SERVICEEVENT.fields_by_name['event'].message_type = _EVENT _SERVICEEVENT.fields_by_name['service_id'].message_type = _SERVICEID +_SLICEID.fields_by_name['context_id'].message_type = _CONTEXTID +_SLICEID.fields_by_name['slice_uuid'].message_type = _UUID +_SLICE.fields_by_name['slice_id'].message_type = _SLICEID +_SLICE.fields_by_name['slice_endpoint_ids'].message_type = _ENDPOINTID +_SLICE.fields_by_name['slice_constraints'].message_type = _CONSTRAINT +_SLICE.fields_by_name['slice_service_ids'].message_type = _SERVICEID +_SLICE.fields_by_name['slice_subslice_ids'].message_type = _SLICEID +_SLICE.fields_by_name['slice_status'].message_type = _SLICESTATUS +_SLICESTATUS.fields_by_name['slice_status'].enum_type = _SLICESTATUSENUM +_SLICEIDLIST.fields_by_name['slice_ids'].message_type = _SLICEID +_SLICELIST.fields_by_name['slices'].message_type = _SLICE +_SLICEEVENT.fields_by_name['event'].message_type = _EVENT +_SLICEEVENT.fields_by_name['slice_id'].message_type = _SLICEID _CONNECTIONID.fields_by_name['connection_uuid'].message_type = _UUID _CONNECTION.fields_by_name['connection_id'].message_type = _CONNECTIONID _CONNECTION.fields_by_name['service_id'].message_type = _SERVICEID @@ -1969,6 +2269,12 @@ DESCRIPTOR.message_types_by_name['ServiceConfig'] = _SERVICECONFIG DESCRIPTOR.message_types_by_name['ServiceIdList'] = _SERVICEIDLIST DESCRIPTOR.message_types_by_name['ServiceList'] = _SERVICELIST DESCRIPTOR.message_types_by_name['ServiceEvent'] = _SERVICEEVENT +DESCRIPTOR.message_types_by_name['SliceId'] = _SLICEID +DESCRIPTOR.message_types_by_name['Slice'] = _SLICE +DESCRIPTOR.message_types_by_name['SliceStatus'] = _SLICESTATUS +DESCRIPTOR.message_types_by_name['SliceIdList'] = _SLICEIDLIST +DESCRIPTOR.message_types_by_name['SliceList'] = _SLICELIST +DESCRIPTOR.message_types_by_name['SliceEvent'] = _SLICEEVENT DESCRIPTOR.message_types_by_name['ConnectionId'] = _CONNECTIONID DESCRIPTOR.message_types_by_name['Connection'] = _CONNECTION DESCRIPTOR.message_types_by_name['ConnectionIdList'] = _CONNECTIONIDLIST @@ -1985,6 +2291,7 @@ DESCRIPTOR.enum_types_by_name['DeviceDriverEnum'] = _DEVICEDRIVERENUM DESCRIPTOR.enum_types_by_name['DeviceOperationalStatusEnum'] = _DEVICEOPERATIONALSTATUSENUM DESCRIPTOR.enum_types_by_name['ServiceTypeEnum'] = _SERVICETYPEENUM DESCRIPTOR.enum_types_by_name['ServiceStatusEnum'] = _SERVICESTATUSENUM +DESCRIPTOR.enum_types_by_name['SliceStatusEnum'] = _SLICESTATUSENUM DESCRIPTOR.enum_types_by_name['ConfigActionEnum'] = _CONFIGACTIONENUM _sym_db.RegisterFileDescriptor(DESCRIPTOR) @@ -2205,6 +2512,48 @@ ServiceEvent = _reflection.GeneratedProtocolMessageType('ServiceEvent', (_messag }) _sym_db.RegisterMessage(ServiceEvent) +SliceId = _reflection.GeneratedProtocolMessageType('SliceId', (_message.Message,), { + 'DESCRIPTOR' : _SLICEID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceId) + }) +_sym_db.RegisterMessage(SliceId) + +Slice = _reflection.GeneratedProtocolMessageType('Slice', (_message.Message,), { + 'DESCRIPTOR' : _SLICE, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Slice) + }) +_sym_db.RegisterMessage(Slice) + +SliceStatus = _reflection.GeneratedProtocolMessageType('SliceStatus', (_message.Message,), { + 'DESCRIPTOR' : _SLICESTATUS, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceStatus) + }) +_sym_db.RegisterMessage(SliceStatus) + +SliceIdList = _reflection.GeneratedProtocolMessageType('SliceIdList', (_message.Message,), { + 'DESCRIPTOR' : _SLICEIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceIdList) + }) +_sym_db.RegisterMessage(SliceIdList) + +SliceList = _reflection.GeneratedProtocolMessageType('SliceList', (_message.Message,), { + 'DESCRIPTOR' : _SLICELIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceList) + }) +_sym_db.RegisterMessage(SliceList) + +SliceEvent = _reflection.GeneratedProtocolMessageType('SliceEvent', (_message.Message,), { + 'DESCRIPTOR' : _SLICEEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceEvent) + }) +_sym_db.RegisterMessage(SliceEvent) + ConnectionId = _reflection.GeneratedProtocolMessageType('ConnectionId', (_message.Message,), { 'DESCRIPTOR' : _CONNECTIONID, '__module__' : 'context_pb2' @@ -2291,8 +2640,8 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( index=0, serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_start=4524, - serialized_end=6617, + serialized_start=5273, + serialized_end=7688, methods=[ _descriptor.MethodDescriptor( name='ListContextIds', @@ -2594,10 +2943,70 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( serialized_options=None, create_key=_descriptor._internal_create_key, ), + _descriptor.MethodDescriptor( + name='ListSliceIds', + full_name='context.ContextService.ListSliceIds', + index=30, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SLICEIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListSlices', + full_name='context.ContextService.ListSlices', + index=31, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SLICELIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetSlice', + full_name='context.ContextService.GetSlice', + index=32, + containing_service=None, + input_type=_SLICEID, + output_type=_SLICE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetSlice', + full_name='context.ContextService.SetSlice', + index=33, + containing_service=None, + input_type=_SLICE, + output_type=_SLICEID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveSlice', + full_name='context.ContextService.RemoveSlice', + index=34, + containing_service=None, + input_type=_SLICEID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetSliceEvents', + full_name='context.ContextService.GetSliceEvents', + index=35, + containing_service=None, + input_type=_EMPTY, + output_type=_SLICEEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), _descriptor.MethodDescriptor( name='ListConnectionIds', full_name='context.ContextService.ListConnectionIds', - index=30, + index=36, containing_service=None, input_type=_SERVICEID, output_type=_CONNECTIONIDLIST, @@ -2607,7 +3016,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='ListConnections', full_name='context.ContextService.ListConnections', - index=31, + index=37, containing_service=None, input_type=_SERVICEID, output_type=_CONNECTIONLIST, @@ -2617,7 +3026,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='GetConnection', full_name='context.ContextService.GetConnection', - index=32, + index=38, containing_service=None, input_type=_CONNECTIONID, output_type=_CONNECTION, @@ -2627,7 +3036,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='SetConnection', full_name='context.ContextService.SetConnection', - index=33, + index=39, containing_service=None, input_type=_CONNECTION, output_type=_CONNECTIONID, @@ -2637,7 +3046,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='RemoveConnection', full_name='context.ContextService.RemoveConnection', - index=34, + index=40, containing_service=None, input_type=_CONNECTIONID, output_type=_EMPTY, @@ -2647,7 +3056,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='GetConnectionEvents', full_name='context.ContextService.GetConnectionEvents', - index=35, + index=41, containing_service=None, input_type=_EMPTY, output_type=_CONNECTIONEVENT, diff --git a/src/service/proto/service_pb2.py b/src/service/proto/service_pb2.py index 7a006915b8be39710a17faab075e382e322d918f..8e2806c7685e24ab90a3d59a19f1e4f99ebc9712 100644 --- a/src/service/proto/service_pb2.py +++ b/src/service/proto/service_pb2.py @@ -20,7 +20,7 @@ DESCRIPTOR = _descriptor.FileDescriptor( syntax='proto3', serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\rservice.proto\x12\x07service\x1a\rcontext.proto2\xfd\x01\n\x0eServiceService\x12\x37\n\rCreateService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x37\n\rUpdateService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rDeleteService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12\x42\n\x11GetConnectionList\x12\x12.context.ServiceId\x1a\x17.context.ConnectionList\"\x00\x62\x06proto3' + serialized_pb=b'\n\rservice.proto\x12\x07service\x1a\rcontext.proto2\xb9\x01\n\x0eServiceService\x12\x37\n\rCreateService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x37\n\rUpdateService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rDeleteService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x62\x06proto3' , dependencies=[context__pb2.DESCRIPTOR,]) @@ -38,7 +38,7 @@ _SERVICESERVICE = _descriptor.ServiceDescriptor( serialized_options=None, create_key=_descriptor._internal_create_key, serialized_start=42, - serialized_end=295, + serialized_end=227, methods=[ _descriptor.MethodDescriptor( name='CreateService', @@ -70,16 +70,6 @@ _SERVICESERVICE = _descriptor.ServiceDescriptor( serialized_options=None, create_key=_descriptor._internal_create_key, ), - _descriptor.MethodDescriptor( - name='GetConnectionList', - full_name='service.ServiceService.GetConnectionList', - index=3, - containing_service=None, - input_type=context__pb2._SERVICEID, - output_type=context__pb2._CONNECTIONLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), ]) _sym_db.RegisterServiceDescriptor(_SERVICESERVICE) diff --git a/src/service/proto/service_pb2_grpc.py b/src/service/proto/service_pb2_grpc.py index 58cd47e937d5f7bc56ca317ccb72f5958eda740d..7269e1f5fc706c94de826a3ef174243740487940 100644 --- a/src/service/proto/service_pb2_grpc.py +++ b/src/service/proto/service_pb2_grpc.py @@ -29,11 +29,6 @@ class ServiceServiceStub(object): request_serializer=context__pb2.ServiceId.SerializeToString, response_deserializer=context__pb2.Empty.FromString, ) - self.GetConnectionList = channel.unary_unary( - '/service.ServiceService/GetConnectionList', - request_serializer=context__pb2.ServiceId.SerializeToString, - response_deserializer=context__pb2.ConnectionList.FromString, - ) class ServiceServiceServicer(object): @@ -57,12 +52,6 @@ class ServiceServiceServicer(object): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') - def GetConnectionList(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - def add_ServiceServiceServicer_to_server(servicer, server): rpc_method_handlers = { @@ -81,11 +70,6 @@ def add_ServiceServiceServicer_to_server(servicer, server): request_deserializer=context__pb2.ServiceId.FromString, response_serializer=context__pb2.Empty.SerializeToString, ), - 'GetConnectionList': grpc.unary_unary_rpc_method_handler( - servicer.GetConnectionList, - request_deserializer=context__pb2.ServiceId.FromString, - response_serializer=context__pb2.ConnectionList.SerializeToString, - ), } generic_handler = grpc.method_handlers_generic_handler( 'service.ServiceService', rpc_method_handlers) @@ -146,20 +130,3 @@ class ServiceService(object): context__pb2.Empty.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetConnectionList(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/service.ServiceService/GetConnectionList', - context__pb2.ServiceId.SerializeToString, - context__pb2.ConnectionList.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/src/service/service/ServiceService.py b/src/service/service/ServiceService.py index 21945b7d3c2fe75e27bfa37bc7465f75e7b660f1..356c314c380e8df151b60ed826c41d294f9462ca 100644 --- a/src/service/service/ServiceService.py +++ b/src/service/service/ServiceService.py @@ -12,72 +12,22 @@ # See the License for the specific language governing permissions and # limitations under the License. -import grpc, logging -from concurrent import futures -from grpc_health.v1.health import HealthServicer, OVERALL_HEALTH -from grpc_health.v1.health_pb2 import HealthCheckResponse -from grpc_health.v1.health_pb2_grpc import add_HealthServicer_to_server +from common.Constants import ServiceNameEnum +from common.Settings import get_service_port_grpc from common.orm.backend.BackendEnum import BackendEnum from common.orm.Database import Database from common.orm.Factory import get_database_backend -from context.client.ContextClient import ContextClient -from device.client.DeviceClient import DeviceClient -from service.Config import GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD +from common.tools.service.GenericGrpcService import GenericGrpcService from service.proto.service_pb2_grpc import add_ServiceServiceServicer_to_server from .ServiceServiceServicerImpl import ServiceServiceServicerImpl from .service_handler_api.ServiceHandlerFactory import ServiceHandlerFactory -BIND_ADDRESS = '0.0.0.0' -LOGGER = logging.getLogger(__name__) +class ServiceService(GenericGrpcService): + def __init__(self, service_handler_factory : ServiceHandlerFactory, cls_name: str = __name__) -> None: + port = get_service_port_grpc(ServiceNameEnum.SERVICE) + super().__init__(port, cls_name=cls_name) + database = Database(get_database_backend(backend=BackendEnum.INMEMORY)) + self.service_servicer = ServiceServiceServicerImpl(database, service_handler_factory) -class ServiceService: - def __init__( - self, context_client : ContextClient, device_client : DeviceClient, - service_handler_factory : ServiceHandlerFactory, - address=BIND_ADDRESS, port=GRPC_SERVICE_PORT, max_workers=GRPC_MAX_WORKERS, - grace_period=GRPC_GRACE_PERIOD): - - self.context_client = context_client - self.device_client = device_client - self.service_handler_factory = service_handler_factory - self.address = address - self.port = port - self.endpoint = None - self.max_workers = max_workers - self.grace_period = grace_period - self.service_servicer = None - self.health_servicer = None - self.pool = None - self.server = None - - self.database = Database(get_database_backend(backend=BackendEnum.INMEMORY)) - - def start(self): - self.endpoint = '{:s}:{:s}'.format(str(self.address), str(self.port)) - LOGGER.info('Starting Service (tentative endpoint: {:s}, max_workers: {:s})...'.format( - str(self.endpoint), str(self.max_workers))) - - self.pool = futures.ThreadPoolExecutor(max_workers=self.max_workers) - self.server = grpc.server(self.pool) # , interceptors=(tracer_interceptor,)) - - self.service_servicer = ServiceServiceServicerImpl( - self.context_client, self.device_client, self.database, self.service_handler_factory) + def install_servicers(self): add_ServiceServiceServicer_to_server(self.service_servicer, self.server) - - self.health_servicer = HealthServicer( - experimental_non_blocking=True, experimental_thread_pool=futures.ThreadPoolExecutor(max_workers=1)) - add_HealthServicer_to_server(self.health_servicer, self.server) - - port = self.server.add_insecure_port(self.endpoint) - self.endpoint = '{:s}:{:s}'.format(str(self.address), str(port)) - LOGGER.info('Listening on {:s}...'.format(str(self.endpoint))) - self.server.start() - self.health_servicer.set(OVERALL_HEALTH, HealthCheckResponse.SERVING) # pylint: disable=maybe-no-member - - LOGGER.debug('Service started') - - def stop(self): - LOGGER.debug('Stopping service (grace period {:s} seconds)...'.format(str(self.grace_period))) - self.health_servicer.enter_graceful_shutdown() - self.server.stop(self.grace_period) - LOGGER.debug('Service stopped') diff --git a/src/service/service/ServiceServiceServicerImpl.py b/src/service/service/ServiceServiceServicerImpl.py index 2506a420617674be04772437e72c8c541c9f384c..f34b99d6367d12f4d6d995db2f5fc1a691933bca 100644 --- a/src/service/service/ServiceServiceServicerImpl.py +++ b/src/service/service/ServiceServiceServicerImpl.py @@ -39,19 +39,18 @@ METHOD_NAMES = ['CreateService', 'UpdateService', 'DeleteService'] METRICS = create_metrics(SERVICE_NAME, METHOD_NAMES) class ServiceServiceServicerImpl(ServiceServiceServicer): - def __init__( - self, context_client : ContextClient, device_client : DeviceClient, database : Database, - service_handler_factory : ServiceHandlerFactory): - + def __init__(self, database : Database, service_handler_factory : ServiceHandlerFactory) -> None: LOGGER.debug('Creating Servicer...') - self.context_client = context_client - self.device_client = device_client + self.context_client = ContextClient() + self.device_client = DeviceClient() self.database = database self.service_handler_factory = service_handler_factory LOGGER.debug('Servicer Created') @safe_and_metered_rpc_method(METRICS, LOGGER) def CreateService(self, request : Service, context : grpc.ServicerContext) -> ServiceId: + LOGGER.info('[CreateService] begin ; request = {:s}'.format(grpc_message_to_json_string(request))) + service_id = request.service_id service_uuid = service_id.service_uuid.uuid service_context_uuid = service_id.context_id.context_uuid.uuid diff --git a/src/service/service/__main__.py b/src/service/service/__main__.py index cc1b008958572020ebbe54fdfcda27ed4218f80e..1a67a309ff19bda2bf3174c80dfb908e99f72d14 100644 --- a/src/service/service/__main__.py +++ b/src/service/service/__main__.py @@ -14,12 +14,10 @@ import logging, signal, sys, threading from prometheus_client import start_http_server -from common.Settings import get_setting, wait_for_environment_variables -from context.client.ContextClient import ContextClient -from device.client.DeviceClient import DeviceClient -from service.Config import ( - CONTEXT_SERVICE_HOST, CONTEXT_SERVICE_PORT, DEVICE_SERVICE_HOST, DEVICE_SERVICE_PORT, GRPC_SERVICE_PORT, - GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD, LOG_LEVEL, METRICS_PORT) +from common.Constants import ServiceNameEnum +from common.Settings import ( + ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_log_level, get_metrics_port, + wait_for_environment_variables) from .ServiceService import ServiceService from .service_handler_api.ServiceHandlerFactory import ServiceHandlerFactory from .service_handlers import SERVICE_HANDLERS @@ -34,51 +32,31 @@ def signal_handler(signal, frame): # pylint: disable=redefined-outer-name def main(): global LOGGER # pylint: disable=global-statement - grpc_service_port = get_setting('SERVICESERVICE_SERVICE_PORT_GRPC', default=GRPC_SERVICE_PORT ) - max_workers = get_setting('MAX_WORKERS', default=GRPC_MAX_WORKERS ) - grace_period = get_setting('GRACE_PERIOD', default=GRPC_GRACE_PERIOD ) - log_level = get_setting('LOG_LEVEL', default=LOG_LEVEL ) - metrics_port = get_setting('METRICS_PORT', default=METRICS_PORT ) - + log_level = get_log_level() logging.basicConfig(level=log_level) LOGGER = logging.getLogger(__name__) wait_for_environment_variables([ - 'CONTEXTSERVICE_SERVICE_HOST', 'CONTEXTSERVICE_SERVICE_PORT_GRPC', - 'DEVICESERVICE_SERVICE_HOST', 'DEVICESERVICE_SERVICE_PORT_GRPC' + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_HOST ), + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC), + get_env_var_name(ServiceNameEnum.DEVICE, ENVVAR_SUFIX_SERVICE_HOST ), + get_env_var_name(ServiceNameEnum.DEVICE, ENVVAR_SUFIX_SERVICE_PORT_GRPC), ]) - context_service_host = get_setting('CONTEXTSERVICE_SERVICE_HOST', default=CONTEXT_SERVICE_HOST) - context_service_port = get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC', default=CONTEXT_SERVICE_PORT) - device_service_host = get_setting('DEVICESERVICE_SERVICE_HOST', default=DEVICE_SERVICE_HOST ) - device_service_port = get_setting('DEVICESERVICE_SERVICE_PORT_GRPC', default=DEVICE_SERVICE_PORT ) - signal.signal(signal.SIGINT, signal_handler) signal.signal(signal.SIGTERM, signal_handler) LOGGER.info('Starting...') # Start metrics server + metrics_port = get_metrics_port() start_http_server(metrics_port) - # Initialize Context Client - if context_service_host is None or context_service_port is None: - raise Exception('Wrong address({:s}):port({:s}) of Context component'.format( - str(context_service_host), str(context_service_port))) - context_client = ContextClient(context_service_host, context_service_port) - - # Initialize Device Client - if device_service_host is None or device_service_port is None: - raise Exception('Wrong address({:s}):port({:s}) of Device component'.format( - str(device_service_host), str(device_service_port))) - device_client = DeviceClient(device_service_host, device_service_port) - + # Initialize ServiceHandler Factory service_handler_factory = ServiceHandlerFactory(SERVICE_HANDLERS) # Starting service service - grpc_service = ServiceService( - context_client, device_client, service_handler_factory, port=grpc_service_port, max_workers=max_workers, - grace_period=grace_period) + grpc_service = ServiceService(service_handler_factory) grpc_service.start() # Wait for Ctrl+C or termination signal diff --git a/src/service/tests/MockService_Dependencies.py b/src/service/tests/MockService_Dependencies.py new file mode 100644 index 0000000000000000000000000000000000000000..8194ba94347b6439e9d71fda1c79a94b4ddb3f9d --- /dev/null +++ b/src/service/tests/MockService_Dependencies.py @@ -0,0 +1,49 @@ +# 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. + +import os +from typing import Union +from common.Constants import ServiceNameEnum +from common.Settings import ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name +from common.tests.MockServicerImpl_Context import MockServicerImpl_Context +from common.tests.MockServicerImpl_Device import MockServicerImpl_Device +from common.tools.service.GenericGrpcService import GenericGrpcService +from context.proto.context_pb2_grpc import add_ContextServiceServicer_to_server +from device.proto.device_pb2_grpc import add_DeviceServiceServicer_to_server + +LOCAL_HOST = '127.0.0.1' + +SERVICE_CONTEXT = ServiceNameEnum.CONTEXT +SERVICE_DEVICE = ServiceNameEnum.DEVICE + +class MockService_Dependencies(GenericGrpcService): + # Mock Service implementing Context and Device to simplify unitary tests of Device + + def __init__(self, bind_port: Union[str, int]) -> None: + super().__init__(bind_port, LOCAL_HOST, enable_health_servicer=False, cls_name='MockService') + + # pylint: disable=attribute-defined-outside-init + def install_servicers(self): + self.context_servicer = MockServicerImpl_Context() + add_ContextServiceServicer_to_server(self.context_servicer, self.server) + + self.device_servicer = MockServicerImpl_Device() + add_DeviceServiceServicer_to_server(self.device_servicer, self.server) + + def configure_env_vars(self): + os.environ[get_env_var_name(SERVICE_CONTEXT, ENVVAR_SUFIX_SERVICE_HOST )] = str(self.bind_address) + os.environ[get_env_var_name(SERVICE_CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(self.bind_port) + + os.environ[get_env_var_name(SERVICE_DEVICE, ENVVAR_SUFIX_SERVICE_HOST )] = str(self.bind_address) + os.environ[get_env_var_name(SERVICE_DEVICE, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(self.bind_port) diff --git a/src/service/tests/PrepareTestScenario.py b/src/service/tests/PrepareTestScenario.py new file mode 100644 index 0000000000000000000000000000000000000000..bcf3cd156ab04e932e440837dc8ca0df645dc0cc --- /dev/null +++ b/src/service/tests/PrepareTestScenario.py @@ -0,0 +1,68 @@ +# 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. + +import pytest, os +from common.Constants import ServiceNameEnum +from common.Settings import ( + ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_service_port_grpc) +from context.client.ContextClient import ContextClient +from device.client.DeviceClient import DeviceClient +from service.client.ServiceClient import ServiceClient +from service.service.ServiceService import ServiceService +from service.service.service_handler_api.ServiceHandlerFactory import ServiceHandlerFactory +from service.service.service_handlers import SERVICE_HANDLERS +from service.tests.MockService_Dependencies import MockService_Dependencies + +LOCAL_HOST = '127.0.0.1' +MOCKSERVICE_PORT = 10000 +SERVICE_SERVICE_PORT = MOCKSERVICE_PORT + get_service_port_grpc(ServiceNameEnum.SERVICE) # avoid privileged ports +os.environ[get_env_var_name(ServiceNameEnum.SERVICE, ENVVAR_SUFIX_SERVICE_HOST )] = str(LOCAL_HOST) +os.environ[get_env_var_name(ServiceNameEnum.SERVICE, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(SERVICE_SERVICE_PORT) + +@pytest.fixture(scope='session') +def mock_service(): + _service = MockService_Dependencies(MOCKSERVICE_PORT) + _service.configure_env_vars() + _service.start() + yield _service + _service.stop() + +@pytest.fixture(scope='session') +def context_client(mock_service : MockService_Dependencies): # pylint: disable=redefined-outer-name + _client = ContextClient() + yield _client + _client.close() + +@pytest.fixture(scope='session') +def device_client(mock_service : MockService_Dependencies): # pylint: disable=redefined-outer-name + _client = DeviceClient() + yield _client + _client.close() + +@pytest.fixture(scope='session') +def service_service( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient): # pylint: disable=redefined-outer-name + + _service_handler_factory = ServiceHandlerFactory(SERVICE_HANDLERS) + _service = ServiceService(_service_handler_factory) + _service.start() + yield _service + _service.stop() + +@pytest.fixture(scope='session') +def service_client(service_service : ServiceService): # pylint: disable=redefined-outer-name + _client = ServiceClient() + yield _client + _client.close() diff --git a/src/service/tests/test_unitary.py b/src/service/tests/test_unitary.py index 812a65c5c4353925dcf0b186a0ebb5401a4ecfa1..60fd17371771c6d5764b18255595f8b4520e8447 100644 --- a/src/service/tests/test_unitary.py +++ b/src/service/tests/test_unitary.py @@ -12,90 +12,21 @@ # See the License for the specific language governing permissions and # limitations under the License. -import copy, grpc, logging, os, pytest -from common.tests.MockService import MockService -from common.tests.MockServicerImpl_Context import MockServicerImpl_Context -from common.tests.MockServicerImpl_Device import MockServicerImpl_Device +import copy, grpc, logging, pytest from common.tests.PytestGenerateTests import pytest_generate_tests # (required) pylint: disable=unused-import from common.tools.grpc.Tools import grpc_message_to_json_string from context.client.ContextClient import ContextClient from context.proto.context_pb2 import Context, ContextId, DeviceId, Link, LinkId, Topology, Device, TopologyId -from context.proto.context_pb2_grpc import add_ContextServiceServicer_to_server from device.client.DeviceClient import DeviceClient -from device.proto.device_pb2_grpc import add_DeviceServiceServicer_to_server -from service.Config import ( - GRPC_SERVICE_PORT as SERVICE_GRPC_SERVICE_PORT, GRPC_MAX_WORKERS as SERVICE_GRPC_MAX_WORKERS, - GRPC_GRACE_PERIOD as SERVICE_GRPC_GRACE_PERIOD) from service.client.ServiceClient import ServiceClient from service.proto.context_pb2 import Service, ServiceId -from service.service.ServiceService import ServiceService -from service.service.service_handler_api.ServiceHandlerFactory import ServiceHandlerFactory -from service.service.service_handlers import SERVICE_HANDLERS +from .PrepareTestScenario import ( # pylint: disable=unused-import + # be careful, order of symbols is important here! + mock_service, service_service, context_client, device_client, service_client) LOGGER = logging.getLogger(__name__) LOGGER.setLevel(logging.DEBUG) -SERVICE_GRPC_SERVICE_PORT = 10000 + SERVICE_GRPC_SERVICE_PORT # avoid privileged ports - -LOCALHOST = '127.0.0.1' -MOCKSERVER_GRPC_PORT = 10000 - -class MockService_Combined(MockService): - # Mock Server implementing Context and Service to simplify unitary tests of Compute - - def __init__(self, cls_name='MockService_Service'): - super().__init__(LOCALHOST, MOCKSERVER_GRPC_PORT, cls_name=cls_name) - - # pylint: disable=attribute-defined-outside-init - def install_servicers(self): - self.context_servicer = MockServicerImpl_Context() - add_ContextServiceServicer_to_server(self.context_servicer, self.server) - self.device_servicer = MockServicerImpl_Device() - add_DeviceServiceServicer_to_server(self.device_servicer, self.server) - -os.environ['CONTEXTSERVICE_SERVICE_HOST'] = LOCALHOST -os.environ['CONTEXTSERVICE_SERVICE_PORT_GRPC'] = str(MOCKSERVER_GRPC_PORT) -os.environ['DEVICESERVICE_SERVICE_HOST'] = LOCALHOST -os.environ['DEVICESERVICE_SERVICE_PORT_GRPC'] = str(MOCKSERVER_GRPC_PORT) - -@pytest.fixture(scope='session') -def mockservice(): - _service = MockService_Combined() - _service.start() - yield _service - _service.stop() - -@pytest.fixture(scope='session') -def context_client(mockservice : MockService_Combined): # pylint: disable=redefined-outer-name - _client = ContextClient(address=LOCALHOST, port=MOCKSERVER_GRPC_PORT) - yield _client - _client.close() - -@pytest.fixture(scope='session') -def device_client(mockservice : MockService_Combined): # pylint: disable=redefined-outer-name - _client = DeviceClient(address=LOCALHOST, port=MOCKSERVER_GRPC_PORT) - yield _client - _client.close() - -@pytest.fixture(scope='session') -def service_service( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient): # pylint: disable=redefined-outer-name - - _service_handler_factory = ServiceHandlerFactory(SERVICE_HANDLERS) - _service = ServiceService( - context_client, device_client, _service_handler_factory, - port=SERVICE_GRPC_SERVICE_PORT, max_workers=SERVICE_GRPC_MAX_WORKERS, grace_period=SERVICE_GRPC_GRACE_PERIOD) - _service.start() - yield _service - _service.stop() - -@pytest.fixture(scope='session') -def service_client(service_service : ServiceService): # pylint: disable=redefined-outer-name - _client = ServiceClient(address=LOCALHOST, port=SERVICE_GRPC_SERVICE_PORT) - yield _client - _client.close() - try: from .ServiceHandlersToTest import SERVICE_HANDLERS_TO_TEST except ImportError: diff --git a/src/slice/.gitlab-ci.yml b/src/slice/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..d62e8edad3ce8ceb1fa6e67f3213d761e36df012 --- /dev/null +++ b/src/slice/.gitlab-ci.yml @@ -0,0 +1,74 @@ +# 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. + +# Build, tag, and push the Docker images to the GitLab Docker registry +build slice: + variables: + IMAGE_NAME: 'slice' # name of the microservice + IMAGE_NAME_TEST: 'slice-test' # name of the microservice + IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) + stage: build + before_script: + - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY + script: + - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile ./src/ + - docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" + - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" + rules: + - changes: + - src/$IMAGE_NAME/** + - .gitlab-ci.yml + +# Pull, execute, and run unitary tests for the Docker image from the GitLab registry +unit_test slice: + variables: + IMAGE_NAME: 'slice' # name of the microservice + IMAGE_NAME_TEST: 'slice-test' # name of the microservice + IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) + stage: unit_test + needs: + - build slice + before_script: + - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY + - if docker network list | grep teraflowbridge; then echo "teraflowbridge is already created"; else docker network create -d bridge teraflowbridge; fi + script: + - docker pull "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" + - docker run -d -p 4040:4040 --name $IMAGE_NAME --network=teraflowbridge "$IMAGE_NAME:$IMAGE_TAG" + - docker ps -a + - sleep 5 + - docker ps -a + - docker logs $IMAGE_NAME + - docker exec -i $IMAGE_NAME bash -c "pytest --log-level=DEBUG --verbose $IMAGE_NAME/tests/test_unitary.py" + after_script: + - docker stop $IMAGE_NAME + - docker rm $IMAGE_NAME + rules: + - changes: + - src/$IMAGE_NAME/** + - .gitlab-ci.yml + +# Deployment of the service in Kubernetes Cluster +deploy slice: + stage: deploy + needs: + - build slice + - unit_test slice + - dependencies all + - integ_test execute + script: + - kubectl version + - kubectl get all + - kubectl apply -f "manifests/sliceservice.yaml" + - kubectl delete pods --selector app=sliceservice + - kubectl get all diff --git a/src/slice/Config.py b/src/slice/Config.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/slice/Config.py @@ -0,0 +1,14 @@ +# 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. + diff --git a/src/slice/Dockerfile b/src/slice/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..d653bb21778adbbd09407c1ca54f0afdc7ae5d81 --- /dev/null +++ b/src/slice/Dockerfile @@ -0,0 +1,38 @@ +FROM python:3-slim + +# Install dependencies +RUN apt-get --yes --quiet --quiet update && \ + apt-get --yes --quiet --quiet install wget g++ && \ + rm -rf /var/lib/apt/lists/* + +# Set Python to show logs as they occur +ENV PYTHONUNBUFFERED=0 + +# Download the gRPC health probe +RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \ + wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \ + chmod +x /bin/grpc_health_probe + +# Get generic Python packages +RUN python3 -m pip install --upgrade pip setuptools wheel pip-tools + +# Set working directory +WORKDIR /var/teraflow + +# Create module sub-folders +RUN mkdir -p /var/teraflow/slice + +# Get Python packages per module +COPY slice/requirements.in slice/requirements.in +RUN pip-compile --output-file=slice/requirements.txt slice/requirements.in +RUN python3 -m pip install -r slice/requirements.in + +# Add files into working directory +COPY common/. common +COPY context/. context +COPY interdomain/. interdomain +COPY service/. service +COPY slice/. slice + +# Start slice service +ENTRYPOINT ["python", "-m", "slice.service"] diff --git a/src/slice/__init__.py b/src/slice/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/slice/__init__.py @@ -0,0 +1,14 @@ +# 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. + diff --git a/src/slice/client/SliceClient.py b/src/slice/client/SliceClient.py new file mode 100644 index 0000000000000000000000000000000000000000..d1783e882faf2ea0e89fd3d1e034d8cba02dc24b --- /dev/null +++ b/src/slice/client/SliceClient.py @@ -0,0 +1,67 @@ +# 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. + +import grpc, logging +from common.Constants import ServiceNameEnum +from common.Settings import get_service_host, get_service_port_grpc +from common.tools.client.RetryDecorator import retry, delay_exponential +from common.tools.grpc.Tools import grpc_message_to_json_string +from slice.proto.context_pb2 import Empty, Slice, SliceId +from slice.proto.slice_pb2_grpc import SliceServiceStub + +LOGGER = logging.getLogger(__name__) +MAX_RETRIES = 15 +DELAY_FUNCTION = delay_exponential(initial=0.01, increment=2.0, maximum=5.0) +RETRY_DECORATOR = retry(max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + +class SliceClient: + def __init__(self, host=None, port=None): + if not host: host = get_service_host(ServiceNameEnum.SLICE) + if not port: port = get_service_port_grpc(ServiceNameEnum.SLICE) + self.endpoint = '{:s}:{:s}'.format(str(host), str(port)) + LOGGER.debug('Creating channel to {:s}...'.format(self.endpoint)) + self.channel = None + self.stub = None + self.connect() + LOGGER.debug('Channel created') + + def connect(self): + self.channel = grpc.insecure_channel(self.endpoint) + self.stub = SliceServiceStub(self.channel) + + def close(self): + if self.channel is not None: self.channel.close() + self.channel = None + self.stub = None + + @RETRY_DECORATOR + def CreateSlice(self, request : Slice) -> SliceId: + LOGGER.debug('CreateSlice request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.CreateSlice(request) + LOGGER.debug('CreateSlice result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def UpdateSlice(self, request : Slice) -> SliceId: + LOGGER.debug('UpdateSlice request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.UpdateSlice(request) + LOGGER.debug('UpdateSlice result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def DeleteSlice(self, request : SliceId) -> Empty: + LOGGER.debug('DeleteSlice request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.DeleteSlice(request) + LOGGER.debug('DeleteSlice result: {:s}'.format(grpc_message_to_json_string(response))) + return response diff --git a/src/slice/client/__init__.py b/src/slice/client/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/slice/client/__init__.py @@ -0,0 +1,14 @@ +# 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. + diff --git a/src/slice/genproto.sh b/src/slice/genproto.sh new file mode 100755 index 0000000000000000000000000000000000000000..e51905dd2007ead46bcb561bb234dcebff0c58ea --- /dev/null +++ b/src/slice/genproto.sh @@ -0,0 +1,52 @@ +#!/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) + +rm -rf proto/*.py +rm -rf proto/__pycache__ +tee proto/__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 + +python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto context.proto +python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto kpi_sample_types.proto +python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto service.proto +python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto slice.proto + +rm proto/context_pb2_grpc.py +rm proto/kpi_sample_types_pb2_grpc.py +rm proto/service_pb2_grpc.py + +sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/context_pb2.py +sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/service_pb2.py +sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/kpi_sample_types_pb2.py +sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/slice_pb2.py +sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/slice_pb2_grpc.py diff --git a/src/slice/old_code/ConstraintsChecker.py b/src/slice/old_code/ConstraintsChecker.py new file mode 100644 index 0000000000000000000000000000000000000000..44cf2c76d3406f8c15eb40654f94e2a961faf963 --- /dev/null +++ b/src/slice/old_code/ConstraintsChecker.py @@ -0,0 +1,52 @@ +# 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. + +import grpc, logging +from typing import Dict, List, Set, Tuple +from common.Checkers import chk_string +from common.exceptions.ServiceException import ServiceException +from service.proto.context_pb2 import Constraint + +def check_constraint( + logger : logging.Logger, constraint_number : int, parent_name : str, constraint : Constraint, + add_constraints : Dict[str, Dict[str, Set[str]]]) -> Tuple[str, str]: + + try: + constraint_type = chk_string('constraint[#{}].constraint_type'.format(constraint_number), + constraint.constraint_type, + allow_empty=False) + constraint_value = chk_string('constraint[#{}].constraint_value'.format(constraint_number), + constraint.constraint_value, + allow_empty=False) + except Exception as e: + logger.exception('Invalid arguments:') + raise ServiceException(grpc.StatusCode.INVALID_ARGUMENT, str(e)) + + if constraint_type in add_constraints: + msg = 'Duplicated ConstraintType({}) in {}.' + msg = msg.format(constraint_type, parent_name) + raise ServiceException(grpc.StatusCode.INVALID_ARGUMENT, msg) + + add_constraints[constraint_type] = constraint_value + return constraint_type, constraint_value + +def check_constraints(logger : logging.Logger, parent_name : str, constraints): + add_constraints : Dict[str, str] = {} + constraint_tuples : List[Tuple[str, str]] = [] + for constraint_number,constraint in enumerate(constraints): + _parent_name = 'Constraint(#{}) of {}'.format(constraint_number, parent_name) + constraint_type, constraint_value = check_constraint( + logger, constraint_number, _parent_name, constraint, add_constraints) + constraint_tuples.append((constraint_type, constraint_value)) + return constraint_tuples diff --git a/src/slice/old_code/SliceCheckers.py b/src/slice/old_code/SliceCheckers.py new file mode 100644 index 0000000000000000000000000000000000000000..660a522d082fdc918eaa895e09f8469ede05713b --- /dev/null +++ b/src/slice/old_code/SliceCheckers.py @@ -0,0 +1,32 @@ +# 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. + +import grpc +from common.database.api.Database import Database +from common.database.api.context.slice.Slice import Slice +from common.exceptions.ServiceException import ServiceException + +def check_slice_exists(database : Database, context_id : str, slice_id : str) -> Slice: + db_context = database.context(context_id).create() + if db_context.slices.contains(slice_id): return db_context.slice(slice_id) + msg = 'Context({})/Slice({}) does not exist in the database.' + msg = msg.format(context_id, slice_id) + raise ServiceException(grpc.StatusCode.NOT_FOUND, msg) + +def check_slice_not_exists(database : Database, context_id : str, slice_id : str): + db_context = database.context(context_id).create() + if not db_context.slices.contains(slice_id): return + msg = 'Context({})/Slice({}) already exists in the database.' + msg = msg.format(context_id, slice_id) + raise ServiceException(grpc.StatusCode.ALREADY_EXISTS, msg) diff --git a/src/slice/old_code/Tools.py b/src/slice/old_code/Tools.py new file mode 100644 index 0000000000000000000000000000000000000000..4029c5b19201d6cba2848fc7866f9abfd12bcc38 --- /dev/null +++ b/src/slice/old_code/Tools.py @@ -0,0 +1,213 @@ +# 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. + +import grpc, logging +from typing import Dict, List, Set, Tuple +from common.Checkers import chk_options, chk_string +from common.database.api.Database import Database +from common.database.api.context.Constants import DEFAULT_CONTEXT_ID, DEFAULT_TOPOLOGY_ID +from common.database.api.context.service.Service import Service +from common.database.api.context.slice.SliceStatus import SliceStatus, slicestatus_enum_values, to_slicestatus_enum +from common.database.api.context.topology.device.Endpoint import Endpoint +from common.exceptions.ServiceException import ServiceException +from common.tools.service.ConstraintsChecker import check_constraints +from common.tools.service.EndpointIdCheckers import check_endpoint_id +from common.tools.service.DeviceCheckers import check_device_endpoint_exists +from common.tools.service.EnumCheckers import check_enum +from common.tools.service.ServiceCheckers import check_service_exists +from common.tools.service.SliceCheckers import check_slice_exists #, check_slice_not_exists +from slice.proto.slice_pb2 import TransportSlice + +# For each method name, define acceptable slice statuses. Empty set means accept all. +ACCEPTED_SLICE_STATUSES : Dict[str, Set[SliceStatus]] = { + 'CreateUpdateSlice': set([SliceStatus.PLANNED, SliceStatus.INIT, SliceStatus.ACTIVE]), + 'DeleteSlice': set([SliceStatus.PLANNED, SliceStatus.DEINIT]), +} + +def _check_slice_exists(method_name : str, database : Database, context_id : str, slice_id : str): + if method_name in ['CreateUpdateSlice']: + # Do nothing; creation implies checking slice does not exist. However, if it exists, we can perform an update. + #check_slice_not_exists(database, context_id, slice_id) + pass + elif method_name in ['DeleteSlice']: + check_slice_exists(database, context_id, slice_id) + else: # pragma: no cover (test requires malforming the code) + msg = 'Unexpected condition [_check_slice_exists(method_name={}, slice_id={})]' + msg = msg.format(str(method_name), str(slice_id)) + raise ServiceException(grpc.StatusCode.UNIMPLEMENTED, msg) + +def _check_slice_endpoints( + logger : logging.Logger, database : Database, context_id : str, slice_id : str, slice_endpoints + ) -> List[Tuple[Endpoint, str]]: + + add_topology_devices_endpoints : Dict[str, Dict[str, Set[str]]] = {} + db_endpoints__port_types : List[Tuple[Endpoint, str]] = [] + for endpoint_number,slice_endpoint in enumerate(slice_endpoints): + parent_name = 'SliceEndpoint(#{}) of Context({})/Slice({})' + parent_name = parent_name.format(endpoint_number, context_id, slice_id) + + ep_topology_id, ep_device_id, ep_port_id = check_endpoint_id( + logger, endpoint_number, parent_name, slice_endpoint.port_id.port_id, add_topology_devices_endpoints, + acceptable_context_ids=set([context_id]), prevent_same_device_multiple_times=False) + + try: + ep_port_type = chk_string('endpoint[#{}].port_type'.format(endpoint_number), + slice_endpoint.port_id.port_type, + allow_empty=False) + except Exception as e: + logger.exception('Invalid arguments:') + raise ServiceException(grpc.StatusCode.INVALID_ARGUMENT, str(e)) + + db_endpoint = check_device_endpoint_exists( + database, parent_name, context_id, ep_topology_id, ep_device_id, ep_port_id) + db_endpoints__port_types.append((db_endpoint, ep_port_type)) + return db_endpoints__port_types + +def _check_services( + logger : logging.Logger, database : Database, parent_name : str, context_id : str, slice_service_ids + ) -> List[Service]: + + add_context_services : Dict[str, Set[str]] = {} + db_services : List[Service] = [] + for service_number,service_id in enumerate(slice_service_ids): + # ----- Parse attributes --------------------------------------------------------------------------------------- + try: + service_context_id = chk_string ('services[#{}].contextId.contextUuid.uuid'.format(service_number), + service_id.contextId.contextUuid.uuid, + allow_empty=True) + service_id = chk_string ('services[#{}].cs_id.uuid'.format(service_number), + service_id.cs_id.uuid, + allow_empty=False) + except Exception as e: + logger.exception('Invalid arguments:') + raise ServiceException(grpc.StatusCode.INVALID_ARGUMENT, str(e)) + + if len(service_context_id) == 0: service_context_id = context_id + + add_services = add_context_services.setdefault(context_id, dict()) + if service_id in add_services: + msg = 'Duplicated Context({})/Service({}) in {}.' + msg = msg.format(service_context_id, service_id, parent_name) + raise ServiceException(grpc.StatusCode.INVALID_ARGUMENT, msg) + + db_service = check_service_exists(database, service_context_id, service_id) + db_services.append(db_service) + add_services.add(service_id) + return db_services + +def _check_subslices( + logger : logging.Logger, database : Database, parent_name : str, context_id : str, slice_subslice_ids + ) -> List[Slice]: + + add_context_subslices : Dict[str, Set[str]] = {} + db_subslices : List[Slice] = [] + for subslice_number,subslice_id in enumerate(slice_subslice_ids): + # ----- Parse attributes --------------------------------------------------------------------------------------- + try: + subslice_context_id = chk_string ('subSlicesId[#{}].contextId.contextUuid.uuid'.format(subslice_number), + subslice_id.contextId.contextUuid.uuid, + allow_empty=True) + subslice_id = chk_string ('subSlicesId[#{}].slice_id.uuid'.format(subslice_number), + subslice_id.slice_id.uuid, + allow_empty=False) + except Exception as e: + logger.exception('Invalid arguments:') + raise ServiceException(grpc.StatusCode.INVALID_ARGUMENT, str(e)) + + if len(subslice_context_id) == 0: subslice_context_id = context_id + + add_subslices = add_context_subslices.setdefault(context_id, dict()) + if subslice_id in add_subslices: + msg = 'Duplicated Context({})/Slice({}) in {}.' + msg = msg.format(subslice_context_id, subslice_id, parent_name) + raise ServiceException(grpc.StatusCode.INVALID_ARGUMENT, msg) + + db_subslice = check_slice_exists(database, subslice_context_id, subslice_id) + db_subslices.append(db_subslice) + add_subslices.add(subslice_id) + return db_subslices + +def check_slice_status(method_name : str, value : str) -> SliceStatus: + return check_enum( + 'SliceStatus', method_name, value, to_slicestatus_enum, ACCEPTED_SLICE_STATUSES) + +def check_slice_request( + method_name : str, request : TransportSlice, database : Database, logger : logging.Logger + ): # -> Tuple[str, str, str, OperationalStatus, List[Tuple[Endpoint, str]]]: + + # ----- Parse attributes ------------------------------------------------------------------------------------------- + try: + context_id = chk_string ('slice.slice_id.contextId.contextUuid.uuid', + request.slice_id.contextId.contextUuid.uuid, + allow_empty=True) + slice_id = chk_string ('slice.slice_id.slice_id.uuid', + request.slice_id.slice_id.uuid, + allow_empty=False) + status_context_id = chk_string ('slice.status.slice_id.contextId.contextUuid.uuid', + request.status.slice_id.contextId.contextUuid.uuid, + allow_empty=True) + status_slice_id = chk_string ('slice.status.slice_id.slice_id.uuid', + request.status.slice_id.slice_id.uuid, + allow_empty=True) + slice_status = chk_options('slice.status.status', + request.status.status, + slicestatus_enum_values()) + except Exception as e: + logger.exception('Invalid arguments:') + raise ServiceException(grpc.StatusCode.INVALID_ARGUMENT, str(e)) + + if len(context_id) == 0: context_id = DEFAULT_CONTEXT_ID + + if (len(status_context_id) > 0) and (status_context_id != context_id): + msg = ' '.join([ + 'slice.status.slice_id.contextId.contextUuid.uuid({})', + 'is not empty and is different than', + 'slice.slice_id.contextId.contextUuid.uuid({}).', + 'Optionally, leave field empty to use slice.slice_id.contextId.contextUuid.uuid({}), if set,', + 'or, otherwise, the default Context({})' + ]) + msg = msg.format( + status_context_id, context_id, context_id, DEFAULT_CONTEXT_ID) + raise ServiceException(grpc.StatusCode.INVALID_ARGUMENT, msg) + + if (len(status_slice_id) > 0) and (status_slice_id != slice_id): + msg = ' '.join([ + 'slice.status.slice_id.slice_id.uuid({})', + 'is not empty and is different than', + 'slice.slice_id.slice_id.uuid({}).', + 'Optionally, leave field empty to use slice.slice_id.slice_id.uuid({}).', + ]) + msg = msg.format( + status_slice_id, slice_id, slice_id) + raise ServiceException(grpc.StatusCode.INVALID_ARGUMENT, msg) + + slice_status = check_slice_status(method_name, slice_status) + + # ----- Check if slice exists in database -------------------------------------------------------------------------- + _check_slice_exists(method_name, database, context_id, slice_id) + + # ----- Parse endpoints and check if they exist in the database as device endpoints -------------------------------- + db_endpoints__port_types = _check_slice_endpoints(logger, database, context_id, slice_id, request.endpoints) + + # ----- Parse constraints ------------------------------------------------------------------------------------------ + parent_name = 'Context({})/Slice({})'.format(context_id, slice_id) + constraint_tuples : List[Tuple[str, str]] = check_constraints(logger, parent_name, request.constraints) + + # ----- Parse Service Ids ------------------------------------------------------------------------------------------ + db_services = _check_services(logger, database, parent_name, context_id, request.services) + + # ----- Parse SubSlice Ids ----------------------------------------------------------------------------------------- + db_subslices = _check_subslices(logger, database, parent_name, context_id, request.subSlicesId) + + return context_id, slice_id, slice_status, db_endpoints__port_types, constraint_tuples, db_services, db_subslices diff --git a/src/slice/old_code/Tools_2.py b/src/slice/old_code/Tools_2.py new file mode 100644 index 0000000000000000000000000000000000000000..c29a11a06bc7e4258fe4798ebf632a1f00db3170 --- /dev/null +++ b/src/slice/old_code/Tools_2.py @@ -0,0 +1,190 @@ +# 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. + +src/common/tools/service/DeviceCheckers.py + import grpc + from common.database.api.Database import Database + from common.database.api.context.topology.device.Device import Device + from common.database.api.context.topology.device.Endpoint import Endpoint + from common.exceptions.ServiceException import ServiceException + + def check_device_exists(database : Database, context_id : str, topology_id : str, device_id : str) -> Device: + db_context = database.context(context_id).create() + db_topology = db_context.topology(topology_id).create() + if db_topology.devices.contains(device_id): return db_topology.device(device_id) + msg = 'Context({})/Topology({})/Device({}) does not exist in the database.' + msg = msg.format(context_id, topology_id, device_id) + raise ServiceException(grpc.StatusCode.NOT_FOUND, msg) + + +src/common/tools/service/LinkCheckers.py + import grpc + from common.database.api.Database import Database + from common.database.api.context.topology.link.Link import Link + from common.exceptions.ServiceException import ServiceException + + def check_link_exists(database : Database, context_id : str, topology_id : str, link_id : str) -> Link: + db_context = database.context(context_id).create() + db_topology = db_context.topology(topology_id).create() + if db_topology.links.contains(link_id): return db_topology.link(link_id) + msg = 'Context({})/Topology({})/Link({}) does not exist in the database.' + msg = msg.format(context_id, topology_id, link_id) + raise ServiceException(grpc.StatusCode.NOT_FOUND, msg) + + +src/common/tools/service/ServiceCheckers.py + import grpc + from common.database.api.Database import Database + from common.exceptions.ServiceException import ServiceException + + def check_service_exists(database : Database, context_id : str, service_id : str): + if not database.contexts.contains(context_id): + msg = 'Context({}) does not exist in the database.' + msg = msg.format(context_id) + raise ServiceException(grpc.StatusCode.NOT_FOUND, msg) + + db_context = database.context(context_id) + if db_context.services.contains(service_id): + return db_context.service(service_id) + + msg = 'Context({})/Service({}) does not exist in the database.' + msg = msg.format(context_id, service_id) + raise ServiceException(grpc.StatusCode.NOT_FOUND, msg) + + +src/device/service/Tools.py + import grpc, logging + from typing import Dict, List, Set, Tuple + from common.Checkers import chk_options, chk_string + from common.database.api.Database import Database + from common.database.api.context.Constants import DEFAULT_CONTEXT_ID, DEFAULT_TOPOLOGY_ID + from common.database.api.context.topology.device.Endpoint import Endpoint + from common.database.api.context.topology.device.OperationalStatus import OperationalStatus, \ + operationalstatus_enum_values, to_operationalstatus_enum + from common.exceptions.ServiceException import ServiceException + from common.tools.service.DeviceCheckers import check_device_endpoint_exists + from common.tools.service.EndpointIdCheckers import check_endpoint_id + from common.tools.service.EnumCheckers import check_enum + from common.tools.service.DeviceCheckers import check_device_exists, check_device_not_exists + from device.proto.context_pb2 import Device, DeviceId + + # For each method name, define acceptable device operational statuses. Empty set means accept all. + ACCEPTED_DEVICE_OPERATIONAL_STATUSES : Dict[str, Set[OperationalStatus]] = { + 'AddDevice': set([OperationalStatus.ENABLED, OperationalStatus.DISABLED]), + 'UpdateDevice': set([OperationalStatus.KEEP_STATE, OperationalStatus.ENABLED, OperationalStatus.DISABLED]), + } + + def _check_device_exists(method_name : str, database : Database, device_id : str): + if method_name in ['AddDevice']: + check_device_not_exists(database, DEFAULT_CONTEXT_ID, DEFAULT_TOPOLOGY_ID, device_id) + elif method_name in ['UpdateDevice', 'DeleteDevice']: + check_device_exists(database, DEFAULT_CONTEXT_ID, DEFAULT_TOPOLOGY_ID, device_id) + else: # pragma: no cover (test requires malforming the code) + msg = 'Unexpected condition: _check_device_exists(method_name={}, device_id={})' + msg = msg.format(str(method_name), str(device_id)) + raise ServiceException(grpc.StatusCode.UNIMPLEMENTED, msg) + + def _check_device_endpoint_exists_or_get_pointer( + method_name : str, database : Database, parent_name : str, device_id : str, endpoint_id : str) -> Endpoint: + + if method_name in ['AddDevice']: + db_context = database.context(DEFAULT_CONTEXT_ID) + db_topology = db_context.topology(DEFAULT_TOPOLOGY_ID) + db_device = db_topology.device(device_id) + return db_device.endpoint(endpoint_id) + elif method_name in ['UpdateDevice', 'DeleteDevice']: + return check_device_endpoint_exists( + database, parent_name, DEFAULT_CONTEXT_ID, DEFAULT_TOPOLOGY_ID, device_id, endpoint_id) + else: # pragma: no cover (test requires malforming the code) + msg = 'Unexpected condition: _check_device_endpoint_exists_or_get_pointer(method_name={}, ' \ + 'parent_name={}, device_id={}, endpoint_id={})' + msg = msg.format(str(method_name), str(parent_name), str(device_id), str(endpoint_id)) + raise ServiceException(grpc.StatusCode.UNIMPLEMENTED, msg) + + def check_device_operational_status(method_name : str, value : str) -> OperationalStatus: + return check_enum( + 'OperationalStatus', method_name, value, to_operationalstatus_enum, ACCEPTED_DEVICE_OPERATIONAL_STATUSES) + + def check_device_request( + method_name : str, request : Device, database : Database, logger : logging.Logger + ) -> Tuple[str, str, str, OperationalStatus, List[Tuple[Endpoint, str]]]: + + # ----- Parse attributes ------------------------------------------------------------------------------------------- + try: + device_id = chk_string ('device.device_id.device_id.uuid', + request.device_id.device_id.uuid, + allow_empty=False) + device_type = chk_string ('device.device_type', + request.device_type, + allow_empty=False) + device_config = chk_string ('device.device_config.device_config', + request.device_config.device_config, + allow_empty=True) + device_opstat = chk_options('device.devOperationalStatus', + request.devOperationalStatus, + operationalstatus_enum_values()) + except Exception as e: + logger.exception('Invalid arguments:') + raise ServiceException(grpc.StatusCode.INVALID_ARGUMENT, str(e)) + + device_opstat = check_device_operational_status(method_name, device_opstat) + + # ----- Check if device exists in database ------------------------------------------------------------------------- + _check_device_exists(method_name, database, device_id) + + # ----- Parse endpoints and check if they exist in the database as device endpoints -------------------------------- + add_topology_devices_endpoints : Dict[str, Dict[str, Set[str]]] = {} + db_endpoints__port_types : List[Tuple[Endpoint, str]] = [] + for endpoint_number,endpoint in enumerate(request.endpointList): + parent_name = 'Endpoint(#{}) of Context({})/Topology({})/Device({})' + parent_name = parent_name.format(endpoint_number, DEFAULT_CONTEXT_ID, DEFAULT_TOPOLOGY_ID, device_id) + + _, ep_device_id, ep_port_id = check_endpoint_id( + logger, endpoint_number, parent_name, endpoint.port_id, add_topology_devices_endpoints, + predefined_device_id=device_id, acceptable_device_ids=set([device_id]), + prevent_same_device_multiple_times=False) + + try: + ep_port_type = chk_string('endpoint[#{}].port_type'.format(endpoint_number), + endpoint.port_type, + allow_empty=False) + except Exception as e: + logger.exception('Invalid arguments:') + raise ServiceException(grpc.StatusCode.INVALID_ARGUMENT, str(e)) + + db_endpoint = _check_device_endpoint_exists_or_get_pointer( + method_name, database, parent_name, ep_device_id, ep_port_id) + db_endpoints__port_types.append((db_endpoint, ep_port_type)) + + return device_id, device_type, device_config, device_opstat, db_endpoints__port_types + + def check_device_id_request( + method_name : str, request : DeviceId, database : Database, logger : logging.Logger) -> str: + + # ----- Parse attributes ------------------------------------------------------------------------------------------- + try: + device_id = chk_string('device_id.device_id.uuid', + request.device_id.uuid, + allow_empty=False) + except Exception as e: + logger.exception('Invalid arguments:') + raise ServiceException(grpc.StatusCode.INVALID_ARGUMENT, str(e)) + + # ----- Check if device exists in database --------------------------------------------------------------------------- + _check_device_exists(method_name, database, device_id) + + return device_id + + +src/service/service/Tools.py diff --git a/src/slice/proto/__init__.py b/src/slice/proto/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/slice/proto/__init__.py @@ -0,0 +1,14 @@ +# 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. + diff --git a/src/slice/proto/context_pb2.py b/src/slice/proto/context_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..50d501d3ac053ad644554331af26e3c40cd426a1 --- /dev/null +++ b/src/slice/proto/context_pb2.py @@ -0,0 +1,3071 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: context.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from . import kpi_sample_types_pb2 as kpi__sample__types__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='context.proto', + package='context', + syntax='proto3', + serialized_options=None, + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n\rcontext.proto\x12\x07\x63ontext\x1a\x16kpi_sample_types.proto\"\x07\n\x05\x45mpty\"\x14\n\x04Uuid\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"F\n\x05\x45vent\x12\x11\n\ttimestamp\x18\x01 \x01(\x01\x12*\n\nevent_type\x18\x02 \x01(\x0e\x32\x16.context.EventTypeEnum\"0\n\tContextId\x12#\n\x0c\x63ontext_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xb6\x01\n\x07\x43ontext\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12)\n\x0ctopology_ids\x18\x02 \x03(\x0b\x32\x13.context.TopologyId\x12\'\n\x0bservice_ids\x18\x03 \x03(\x0b\x32\x12.context.ServiceId\x12/\n\ncontroller\x18\x04 \x01(\x0b\x32\x1b.context.TeraFlowController\"8\n\rContextIdList\x12\'\n\x0b\x63ontext_ids\x18\x01 \x03(\x0b\x32\x12.context.ContextId\"1\n\x0b\x43ontextList\x12\"\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32\x10.context.Context\"U\n\x0c\x43ontextEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\ncontext_id\x18\x02 \x01(\x0b\x32\x12.context.ContextId\"Z\n\nTopologyId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12$\n\rtopology_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"~\n\x08Topology\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12%\n\ndevice_ids\x18\x02 \x03(\x0b\x32\x11.context.DeviceId\x12!\n\x08link_ids\x18\x03 \x03(\x0b\x32\x0f.context.LinkId\";\n\x0eTopologyIdList\x12)\n\x0ctopology_ids\x18\x01 \x03(\x0b\x32\x13.context.TopologyId\"5\n\x0cTopologyList\x12%\n\ntopologies\x18\x01 \x03(\x0b\x32\x11.context.Topology\"X\n\rTopologyEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12(\n\x0btopology_id\x18\x02 \x01(\x0b\x32\x13.context.TopologyId\".\n\x08\x44\x65viceId\x12\"\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x9a\x02\n\x06\x44\x65vice\x12$\n\tdevice_id\x18\x01 \x01(\x0b\x32\x11.context.DeviceId\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12,\n\rdevice_config\x18\x03 \x01(\x0b\x32\x15.context.DeviceConfig\x12G\n\x19\x64\x65vice_operational_status\x18\x04 \x01(\x0e\x32$.context.DeviceOperationalStatusEnum\x12\x31\n\x0e\x64\x65vice_drivers\x18\x05 \x03(\x0e\x32\x19.context.DeviceDriverEnum\x12+\n\x10\x64\x65vice_endpoints\x18\x06 \x03(\x0b\x32\x11.context.EndPoint\"9\n\x0c\x44\x65viceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"5\n\x0c\x44\x65viceIdList\x12%\n\ndevice_ids\x18\x01 \x03(\x0b\x32\x11.context.DeviceId\".\n\nDeviceList\x12 \n\x07\x64\x65vices\x18\x01 \x03(\x0b\x32\x0f.context.Device\"R\n\x0b\x44\x65viceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"*\n\x06LinkId\x12 \n\tlink_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"X\n\x04Link\x12 \n\x07link_id\x18\x01 \x01(\x0b\x32\x0f.context.LinkId\x12.\n\x11link_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\"/\n\nLinkIdList\x12!\n\x08link_ids\x18\x01 \x03(\x0b\x32\x0f.context.LinkId\"(\n\x08LinkList\x12\x1c\n\x05links\x18\x01 \x03(\x0b\x32\r.context.Link\"L\n\tLinkEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12 \n\x07link_id\x18\x02 \x01(\x0b\x32\x0f.context.LinkId\"X\n\tServiceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12#\n\x0cservice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\xa6\x02\n\x07Service\x12&\n\nservice_id\x18\x01 \x01(\x0b\x32\x12.context.ServiceId\x12.\n\x0cservice_type\x18\x02 \x01(\x0e\x32\x18.context.ServiceTypeEnum\x12\x31\n\x14service_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12\x30\n\x13service_constraints\x18\x04 \x03(\x0b\x32\x13.context.Constraint\x12.\n\x0eservice_status\x18\x05 \x01(\x0b\x32\x16.context.ServiceStatus\x12.\n\x0eservice_config\x18\x06 \x01(\x0b\x32\x16.context.ServiceConfig\"C\n\rServiceStatus\x12\x32\n\x0eservice_status\x18\x01 \x01(\x0e\x32\x1a.context.ServiceStatusEnum\":\n\rServiceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"8\n\rServiceIdList\x12\'\n\x0bservice_ids\x18\x01 \x03(\x0b\x32\x12.context.ServiceId\"1\n\x0bServiceList\x12\"\n\x08services\x18\x01 \x03(\x0b\x32\x10.context.Service\"U\n\x0cServiceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\"T\n\x07SliceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12!\n\nslice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\x95\x02\n\x05Slice\x12\"\n\x08slice_id\x18\x01 \x01(\x0b\x32\x10.context.SliceId\x12/\n\x12slice_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\x12.\n\x11slice_constraints\x18\x03 \x03(\x0b\x32\x13.context.Constraint\x12-\n\x11slice_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\x12,\n\x12slice_subslice_ids\x18\x05 \x03(\x0b\x32\x10.context.SliceId\x12*\n\x0cslice_status\x18\x06 \x01(\x0b\x32\x14.context.SliceStatus\"=\n\x0bSliceStatus\x12.\n\x0cslice_status\x18\x01 \x01(\x0e\x32\x18.context.SliceStatusEnum\"2\n\x0bSliceIdList\x12#\n\tslice_ids\x18\x01 \x03(\x0b\x32\x10.context.SliceId\"+\n\tSliceList\x12\x1e\n\x06slices\x18\x01 \x03(\x0b\x32\x0e.context.Slice\"O\n\nSliceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12\"\n\x08slice_id\x18\x02 \x01(\x0b\x32\x10.context.SliceId\"6\n\x0c\x43onnectionId\x12&\n\x0f\x63onnection_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xc4\x01\n\nConnection\x12,\n\rconnection_id\x18\x01 \x01(\x0b\x32\x15.context.ConnectionId\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\x12\x33\n\x16path_hops_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12+\n\x0fsub_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\"A\n\x10\x43onnectionIdList\x12-\n\x0e\x63onnection_ids\x18\x01 \x03(\x0b\x32\x15.context.ConnectionId\":\n\x0e\x43onnectionList\x12(\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x13.context.Connection\"^\n\x0f\x43onnectionEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12,\n\rconnection_id\x18\x02 \x01(\x0b\x32\x15.context.ConnectionId\"\x82\x01\n\nEndPointId\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\x12$\n\rendpoint_uuid\x18\x03 \x01(\x0b\x32\r.context.Uuid\"\x86\x01\n\x08\x45ndPoint\x12(\n\x0b\x65ndpoint_id\x18\x01 \x01(\x0b\x32\x13.context.EndPointId\x12\x15\n\rendpoint_type\x18\x02 \x01(\t\x12\x39\n\x10kpi_sample_types\x18\x03 \x03(\x0e\x32\x1f.kpi_sample_types.KpiSampleType\"e\n\nConfigRule\x12)\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x19.context.ConfigActionEnum\x12\x14\n\x0cresource_key\x18\x02 \x01(\t\x12\x16\n\x0eresource_value\x18\x03 \x01(\t\"?\n\nConstraint\x12\x17\n\x0f\x63onstraint_type\x18\x01 \x01(\t\x12\x18\n\x10\x63onstraint_value\x18\x02 \x01(\t\"^\n\x12TeraFlowController\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x12\n\nip_address\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\"U\n\x14\x41uthenticationResult\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x15\n\rauthenticated\x18\x02 \x01(\x08*j\n\rEventTypeEnum\x12\x17\n\x13\x45VENTTYPE_UNDEFINED\x10\x00\x12\x14\n\x10\x45VENTTYPE_CREATE\x10\x01\x12\x14\n\x10\x45VENTTYPE_UPDATE\x10\x02\x12\x14\n\x10\x45VENTTYPE_REMOVE\x10\x03*\xc5\x01\n\x10\x44\x65viceDriverEnum\x12\x1a\n\x16\x44\x45VICEDRIVER_UNDEFINED\x10\x00\x12\x1b\n\x17\x44\x45VICEDRIVER_OPENCONFIG\x10\x01\x12\x1e\n\x1a\x44\x45VICEDRIVER_TRANSPORT_API\x10\x02\x12\x13\n\x0f\x44\x45VICEDRIVER_P4\x10\x03\x12&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOGY\x10\x04\x12\x1b\n\x17\x44\x45VICEDRIVER_ONF_TR_352\x10\x05*\x8f\x01\n\x1b\x44\x65viceOperationalStatusEnum\x12%\n!DEVICEOPERATIONALSTATUS_UNDEFINED\x10\x00\x12$\n DEVICEOPERATIONALSTATUS_DISABLED\x10\x01\x12#\n\x1f\x44\x45VICEOPERATIONALSTATUS_ENABLED\x10\x02*\x81\x01\n\x0fServiceTypeEnum\x12\x17\n\x13SERVICETYPE_UNKNOWN\x10\x00\x12\x14\n\x10SERVICETYPE_L3NM\x10\x01\x12\x14\n\x10SERVICETYPE_L2NM\x10\x02\x12)\n%SERVICETYPE_TAPI_CONNECTIVITY_SERVICE\x10\x03*\x88\x01\n\x11ServiceStatusEnum\x12\x1b\n\x17SERVICESTATUS_UNDEFINED\x10\x00\x12\x19\n\x15SERVICESTATUS_PLANNED\x10\x01\x12\x18\n\x14SERVICESTATUS_ACTIVE\x10\x02\x12!\n\x1dSERVICESTATUS_PENDING_REMOVAL\x10\x03*\x8b\x01\n\x0fSliceStatusEnum\x12\x19\n\x15SLICESTATUS_UNDEFINED\x10\x00\x12\x17\n\x13SLICESTATUS_PLANNED\x10\x01\x12\x14\n\x10SLICESTATUS_INIT\x10\x02\x12\x16\n\x12SLICESTATUS_ACTIVE\x10\x03\x12\x16\n\x12SLICESTATUS_DEINIT\x10\x04*]\n\x10\x43onfigActionEnum\x12\x1a\n\x16\x43ONFIGACTION_UNDEFINED\x10\x00\x12\x14\n\x10\x43ONFIGACTION_SET\x10\x01\x12\x17\n\x13\x43ONFIGACTION_DELETE\x10\x02\x32\xef\x12\n\x0e\x43ontextService\x12:\n\x0eListContextIds\x12\x0e.context.Empty\x1a\x16.context.ContextIdList\"\x00\x12\x36\n\x0cListContexts\x12\x0e.context.Empty\x1a\x14.context.ContextList\"\x00\x12\x34\n\nGetContext\x12\x12.context.ContextId\x1a\x10.context.Context\"\x00\x12\x34\n\nSetContext\x12\x10.context.Context\x1a\x12.context.ContextId\"\x00\x12\x35\n\rRemoveContext\x12\x12.context.ContextId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetContextEvents\x12\x0e.context.Empty\x1a\x15.context.ContextEvent\"\x00\x30\x01\x12@\n\x0fListTopologyIds\x12\x12.context.ContextId\x1a\x17.context.TopologyIdList\"\x00\x12=\n\x0eListTopologies\x12\x12.context.ContextId\x1a\x15.context.TopologyList\"\x00\x12\x37\n\x0bGetTopology\x12\x13.context.TopologyId\x1a\x11.context.Topology\"\x00\x12\x37\n\x0bSetTopology\x12\x11.context.Topology\x1a\x13.context.TopologyId\"\x00\x12\x37\n\x0eRemoveTopology\x12\x13.context.TopologyId\x1a\x0e.context.Empty\"\x00\x12?\n\x11GetTopologyEvents\x12\x0e.context.Empty\x1a\x16.context.TopologyEvent\"\x00\x30\x01\x12\x38\n\rListDeviceIds\x12\x0e.context.Empty\x1a\x15.context.DeviceIdList\"\x00\x12\x34\n\x0bListDevices\x12\x0e.context.Empty\x1a\x13.context.DeviceList\"\x00\x12\x31\n\tGetDevice\x12\x11.context.DeviceId\x1a\x0f.context.Device\"\x00\x12\x31\n\tSetDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0cRemoveDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x12;\n\x0fGetDeviceEvents\x12\x0e.context.Empty\x1a\x14.context.DeviceEvent\"\x00\x30\x01\x12\x34\n\x0bListLinkIds\x12\x0e.context.Empty\x1a\x13.context.LinkIdList\"\x00\x12\x30\n\tListLinks\x12\x0e.context.Empty\x1a\x11.context.LinkList\"\x00\x12+\n\x07GetLink\x12\x0f.context.LinkId\x1a\r.context.Link\"\x00\x12+\n\x07SetLink\x12\r.context.Link\x1a\x0f.context.LinkId\"\x00\x12/\n\nRemoveLink\x12\x0f.context.LinkId\x1a\x0e.context.Empty\"\x00\x12\x37\n\rGetLinkEvents\x12\x0e.context.Empty\x1a\x12.context.LinkEvent\"\x00\x30\x01\x12>\n\x0eListServiceIds\x12\x12.context.ContextId\x1a\x16.context.ServiceIdList\"\x00\x12:\n\x0cListServices\x12\x12.context.ContextId\x1a\x14.context.ServiceList\"\x00\x12\x34\n\nGetService\x12\x12.context.ServiceId\x1a\x10.context.Service\"\x00\x12\x34\n\nSetService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rRemoveService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetServiceEvents\x12\x0e.context.Empty\x1a\x15.context.ServiceEvent\"\x00\x30\x01\x12:\n\x0cListSliceIds\x12\x12.context.ContextId\x1a\x14.context.SliceIdList\"\x00\x12\x36\n\nListSlices\x12\x12.context.ContextId\x1a\x12.context.SliceList\"\x00\x12.\n\x08GetSlice\x12\x10.context.SliceId\x1a\x0e.context.Slice\"\x00\x12.\n\x08SetSlice\x12\x0e.context.Slice\x1a\x10.context.SliceId\"\x00\x12\x31\n\x0bRemoveSlice\x12\x10.context.SliceId\x1a\x0e.context.Empty\"\x00\x12\x39\n\x0eGetSliceEvents\x12\x0e.context.Empty\x1a\x13.context.SliceEvent\"\x00\x30\x01\x12\x44\n\x11ListConnectionIds\x12\x12.context.ServiceId\x1a\x19.context.ConnectionIdList\"\x00\x12@\n\x0fListConnections\x12\x12.context.ServiceId\x1a\x17.context.ConnectionList\"\x00\x12=\n\rGetConnection\x12\x15.context.ConnectionId\x1a\x13.context.Connection\"\x00\x12=\n\rSetConnection\x12\x13.context.Connection\x1a\x15.context.ConnectionId\"\x00\x12;\n\x10RemoveConnection\x12\x15.context.ConnectionId\x1a\x0e.context.Empty\"\x00\x12\x43\n\x13GetConnectionEvents\x12\x0e.context.Empty\x1a\x18.context.ConnectionEvent\"\x00\x30\x01\x62\x06proto3' + , + dependencies=[kpi__sample__types__pb2.DESCRIPTOR,]) + +_EVENTTYPEENUM = _descriptor.EnumDescriptor( + name='EventTypeEnum', + full_name='context.EventTypeEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='EVENTTYPE_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='EVENTTYPE_CREATE', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='EVENTTYPE_UPDATE', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='EVENTTYPE_REMOVE', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=4310, + serialized_end=4416, +) +_sym_db.RegisterEnumDescriptor(_EVENTTYPEENUM) + +EventTypeEnum = enum_type_wrapper.EnumTypeWrapper(_EVENTTYPEENUM) +_DEVICEDRIVERENUM = _descriptor.EnumDescriptor( + name='DeviceDriverEnum', + full_name='context.DeviceDriverEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='DEVICEDRIVER_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DEVICEDRIVER_OPENCONFIG', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DEVICEDRIVER_TRANSPORT_API', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DEVICEDRIVER_P4', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DEVICEDRIVER_IETF_NETWORK_TOPOLOGY', index=4, number=4, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DEVICEDRIVER_ONF_TR_352', index=5, number=5, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=4419, + serialized_end=4616, +) +_sym_db.RegisterEnumDescriptor(_DEVICEDRIVERENUM) + +DeviceDriverEnum = enum_type_wrapper.EnumTypeWrapper(_DEVICEDRIVERENUM) +_DEVICEOPERATIONALSTATUSENUM = _descriptor.EnumDescriptor( + name='DeviceOperationalStatusEnum', + full_name='context.DeviceOperationalStatusEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='DEVICEOPERATIONALSTATUS_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DEVICEOPERATIONALSTATUS_DISABLED', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DEVICEOPERATIONALSTATUS_ENABLED', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=4619, + serialized_end=4762, +) +_sym_db.RegisterEnumDescriptor(_DEVICEOPERATIONALSTATUSENUM) + +DeviceOperationalStatusEnum = enum_type_wrapper.EnumTypeWrapper(_DEVICEOPERATIONALSTATUSENUM) +_SERVICETYPEENUM = _descriptor.EnumDescriptor( + name='ServiceTypeEnum', + full_name='context.ServiceTypeEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='SERVICETYPE_UNKNOWN', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SERVICETYPE_L3NM', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SERVICETYPE_L2NM', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SERVICETYPE_TAPI_CONNECTIVITY_SERVICE', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=4765, + serialized_end=4894, +) +_sym_db.RegisterEnumDescriptor(_SERVICETYPEENUM) + +ServiceTypeEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICETYPEENUM) +_SERVICESTATUSENUM = _descriptor.EnumDescriptor( + name='ServiceStatusEnum', + full_name='context.ServiceStatusEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='SERVICESTATUS_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SERVICESTATUS_PLANNED', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SERVICESTATUS_ACTIVE', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SERVICESTATUS_PENDING_REMOVAL', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=4897, + serialized_end=5033, +) +_sym_db.RegisterEnumDescriptor(_SERVICESTATUSENUM) + +ServiceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICESTATUSENUM) +_SLICESTATUSENUM = _descriptor.EnumDescriptor( + name='SliceStatusEnum', + full_name='context.SliceStatusEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_PLANNED', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_INIT', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_ACTIVE', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_DEINIT', index=4, number=4, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=5036, + serialized_end=5175, +) +_sym_db.RegisterEnumDescriptor(_SLICESTATUSENUM) + +SliceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SLICESTATUSENUM) +_CONFIGACTIONENUM = _descriptor.EnumDescriptor( + name='ConfigActionEnum', + full_name='context.ConfigActionEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='CONFIGACTION_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CONFIGACTION_SET', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CONFIGACTION_DELETE', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=5177, + serialized_end=5270, +) +_sym_db.RegisterEnumDescriptor(_CONFIGACTIONENUM) + +ConfigActionEnum = enum_type_wrapper.EnumTypeWrapper(_CONFIGACTIONENUM) +EVENTTYPE_UNDEFINED = 0 +EVENTTYPE_CREATE = 1 +EVENTTYPE_UPDATE = 2 +EVENTTYPE_REMOVE = 3 +DEVICEDRIVER_UNDEFINED = 0 +DEVICEDRIVER_OPENCONFIG = 1 +DEVICEDRIVER_TRANSPORT_API = 2 +DEVICEDRIVER_P4 = 3 +DEVICEDRIVER_IETF_NETWORK_TOPOLOGY = 4 +DEVICEDRIVER_ONF_TR_352 = 5 +DEVICEOPERATIONALSTATUS_UNDEFINED = 0 +DEVICEOPERATIONALSTATUS_DISABLED = 1 +DEVICEOPERATIONALSTATUS_ENABLED = 2 +SERVICETYPE_UNKNOWN = 0 +SERVICETYPE_L3NM = 1 +SERVICETYPE_L2NM = 2 +SERVICETYPE_TAPI_CONNECTIVITY_SERVICE = 3 +SERVICESTATUS_UNDEFINED = 0 +SERVICESTATUS_PLANNED = 1 +SERVICESTATUS_ACTIVE = 2 +SERVICESTATUS_PENDING_REMOVAL = 3 +SLICESTATUS_UNDEFINED = 0 +SLICESTATUS_PLANNED = 1 +SLICESTATUS_INIT = 2 +SLICESTATUS_ACTIVE = 3 +SLICESTATUS_DEINIT = 4 +CONFIGACTION_UNDEFINED = 0 +CONFIGACTION_SET = 1 +CONFIGACTION_DELETE = 2 + + + +_EMPTY = _descriptor.Descriptor( + name='Empty', + full_name='context.Empty', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=50, + serialized_end=57, +) + + +_UUID = _descriptor.Descriptor( + name='Uuid', + full_name='context.Uuid', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='uuid', full_name='context.Uuid.uuid', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=59, + serialized_end=79, +) + + +_EVENT = _descriptor.Descriptor( + name='Event', + full_name='context.Event', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='timestamp', full_name='context.Event.timestamp', index=0, + number=1, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='event_type', full_name='context.Event.event_type', index=1, + number=2, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=81, + serialized_end=151, +) + + +_CONTEXTID = _descriptor.Descriptor( + name='ContextId', + full_name='context.ContextId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_uuid', full_name='context.ContextId.context_uuid', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=153, + serialized_end=201, +) + + +_CONTEXT = _descriptor.Descriptor( + name='Context', + full_name='context.Context', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_id', full_name='context.Context.context_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='topology_ids', full_name='context.Context.topology_ids', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_ids', full_name='context.Context.service_ids', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='controller', full_name='context.Context.controller', index=3, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=204, + serialized_end=386, +) + + +_CONTEXTIDLIST = _descriptor.Descriptor( + name='ContextIdList', + full_name='context.ContextIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_ids', full_name='context.ContextIdList.context_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=388, + serialized_end=444, +) + + +_CONTEXTLIST = _descriptor.Descriptor( + name='ContextList', + full_name='context.ContextList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='contexts', full_name='context.ContextList.contexts', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=446, + serialized_end=495, +) + + +_CONTEXTEVENT = _descriptor.Descriptor( + name='ContextEvent', + full_name='context.ContextEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.ContextEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='context_id', full_name='context.ContextEvent.context_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=497, + serialized_end=582, +) + + +_TOPOLOGYID = _descriptor.Descriptor( + name='TopologyId', + full_name='context.TopologyId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_id', full_name='context.TopologyId.context_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='topology_uuid', full_name='context.TopologyId.topology_uuid', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=584, + serialized_end=674, +) + + +_TOPOLOGY = _descriptor.Descriptor( + name='Topology', + full_name='context.Topology', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='topology_id', full_name='context.Topology.topology_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='device_ids', full_name='context.Topology.device_ids', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='link_ids', full_name='context.Topology.link_ids', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=676, + serialized_end=802, +) + + +_TOPOLOGYIDLIST = _descriptor.Descriptor( + name='TopologyIdList', + full_name='context.TopologyIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='topology_ids', full_name='context.TopologyIdList.topology_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=804, + serialized_end=863, +) + + +_TOPOLOGYLIST = _descriptor.Descriptor( + name='TopologyList', + full_name='context.TopologyList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='topologies', full_name='context.TopologyList.topologies', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=865, + serialized_end=918, +) + + +_TOPOLOGYEVENT = _descriptor.Descriptor( + name='TopologyEvent', + full_name='context.TopologyEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.TopologyEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='topology_id', full_name='context.TopologyEvent.topology_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=920, + serialized_end=1008, +) + + +_DEVICEID = _descriptor.Descriptor( + name='DeviceId', + full_name='context.DeviceId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='device_uuid', full_name='context.DeviceId.device_uuid', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1010, + serialized_end=1056, +) + + +_DEVICE = _descriptor.Descriptor( + name='Device', + full_name='context.Device', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='device_id', full_name='context.Device.device_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='device_type', full_name='context.Device.device_type', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='device_config', full_name='context.Device.device_config', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='device_operational_status', full_name='context.Device.device_operational_status', index=3, + number=4, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='device_drivers', full_name='context.Device.device_drivers', index=4, + number=5, type=14, cpp_type=8, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='device_endpoints', full_name='context.Device.device_endpoints', index=5, + number=6, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1059, + serialized_end=1341, +) + + +_DEVICECONFIG = _descriptor.Descriptor( + name='DeviceConfig', + full_name='context.DeviceConfig', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='config_rules', full_name='context.DeviceConfig.config_rules', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1343, + serialized_end=1400, +) + + +_DEVICEIDLIST = _descriptor.Descriptor( + name='DeviceIdList', + full_name='context.DeviceIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='device_ids', full_name='context.DeviceIdList.device_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1402, + serialized_end=1455, +) + + +_DEVICELIST = _descriptor.Descriptor( + name='DeviceList', + full_name='context.DeviceList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='devices', full_name='context.DeviceList.devices', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1457, + serialized_end=1503, +) + + +_DEVICEEVENT = _descriptor.Descriptor( + name='DeviceEvent', + full_name='context.DeviceEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.DeviceEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='device_id', full_name='context.DeviceEvent.device_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1505, + serialized_end=1587, +) + + +_LINKID = _descriptor.Descriptor( + name='LinkId', + full_name='context.LinkId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='link_uuid', full_name='context.LinkId.link_uuid', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1589, + serialized_end=1631, +) + + +_LINK = _descriptor.Descriptor( + name='Link', + full_name='context.Link', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='link_id', full_name='context.Link.link_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='link_endpoint_ids', full_name='context.Link.link_endpoint_ids', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1633, + serialized_end=1721, +) + + +_LINKIDLIST = _descriptor.Descriptor( + name='LinkIdList', + full_name='context.LinkIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='link_ids', full_name='context.LinkIdList.link_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1723, + serialized_end=1770, +) + + +_LINKLIST = _descriptor.Descriptor( + name='LinkList', + full_name='context.LinkList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='links', full_name='context.LinkList.links', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1772, + serialized_end=1812, +) + + +_LINKEVENT = _descriptor.Descriptor( + name='LinkEvent', + full_name='context.LinkEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.LinkEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='link_id', full_name='context.LinkEvent.link_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1814, + serialized_end=1890, +) + + +_SERVICEID = _descriptor.Descriptor( + name='ServiceId', + full_name='context.ServiceId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_id', full_name='context.ServiceId.context_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_uuid', full_name='context.ServiceId.service_uuid', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1892, + serialized_end=1980, +) + + +_SERVICE = _descriptor.Descriptor( + name='Service', + full_name='context.Service', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='service_id', full_name='context.Service.service_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_type', full_name='context.Service.service_type', index=1, + number=2, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_endpoint_ids', full_name='context.Service.service_endpoint_ids', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_constraints', full_name='context.Service.service_constraints', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_status', full_name='context.Service.service_status', index=4, + number=5, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_config', full_name='context.Service.service_config', index=5, + number=6, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1983, + serialized_end=2277, +) + + +_SERVICESTATUS = _descriptor.Descriptor( + name='ServiceStatus', + full_name='context.ServiceStatus', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='service_status', full_name='context.ServiceStatus.service_status', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2279, + serialized_end=2346, +) + + +_SERVICECONFIG = _descriptor.Descriptor( + name='ServiceConfig', + full_name='context.ServiceConfig', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='config_rules', full_name='context.ServiceConfig.config_rules', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2348, + serialized_end=2406, +) + + +_SERVICEIDLIST = _descriptor.Descriptor( + name='ServiceIdList', + full_name='context.ServiceIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='service_ids', full_name='context.ServiceIdList.service_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2408, + serialized_end=2464, +) + + +_SERVICELIST = _descriptor.Descriptor( + name='ServiceList', + full_name='context.ServiceList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='services', full_name='context.ServiceList.services', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2466, + serialized_end=2515, +) + + +_SERVICEEVENT = _descriptor.Descriptor( + name='ServiceEvent', + full_name='context.ServiceEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.ServiceEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_id', full_name='context.ServiceEvent.service_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2517, + serialized_end=2602, +) + + +_SLICEID = _descriptor.Descriptor( + name='SliceId', + full_name='context.SliceId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_id', full_name='context.SliceId.context_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_uuid', full_name='context.SliceId.slice_uuid', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2604, + serialized_end=2688, +) + + +_SLICE = _descriptor.Descriptor( + name='Slice', + full_name='context.Slice', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_id', full_name='context.Slice.slice_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_endpoint_ids', full_name='context.Slice.slice_endpoint_ids', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_constraints', full_name='context.Slice.slice_constraints', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_service_ids', full_name='context.Slice.slice_service_ids', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_subslice_ids', full_name='context.Slice.slice_subslice_ids', index=4, + number=5, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_status', full_name='context.Slice.slice_status', index=5, + number=6, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2691, + serialized_end=2968, +) + + +_SLICESTATUS = _descriptor.Descriptor( + name='SliceStatus', + full_name='context.SliceStatus', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_status', full_name='context.SliceStatus.slice_status', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2970, + serialized_end=3031, +) + + +_SLICEIDLIST = _descriptor.Descriptor( + name='SliceIdList', + full_name='context.SliceIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_ids', full_name='context.SliceIdList.slice_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3033, + serialized_end=3083, +) + + +_SLICELIST = _descriptor.Descriptor( + name='SliceList', + full_name='context.SliceList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slices', full_name='context.SliceList.slices', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3085, + serialized_end=3128, +) + + +_SLICEEVENT = _descriptor.Descriptor( + name='SliceEvent', + full_name='context.SliceEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.SliceEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_id', full_name='context.SliceEvent.slice_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3130, + serialized_end=3209, +) + + +_CONNECTIONID = _descriptor.Descriptor( + name='ConnectionId', + full_name='context.ConnectionId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='connection_uuid', full_name='context.ConnectionId.connection_uuid', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3211, + serialized_end=3265, +) + + +_CONNECTION = _descriptor.Descriptor( + name='Connection', + full_name='context.Connection', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='connection_id', full_name='context.Connection.connection_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='service_id', full_name='context.Connection.service_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='path_hops_endpoint_ids', full_name='context.Connection.path_hops_endpoint_ids', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='sub_service_ids', full_name='context.Connection.sub_service_ids', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3268, + serialized_end=3464, +) + + +_CONNECTIONIDLIST = _descriptor.Descriptor( + name='ConnectionIdList', + full_name='context.ConnectionIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='connection_ids', full_name='context.ConnectionIdList.connection_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3466, + serialized_end=3531, +) + + +_CONNECTIONLIST = _descriptor.Descriptor( + name='ConnectionList', + full_name='context.ConnectionList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='connections', full_name='context.ConnectionList.connections', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3533, + serialized_end=3591, +) + + +_CONNECTIONEVENT = _descriptor.Descriptor( + name='ConnectionEvent', + full_name='context.ConnectionEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.ConnectionEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='connection_id', full_name='context.ConnectionEvent.connection_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3593, + serialized_end=3687, +) + + +_ENDPOINTID = _descriptor.Descriptor( + name='EndPointId', + full_name='context.EndPointId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='topology_id', full_name='context.EndPointId.topology_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='device_id', full_name='context.EndPointId.device_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='endpoint_uuid', full_name='context.EndPointId.endpoint_uuid', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3690, + serialized_end=3820, +) + + +_ENDPOINT = _descriptor.Descriptor( + name='EndPoint', + full_name='context.EndPoint', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='endpoint_id', full_name='context.EndPoint.endpoint_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='endpoint_type', full_name='context.EndPoint.endpoint_type', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='kpi_sample_types', full_name='context.EndPoint.kpi_sample_types', index=2, + number=3, type=14, cpp_type=8, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3823, + serialized_end=3957, +) + + +_CONFIGRULE = _descriptor.Descriptor( + name='ConfigRule', + full_name='context.ConfigRule', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='action', full_name='context.ConfigRule.action', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='resource_key', full_name='context.ConfigRule.resource_key', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='resource_value', full_name='context.ConfigRule.resource_value', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3959, + serialized_end=4060, +) + + +_CONSTRAINT = _descriptor.Descriptor( + name='Constraint', + full_name='context.Constraint', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='constraint_type', full_name='context.Constraint.constraint_type', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='constraint_value', full_name='context.Constraint.constraint_value', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=4062, + serialized_end=4125, +) + + +_TERAFLOWCONTROLLER = _descriptor.Descriptor( + name='TeraFlowController', + full_name='context.TeraFlowController', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_id', full_name='context.TeraFlowController.context_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='ip_address', full_name='context.TeraFlowController.ip_address', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='port', full_name='context.TeraFlowController.port', index=2, + number=3, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=4127, + serialized_end=4221, +) + + +_AUTHENTICATIONRESULT = _descriptor.Descriptor( + name='AuthenticationResult', + full_name='context.AuthenticationResult', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_id', full_name='context.AuthenticationResult.context_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='authenticated', full_name='context.AuthenticationResult.authenticated', index=1, + number=2, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=4223, + serialized_end=4308, +) + +_EVENT.fields_by_name['event_type'].enum_type = _EVENTTYPEENUM +_CONTEXTID.fields_by_name['context_uuid'].message_type = _UUID +_CONTEXT.fields_by_name['context_id'].message_type = _CONTEXTID +_CONTEXT.fields_by_name['topology_ids'].message_type = _TOPOLOGYID +_CONTEXT.fields_by_name['service_ids'].message_type = _SERVICEID +_CONTEXT.fields_by_name['controller'].message_type = _TERAFLOWCONTROLLER +_CONTEXTIDLIST.fields_by_name['context_ids'].message_type = _CONTEXTID +_CONTEXTLIST.fields_by_name['contexts'].message_type = _CONTEXT +_CONTEXTEVENT.fields_by_name['event'].message_type = _EVENT +_CONTEXTEVENT.fields_by_name['context_id'].message_type = _CONTEXTID +_TOPOLOGYID.fields_by_name['context_id'].message_type = _CONTEXTID +_TOPOLOGYID.fields_by_name['topology_uuid'].message_type = _UUID +_TOPOLOGY.fields_by_name['topology_id'].message_type = _TOPOLOGYID +_TOPOLOGY.fields_by_name['device_ids'].message_type = _DEVICEID +_TOPOLOGY.fields_by_name['link_ids'].message_type = _LINKID +_TOPOLOGYIDLIST.fields_by_name['topology_ids'].message_type = _TOPOLOGYID +_TOPOLOGYLIST.fields_by_name['topologies'].message_type = _TOPOLOGY +_TOPOLOGYEVENT.fields_by_name['event'].message_type = _EVENT +_TOPOLOGYEVENT.fields_by_name['topology_id'].message_type = _TOPOLOGYID +_DEVICEID.fields_by_name['device_uuid'].message_type = _UUID +_DEVICE.fields_by_name['device_id'].message_type = _DEVICEID +_DEVICE.fields_by_name['device_config'].message_type = _DEVICECONFIG +_DEVICE.fields_by_name['device_operational_status'].enum_type = _DEVICEOPERATIONALSTATUSENUM +_DEVICE.fields_by_name['device_drivers'].enum_type = _DEVICEDRIVERENUM +_DEVICE.fields_by_name['device_endpoints'].message_type = _ENDPOINT +_DEVICECONFIG.fields_by_name['config_rules'].message_type = _CONFIGRULE +_DEVICEIDLIST.fields_by_name['device_ids'].message_type = _DEVICEID +_DEVICELIST.fields_by_name['devices'].message_type = _DEVICE +_DEVICEEVENT.fields_by_name['event'].message_type = _EVENT +_DEVICEEVENT.fields_by_name['device_id'].message_type = _DEVICEID +_LINKID.fields_by_name['link_uuid'].message_type = _UUID +_LINK.fields_by_name['link_id'].message_type = _LINKID +_LINK.fields_by_name['link_endpoint_ids'].message_type = _ENDPOINTID +_LINKIDLIST.fields_by_name['link_ids'].message_type = _LINKID +_LINKLIST.fields_by_name['links'].message_type = _LINK +_LINKEVENT.fields_by_name['event'].message_type = _EVENT +_LINKEVENT.fields_by_name['link_id'].message_type = _LINKID +_SERVICEID.fields_by_name['context_id'].message_type = _CONTEXTID +_SERVICEID.fields_by_name['service_uuid'].message_type = _UUID +_SERVICE.fields_by_name['service_id'].message_type = _SERVICEID +_SERVICE.fields_by_name['service_type'].enum_type = _SERVICETYPEENUM +_SERVICE.fields_by_name['service_endpoint_ids'].message_type = _ENDPOINTID +_SERVICE.fields_by_name['service_constraints'].message_type = _CONSTRAINT +_SERVICE.fields_by_name['service_status'].message_type = _SERVICESTATUS +_SERVICE.fields_by_name['service_config'].message_type = _SERVICECONFIG +_SERVICESTATUS.fields_by_name['service_status'].enum_type = _SERVICESTATUSENUM +_SERVICECONFIG.fields_by_name['config_rules'].message_type = _CONFIGRULE +_SERVICEIDLIST.fields_by_name['service_ids'].message_type = _SERVICEID +_SERVICELIST.fields_by_name['services'].message_type = _SERVICE +_SERVICEEVENT.fields_by_name['event'].message_type = _EVENT +_SERVICEEVENT.fields_by_name['service_id'].message_type = _SERVICEID +_SLICEID.fields_by_name['context_id'].message_type = _CONTEXTID +_SLICEID.fields_by_name['slice_uuid'].message_type = _UUID +_SLICE.fields_by_name['slice_id'].message_type = _SLICEID +_SLICE.fields_by_name['slice_endpoint_ids'].message_type = _ENDPOINTID +_SLICE.fields_by_name['slice_constraints'].message_type = _CONSTRAINT +_SLICE.fields_by_name['slice_service_ids'].message_type = _SERVICEID +_SLICE.fields_by_name['slice_subslice_ids'].message_type = _SLICEID +_SLICE.fields_by_name['slice_status'].message_type = _SLICESTATUS +_SLICESTATUS.fields_by_name['slice_status'].enum_type = _SLICESTATUSENUM +_SLICEIDLIST.fields_by_name['slice_ids'].message_type = _SLICEID +_SLICELIST.fields_by_name['slices'].message_type = _SLICE +_SLICEEVENT.fields_by_name['event'].message_type = _EVENT +_SLICEEVENT.fields_by_name['slice_id'].message_type = _SLICEID +_CONNECTIONID.fields_by_name['connection_uuid'].message_type = _UUID +_CONNECTION.fields_by_name['connection_id'].message_type = _CONNECTIONID +_CONNECTION.fields_by_name['service_id'].message_type = _SERVICEID +_CONNECTION.fields_by_name['path_hops_endpoint_ids'].message_type = _ENDPOINTID +_CONNECTION.fields_by_name['sub_service_ids'].message_type = _SERVICEID +_CONNECTIONIDLIST.fields_by_name['connection_ids'].message_type = _CONNECTIONID +_CONNECTIONLIST.fields_by_name['connections'].message_type = _CONNECTION +_CONNECTIONEVENT.fields_by_name['event'].message_type = _EVENT +_CONNECTIONEVENT.fields_by_name['connection_id'].message_type = _CONNECTIONID +_ENDPOINTID.fields_by_name['topology_id'].message_type = _TOPOLOGYID +_ENDPOINTID.fields_by_name['device_id'].message_type = _DEVICEID +_ENDPOINTID.fields_by_name['endpoint_uuid'].message_type = _UUID +_ENDPOINT.fields_by_name['endpoint_id'].message_type = _ENDPOINTID +_ENDPOINT.fields_by_name['kpi_sample_types'].enum_type = kpi__sample__types__pb2._KPISAMPLETYPE +_CONFIGRULE.fields_by_name['action'].enum_type = _CONFIGACTIONENUM +_TERAFLOWCONTROLLER.fields_by_name['context_id'].message_type = _CONTEXTID +_AUTHENTICATIONRESULT.fields_by_name['context_id'].message_type = _CONTEXTID +DESCRIPTOR.message_types_by_name['Empty'] = _EMPTY +DESCRIPTOR.message_types_by_name['Uuid'] = _UUID +DESCRIPTOR.message_types_by_name['Event'] = _EVENT +DESCRIPTOR.message_types_by_name['ContextId'] = _CONTEXTID +DESCRIPTOR.message_types_by_name['Context'] = _CONTEXT +DESCRIPTOR.message_types_by_name['ContextIdList'] = _CONTEXTIDLIST +DESCRIPTOR.message_types_by_name['ContextList'] = _CONTEXTLIST +DESCRIPTOR.message_types_by_name['ContextEvent'] = _CONTEXTEVENT +DESCRIPTOR.message_types_by_name['TopologyId'] = _TOPOLOGYID +DESCRIPTOR.message_types_by_name['Topology'] = _TOPOLOGY +DESCRIPTOR.message_types_by_name['TopologyIdList'] = _TOPOLOGYIDLIST +DESCRIPTOR.message_types_by_name['TopologyList'] = _TOPOLOGYLIST +DESCRIPTOR.message_types_by_name['TopologyEvent'] = _TOPOLOGYEVENT +DESCRIPTOR.message_types_by_name['DeviceId'] = _DEVICEID +DESCRIPTOR.message_types_by_name['Device'] = _DEVICE +DESCRIPTOR.message_types_by_name['DeviceConfig'] = _DEVICECONFIG +DESCRIPTOR.message_types_by_name['DeviceIdList'] = _DEVICEIDLIST +DESCRIPTOR.message_types_by_name['DeviceList'] = _DEVICELIST +DESCRIPTOR.message_types_by_name['DeviceEvent'] = _DEVICEEVENT +DESCRIPTOR.message_types_by_name['LinkId'] = _LINKID +DESCRIPTOR.message_types_by_name['Link'] = _LINK +DESCRIPTOR.message_types_by_name['LinkIdList'] = _LINKIDLIST +DESCRIPTOR.message_types_by_name['LinkList'] = _LINKLIST +DESCRIPTOR.message_types_by_name['LinkEvent'] = _LINKEVENT +DESCRIPTOR.message_types_by_name['ServiceId'] = _SERVICEID +DESCRIPTOR.message_types_by_name['Service'] = _SERVICE +DESCRIPTOR.message_types_by_name['ServiceStatus'] = _SERVICESTATUS +DESCRIPTOR.message_types_by_name['ServiceConfig'] = _SERVICECONFIG +DESCRIPTOR.message_types_by_name['ServiceIdList'] = _SERVICEIDLIST +DESCRIPTOR.message_types_by_name['ServiceList'] = _SERVICELIST +DESCRIPTOR.message_types_by_name['ServiceEvent'] = _SERVICEEVENT +DESCRIPTOR.message_types_by_name['SliceId'] = _SLICEID +DESCRIPTOR.message_types_by_name['Slice'] = _SLICE +DESCRIPTOR.message_types_by_name['SliceStatus'] = _SLICESTATUS +DESCRIPTOR.message_types_by_name['SliceIdList'] = _SLICEIDLIST +DESCRIPTOR.message_types_by_name['SliceList'] = _SLICELIST +DESCRIPTOR.message_types_by_name['SliceEvent'] = _SLICEEVENT +DESCRIPTOR.message_types_by_name['ConnectionId'] = _CONNECTIONID +DESCRIPTOR.message_types_by_name['Connection'] = _CONNECTION +DESCRIPTOR.message_types_by_name['ConnectionIdList'] = _CONNECTIONIDLIST +DESCRIPTOR.message_types_by_name['ConnectionList'] = _CONNECTIONLIST +DESCRIPTOR.message_types_by_name['ConnectionEvent'] = _CONNECTIONEVENT +DESCRIPTOR.message_types_by_name['EndPointId'] = _ENDPOINTID +DESCRIPTOR.message_types_by_name['EndPoint'] = _ENDPOINT +DESCRIPTOR.message_types_by_name['ConfigRule'] = _CONFIGRULE +DESCRIPTOR.message_types_by_name['Constraint'] = _CONSTRAINT +DESCRIPTOR.message_types_by_name['TeraFlowController'] = _TERAFLOWCONTROLLER +DESCRIPTOR.message_types_by_name['AuthenticationResult'] = _AUTHENTICATIONRESULT +DESCRIPTOR.enum_types_by_name['EventTypeEnum'] = _EVENTTYPEENUM +DESCRIPTOR.enum_types_by_name['DeviceDriverEnum'] = _DEVICEDRIVERENUM +DESCRIPTOR.enum_types_by_name['DeviceOperationalStatusEnum'] = _DEVICEOPERATIONALSTATUSENUM +DESCRIPTOR.enum_types_by_name['ServiceTypeEnum'] = _SERVICETYPEENUM +DESCRIPTOR.enum_types_by_name['ServiceStatusEnum'] = _SERVICESTATUSENUM +DESCRIPTOR.enum_types_by_name['SliceStatusEnum'] = _SLICESTATUSENUM +DESCRIPTOR.enum_types_by_name['ConfigActionEnum'] = _CONFIGACTIONENUM +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +Empty = _reflection.GeneratedProtocolMessageType('Empty', (_message.Message,), { + 'DESCRIPTOR' : _EMPTY, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Empty) + }) +_sym_db.RegisterMessage(Empty) + +Uuid = _reflection.GeneratedProtocolMessageType('Uuid', (_message.Message,), { + 'DESCRIPTOR' : _UUID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Uuid) + }) +_sym_db.RegisterMessage(Uuid) + +Event = _reflection.GeneratedProtocolMessageType('Event', (_message.Message,), { + 'DESCRIPTOR' : _EVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Event) + }) +_sym_db.RegisterMessage(Event) + +ContextId = _reflection.GeneratedProtocolMessageType('ContextId', (_message.Message,), { + 'DESCRIPTOR' : _CONTEXTID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ContextId) + }) +_sym_db.RegisterMessage(ContextId) + +Context = _reflection.GeneratedProtocolMessageType('Context', (_message.Message,), { + 'DESCRIPTOR' : _CONTEXT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Context) + }) +_sym_db.RegisterMessage(Context) + +ContextIdList = _reflection.GeneratedProtocolMessageType('ContextIdList', (_message.Message,), { + 'DESCRIPTOR' : _CONTEXTIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ContextIdList) + }) +_sym_db.RegisterMessage(ContextIdList) + +ContextList = _reflection.GeneratedProtocolMessageType('ContextList', (_message.Message,), { + 'DESCRIPTOR' : _CONTEXTLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ContextList) + }) +_sym_db.RegisterMessage(ContextList) + +ContextEvent = _reflection.GeneratedProtocolMessageType('ContextEvent', (_message.Message,), { + 'DESCRIPTOR' : _CONTEXTEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ContextEvent) + }) +_sym_db.RegisterMessage(ContextEvent) + +TopologyId = _reflection.GeneratedProtocolMessageType('TopologyId', (_message.Message,), { + 'DESCRIPTOR' : _TOPOLOGYID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.TopologyId) + }) +_sym_db.RegisterMessage(TopologyId) + +Topology = _reflection.GeneratedProtocolMessageType('Topology', (_message.Message,), { + 'DESCRIPTOR' : _TOPOLOGY, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Topology) + }) +_sym_db.RegisterMessage(Topology) + +TopologyIdList = _reflection.GeneratedProtocolMessageType('TopologyIdList', (_message.Message,), { + 'DESCRIPTOR' : _TOPOLOGYIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.TopologyIdList) + }) +_sym_db.RegisterMessage(TopologyIdList) + +TopologyList = _reflection.GeneratedProtocolMessageType('TopologyList', (_message.Message,), { + 'DESCRIPTOR' : _TOPOLOGYLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.TopologyList) + }) +_sym_db.RegisterMessage(TopologyList) + +TopologyEvent = _reflection.GeneratedProtocolMessageType('TopologyEvent', (_message.Message,), { + 'DESCRIPTOR' : _TOPOLOGYEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.TopologyEvent) + }) +_sym_db.RegisterMessage(TopologyEvent) + +DeviceId = _reflection.GeneratedProtocolMessageType('DeviceId', (_message.Message,), { + 'DESCRIPTOR' : _DEVICEID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.DeviceId) + }) +_sym_db.RegisterMessage(DeviceId) + +Device = _reflection.GeneratedProtocolMessageType('Device', (_message.Message,), { + 'DESCRIPTOR' : _DEVICE, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Device) + }) +_sym_db.RegisterMessage(Device) + +DeviceConfig = _reflection.GeneratedProtocolMessageType('DeviceConfig', (_message.Message,), { + 'DESCRIPTOR' : _DEVICECONFIG, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.DeviceConfig) + }) +_sym_db.RegisterMessage(DeviceConfig) + +DeviceIdList = _reflection.GeneratedProtocolMessageType('DeviceIdList', (_message.Message,), { + 'DESCRIPTOR' : _DEVICEIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.DeviceIdList) + }) +_sym_db.RegisterMessage(DeviceIdList) + +DeviceList = _reflection.GeneratedProtocolMessageType('DeviceList', (_message.Message,), { + 'DESCRIPTOR' : _DEVICELIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.DeviceList) + }) +_sym_db.RegisterMessage(DeviceList) + +DeviceEvent = _reflection.GeneratedProtocolMessageType('DeviceEvent', (_message.Message,), { + 'DESCRIPTOR' : _DEVICEEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.DeviceEvent) + }) +_sym_db.RegisterMessage(DeviceEvent) + +LinkId = _reflection.GeneratedProtocolMessageType('LinkId', (_message.Message,), { + 'DESCRIPTOR' : _LINKID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.LinkId) + }) +_sym_db.RegisterMessage(LinkId) + +Link = _reflection.GeneratedProtocolMessageType('Link', (_message.Message,), { + 'DESCRIPTOR' : _LINK, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Link) + }) +_sym_db.RegisterMessage(Link) + +LinkIdList = _reflection.GeneratedProtocolMessageType('LinkIdList', (_message.Message,), { + 'DESCRIPTOR' : _LINKIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.LinkIdList) + }) +_sym_db.RegisterMessage(LinkIdList) + +LinkList = _reflection.GeneratedProtocolMessageType('LinkList', (_message.Message,), { + 'DESCRIPTOR' : _LINKLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.LinkList) + }) +_sym_db.RegisterMessage(LinkList) + +LinkEvent = _reflection.GeneratedProtocolMessageType('LinkEvent', (_message.Message,), { + 'DESCRIPTOR' : _LINKEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.LinkEvent) + }) +_sym_db.RegisterMessage(LinkEvent) + +ServiceId = _reflection.GeneratedProtocolMessageType('ServiceId', (_message.Message,), { + 'DESCRIPTOR' : _SERVICEID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ServiceId) + }) +_sym_db.RegisterMessage(ServiceId) + +Service = _reflection.GeneratedProtocolMessageType('Service', (_message.Message,), { + 'DESCRIPTOR' : _SERVICE, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Service) + }) +_sym_db.RegisterMessage(Service) + +ServiceStatus = _reflection.GeneratedProtocolMessageType('ServiceStatus', (_message.Message,), { + 'DESCRIPTOR' : _SERVICESTATUS, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ServiceStatus) + }) +_sym_db.RegisterMessage(ServiceStatus) + +ServiceConfig = _reflection.GeneratedProtocolMessageType('ServiceConfig', (_message.Message,), { + 'DESCRIPTOR' : _SERVICECONFIG, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ServiceConfig) + }) +_sym_db.RegisterMessage(ServiceConfig) + +ServiceIdList = _reflection.GeneratedProtocolMessageType('ServiceIdList', (_message.Message,), { + 'DESCRIPTOR' : _SERVICEIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ServiceIdList) + }) +_sym_db.RegisterMessage(ServiceIdList) + +ServiceList = _reflection.GeneratedProtocolMessageType('ServiceList', (_message.Message,), { + 'DESCRIPTOR' : _SERVICELIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ServiceList) + }) +_sym_db.RegisterMessage(ServiceList) + +ServiceEvent = _reflection.GeneratedProtocolMessageType('ServiceEvent', (_message.Message,), { + 'DESCRIPTOR' : _SERVICEEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ServiceEvent) + }) +_sym_db.RegisterMessage(ServiceEvent) + +SliceId = _reflection.GeneratedProtocolMessageType('SliceId', (_message.Message,), { + 'DESCRIPTOR' : _SLICEID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceId) + }) +_sym_db.RegisterMessage(SliceId) + +Slice = _reflection.GeneratedProtocolMessageType('Slice', (_message.Message,), { + 'DESCRIPTOR' : _SLICE, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Slice) + }) +_sym_db.RegisterMessage(Slice) + +SliceStatus = _reflection.GeneratedProtocolMessageType('SliceStatus', (_message.Message,), { + 'DESCRIPTOR' : _SLICESTATUS, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceStatus) + }) +_sym_db.RegisterMessage(SliceStatus) + +SliceIdList = _reflection.GeneratedProtocolMessageType('SliceIdList', (_message.Message,), { + 'DESCRIPTOR' : _SLICEIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceIdList) + }) +_sym_db.RegisterMessage(SliceIdList) + +SliceList = _reflection.GeneratedProtocolMessageType('SliceList', (_message.Message,), { + 'DESCRIPTOR' : _SLICELIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceList) + }) +_sym_db.RegisterMessage(SliceList) + +SliceEvent = _reflection.GeneratedProtocolMessageType('SliceEvent', (_message.Message,), { + 'DESCRIPTOR' : _SLICEEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceEvent) + }) +_sym_db.RegisterMessage(SliceEvent) + +ConnectionId = _reflection.GeneratedProtocolMessageType('ConnectionId', (_message.Message,), { + 'DESCRIPTOR' : _CONNECTIONID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ConnectionId) + }) +_sym_db.RegisterMessage(ConnectionId) + +Connection = _reflection.GeneratedProtocolMessageType('Connection', (_message.Message,), { + 'DESCRIPTOR' : _CONNECTION, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Connection) + }) +_sym_db.RegisterMessage(Connection) + +ConnectionIdList = _reflection.GeneratedProtocolMessageType('ConnectionIdList', (_message.Message,), { + 'DESCRIPTOR' : _CONNECTIONIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ConnectionIdList) + }) +_sym_db.RegisterMessage(ConnectionIdList) + +ConnectionList = _reflection.GeneratedProtocolMessageType('ConnectionList', (_message.Message,), { + 'DESCRIPTOR' : _CONNECTIONLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ConnectionList) + }) +_sym_db.RegisterMessage(ConnectionList) + +ConnectionEvent = _reflection.GeneratedProtocolMessageType('ConnectionEvent', (_message.Message,), { + 'DESCRIPTOR' : _CONNECTIONEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ConnectionEvent) + }) +_sym_db.RegisterMessage(ConnectionEvent) + +EndPointId = _reflection.GeneratedProtocolMessageType('EndPointId', (_message.Message,), { + 'DESCRIPTOR' : _ENDPOINTID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.EndPointId) + }) +_sym_db.RegisterMessage(EndPointId) + +EndPoint = _reflection.GeneratedProtocolMessageType('EndPoint', (_message.Message,), { + 'DESCRIPTOR' : _ENDPOINT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.EndPoint) + }) +_sym_db.RegisterMessage(EndPoint) + +ConfigRule = _reflection.GeneratedProtocolMessageType('ConfigRule', (_message.Message,), { + 'DESCRIPTOR' : _CONFIGRULE, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ConfigRule) + }) +_sym_db.RegisterMessage(ConfigRule) + +Constraint = _reflection.GeneratedProtocolMessageType('Constraint', (_message.Message,), { + 'DESCRIPTOR' : _CONSTRAINT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Constraint) + }) +_sym_db.RegisterMessage(Constraint) + +TeraFlowController = _reflection.GeneratedProtocolMessageType('TeraFlowController', (_message.Message,), { + 'DESCRIPTOR' : _TERAFLOWCONTROLLER, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.TeraFlowController) + }) +_sym_db.RegisterMessage(TeraFlowController) + +AuthenticationResult = _reflection.GeneratedProtocolMessageType('AuthenticationResult', (_message.Message,), { + 'DESCRIPTOR' : _AUTHENTICATIONRESULT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.AuthenticationResult) + }) +_sym_db.RegisterMessage(AuthenticationResult) + + + +_CONTEXTSERVICE = _descriptor.ServiceDescriptor( + name='ContextService', + full_name='context.ContextService', + file=DESCRIPTOR, + index=0, + serialized_options=None, + create_key=_descriptor._internal_create_key, + serialized_start=5273, + serialized_end=7688, + methods=[ + _descriptor.MethodDescriptor( + name='ListContextIds', + full_name='context.ContextService.ListContextIds', + index=0, + containing_service=None, + input_type=_EMPTY, + output_type=_CONTEXTIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListContexts', + full_name='context.ContextService.ListContexts', + index=1, + containing_service=None, + input_type=_EMPTY, + output_type=_CONTEXTLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetContext', + full_name='context.ContextService.GetContext', + index=2, + containing_service=None, + input_type=_CONTEXTID, + output_type=_CONTEXT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetContext', + full_name='context.ContextService.SetContext', + index=3, + containing_service=None, + input_type=_CONTEXT, + output_type=_CONTEXTID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveContext', + full_name='context.ContextService.RemoveContext', + index=4, + containing_service=None, + input_type=_CONTEXTID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetContextEvents', + full_name='context.ContextService.GetContextEvents', + index=5, + containing_service=None, + input_type=_EMPTY, + output_type=_CONTEXTEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListTopologyIds', + full_name='context.ContextService.ListTopologyIds', + index=6, + containing_service=None, + input_type=_CONTEXTID, + output_type=_TOPOLOGYIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListTopologies', + full_name='context.ContextService.ListTopologies', + index=7, + containing_service=None, + input_type=_CONTEXTID, + output_type=_TOPOLOGYLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetTopology', + full_name='context.ContextService.GetTopology', + index=8, + containing_service=None, + input_type=_TOPOLOGYID, + output_type=_TOPOLOGY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetTopology', + full_name='context.ContextService.SetTopology', + index=9, + containing_service=None, + input_type=_TOPOLOGY, + output_type=_TOPOLOGYID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveTopology', + full_name='context.ContextService.RemoveTopology', + index=10, + containing_service=None, + input_type=_TOPOLOGYID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetTopologyEvents', + full_name='context.ContextService.GetTopologyEvents', + index=11, + containing_service=None, + input_type=_EMPTY, + output_type=_TOPOLOGYEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListDeviceIds', + full_name='context.ContextService.ListDeviceIds', + index=12, + containing_service=None, + input_type=_EMPTY, + output_type=_DEVICEIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListDevices', + full_name='context.ContextService.ListDevices', + index=13, + containing_service=None, + input_type=_EMPTY, + output_type=_DEVICELIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetDevice', + full_name='context.ContextService.GetDevice', + index=14, + containing_service=None, + input_type=_DEVICEID, + output_type=_DEVICE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetDevice', + full_name='context.ContextService.SetDevice', + index=15, + containing_service=None, + input_type=_DEVICE, + output_type=_DEVICEID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveDevice', + full_name='context.ContextService.RemoveDevice', + index=16, + containing_service=None, + input_type=_DEVICEID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetDeviceEvents', + full_name='context.ContextService.GetDeviceEvents', + index=17, + containing_service=None, + input_type=_EMPTY, + output_type=_DEVICEEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListLinkIds', + full_name='context.ContextService.ListLinkIds', + index=18, + containing_service=None, + input_type=_EMPTY, + output_type=_LINKIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListLinks', + full_name='context.ContextService.ListLinks', + index=19, + containing_service=None, + input_type=_EMPTY, + output_type=_LINKLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetLink', + full_name='context.ContextService.GetLink', + index=20, + containing_service=None, + input_type=_LINKID, + output_type=_LINK, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetLink', + full_name='context.ContextService.SetLink', + index=21, + containing_service=None, + input_type=_LINK, + output_type=_LINKID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveLink', + full_name='context.ContextService.RemoveLink', + index=22, + containing_service=None, + input_type=_LINKID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetLinkEvents', + full_name='context.ContextService.GetLinkEvents', + index=23, + containing_service=None, + input_type=_EMPTY, + output_type=_LINKEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListServiceIds', + full_name='context.ContextService.ListServiceIds', + index=24, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SERVICEIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListServices', + full_name='context.ContextService.ListServices', + index=25, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SERVICELIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetService', + full_name='context.ContextService.GetService', + index=26, + containing_service=None, + input_type=_SERVICEID, + output_type=_SERVICE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetService', + full_name='context.ContextService.SetService', + index=27, + containing_service=None, + input_type=_SERVICE, + output_type=_SERVICEID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveService', + full_name='context.ContextService.RemoveService', + index=28, + containing_service=None, + input_type=_SERVICEID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetServiceEvents', + full_name='context.ContextService.GetServiceEvents', + index=29, + containing_service=None, + input_type=_EMPTY, + output_type=_SERVICEEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListSliceIds', + full_name='context.ContextService.ListSliceIds', + index=30, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SLICEIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListSlices', + full_name='context.ContextService.ListSlices', + index=31, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SLICELIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetSlice', + full_name='context.ContextService.GetSlice', + index=32, + containing_service=None, + input_type=_SLICEID, + output_type=_SLICE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetSlice', + full_name='context.ContextService.SetSlice', + index=33, + containing_service=None, + input_type=_SLICE, + output_type=_SLICEID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveSlice', + full_name='context.ContextService.RemoveSlice', + index=34, + containing_service=None, + input_type=_SLICEID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetSliceEvents', + full_name='context.ContextService.GetSliceEvents', + index=35, + containing_service=None, + input_type=_EMPTY, + output_type=_SLICEEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListConnectionIds', + full_name='context.ContextService.ListConnectionIds', + index=36, + containing_service=None, + input_type=_SERVICEID, + output_type=_CONNECTIONIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListConnections', + full_name='context.ContextService.ListConnections', + index=37, + containing_service=None, + input_type=_SERVICEID, + output_type=_CONNECTIONLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetConnection', + full_name='context.ContextService.GetConnection', + index=38, + containing_service=None, + input_type=_CONNECTIONID, + output_type=_CONNECTION, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetConnection', + full_name='context.ContextService.SetConnection', + index=39, + containing_service=None, + input_type=_CONNECTION, + output_type=_CONNECTIONID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveConnection', + full_name='context.ContextService.RemoveConnection', + index=40, + containing_service=None, + input_type=_CONNECTIONID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetConnectionEvents', + full_name='context.ContextService.GetConnectionEvents', + index=41, + containing_service=None, + input_type=_EMPTY, + output_type=_CONNECTIONEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), +]) +_sym_db.RegisterServiceDescriptor(_CONTEXTSERVICE) + +DESCRIPTOR.services_by_name['ContextService'] = _CONTEXTSERVICE + +# @@protoc_insertion_point(module_scope) diff --git a/src/slice/proto/kpi_sample_types_pb2.py b/src/slice/proto/kpi_sample_types_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..ea7fd2f82757d4c3db02d7e2c7817e2787b0b490 --- /dev/null +++ b/src/slice/proto/kpi_sample_types_pb2.py @@ -0,0 +1,78 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: kpi_sample_types.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='kpi_sample_types.proto', + package='kpi_sample_types', + syntax='proto3', + serialized_options=None, + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n\x16kpi_sample_types.proto\x12\x10kpi_sample_types*\xbe\x01\n\rKpiSampleType\x12\x19\n\x15KPISAMPLETYPE_UNKNOWN\x10\x00\x12%\n!KPISAMPLETYPE_PACKETS_TRANSMITTED\x10\x65\x12\"\n\x1eKPISAMPLETYPE_PACKETS_RECEIVED\x10\x66\x12$\n\x1fKPISAMPLETYPE_BYTES_TRANSMITTED\x10\xc9\x01\x12!\n\x1cKPISAMPLETYPE_BYTES_RECEIVED\x10\xca\x01\x62\x06proto3' +) + +_KPISAMPLETYPE = _descriptor.EnumDescriptor( + name='KpiSampleType', + full_name='kpi_sample_types.KpiSampleType', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='KPISAMPLETYPE_UNKNOWN', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='KPISAMPLETYPE_PACKETS_TRANSMITTED', index=1, number=101, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='KPISAMPLETYPE_PACKETS_RECEIVED', index=2, number=102, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='KPISAMPLETYPE_BYTES_TRANSMITTED', index=3, number=201, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='KPISAMPLETYPE_BYTES_RECEIVED', index=4, number=202, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=45, + serialized_end=235, +) +_sym_db.RegisterEnumDescriptor(_KPISAMPLETYPE) + +KpiSampleType = enum_type_wrapper.EnumTypeWrapper(_KPISAMPLETYPE) +KPISAMPLETYPE_UNKNOWN = 0 +KPISAMPLETYPE_PACKETS_TRANSMITTED = 101 +KPISAMPLETYPE_PACKETS_RECEIVED = 102 +KPISAMPLETYPE_BYTES_TRANSMITTED = 201 +KPISAMPLETYPE_BYTES_RECEIVED = 202 + + +DESCRIPTOR.enum_types_by_name['KpiSampleType'] = _KPISAMPLETYPE +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + + +# @@protoc_insertion_point(module_scope) diff --git a/src/slice/proto/service_pb2.py b/src/slice/proto/service_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..8e2806c7685e24ab90a3d59a19f1e4f99ebc9712 --- /dev/null +++ b/src/slice/proto/service_pb2.py @@ -0,0 +1,78 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: service.proto +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from . import context_pb2 as context__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='service.proto', + package='service', + syntax='proto3', + serialized_options=None, + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n\rservice.proto\x12\x07service\x1a\rcontext.proto2\xb9\x01\n\x0eServiceService\x12\x37\n\rCreateService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x37\n\rUpdateService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rDeleteService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x62\x06proto3' + , + dependencies=[context__pb2.DESCRIPTOR,]) + + + +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + + + +_SERVICESERVICE = _descriptor.ServiceDescriptor( + name='ServiceService', + full_name='service.ServiceService', + file=DESCRIPTOR, + index=0, + serialized_options=None, + create_key=_descriptor._internal_create_key, + serialized_start=42, + serialized_end=227, + methods=[ + _descriptor.MethodDescriptor( + name='CreateService', + full_name='service.ServiceService.CreateService', + index=0, + containing_service=None, + input_type=context__pb2._SERVICE, + output_type=context__pb2._SERVICEID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='UpdateService', + full_name='service.ServiceService.UpdateService', + index=1, + containing_service=None, + input_type=context__pb2._SERVICE, + output_type=context__pb2._SERVICEID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='DeleteService', + full_name='service.ServiceService.DeleteService', + index=2, + containing_service=None, + input_type=context__pb2._SERVICEID, + output_type=context__pb2._EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), +]) +_sym_db.RegisterServiceDescriptor(_SERVICESERVICE) + +DESCRIPTOR.services_by_name['ServiceService'] = _SERVICESERVICE + +# @@protoc_insertion_point(module_scope) diff --git a/src/slice/proto/slice_pb2.py b/src/slice/proto/slice_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..1e2a5f31cbbfa8f0d8ca664301b85d9e28a15782 --- /dev/null +++ b/src/slice/proto/slice_pb2.py @@ -0,0 +1,78 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: slice.proto +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from . import context_pb2 as context__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='slice.proto', + package='slice', + syntax='proto3', + serialized_options=None, + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n\x0bslice.proto\x12\x05slice\x1a\rcontext.proto2\xa7\x01\n\x0cSliceService\x12\x31\n\x0b\x43reateSlice\x12\x0e.context.Slice\x1a\x10.context.SliceId\"\x00\x12\x31\n\x0bUpdateSlice\x12\x0e.context.Slice\x1a\x10.context.SliceId\"\x00\x12\x31\n\x0b\x44\x65leteSlice\x12\x10.context.SliceId\x1a\x0e.context.Empty\"\x00\x62\x06proto3' + , + dependencies=[context__pb2.DESCRIPTOR,]) + + + +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + + + +_SLICESERVICE = _descriptor.ServiceDescriptor( + name='SliceService', + full_name='slice.SliceService', + file=DESCRIPTOR, + index=0, + serialized_options=None, + create_key=_descriptor._internal_create_key, + serialized_start=38, + serialized_end=205, + methods=[ + _descriptor.MethodDescriptor( + name='CreateSlice', + full_name='slice.SliceService.CreateSlice', + index=0, + containing_service=None, + input_type=context__pb2._SLICE, + output_type=context__pb2._SLICEID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='UpdateSlice', + full_name='slice.SliceService.UpdateSlice', + index=1, + containing_service=None, + input_type=context__pb2._SLICE, + output_type=context__pb2._SLICEID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='DeleteSlice', + full_name='slice.SliceService.DeleteSlice', + index=2, + containing_service=None, + input_type=context__pb2._SLICEID, + output_type=context__pb2._EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), +]) +_sym_db.RegisterServiceDescriptor(_SLICESERVICE) + +DESCRIPTOR.services_by_name['SliceService'] = _SLICESERVICE + +# @@protoc_insertion_point(module_scope) diff --git a/src/slice/proto/slice_pb2_grpc.py b/src/slice/proto/slice_pb2_grpc.py new file mode 100644 index 0000000000000000000000000000000000000000..abc2d884f3a6fc45a530eb41b139190e24c258de --- /dev/null +++ b/src/slice/proto/slice_pb2_grpc.py @@ -0,0 +1,132 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc + +from . import context_pb2 as context__pb2 + + +class SliceServiceStub(object): + """Missing associated documentation comment in .proto file.""" + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.CreateSlice = channel.unary_unary( + '/slice.SliceService/CreateSlice', + request_serializer=context__pb2.Slice.SerializeToString, + response_deserializer=context__pb2.SliceId.FromString, + ) + self.UpdateSlice = channel.unary_unary( + '/slice.SliceService/UpdateSlice', + request_serializer=context__pb2.Slice.SerializeToString, + response_deserializer=context__pb2.SliceId.FromString, + ) + self.DeleteSlice = channel.unary_unary( + '/slice.SliceService/DeleteSlice', + request_serializer=context__pb2.SliceId.SerializeToString, + response_deserializer=context__pb2.Empty.FromString, + ) + + +class SliceServiceServicer(object): + """Missing associated documentation comment in .proto file.""" + + def CreateSlice(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def UpdateSlice(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def DeleteSlice(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_SliceServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + 'CreateSlice': grpc.unary_unary_rpc_method_handler( + servicer.CreateSlice, + request_deserializer=context__pb2.Slice.FromString, + response_serializer=context__pb2.SliceId.SerializeToString, + ), + 'UpdateSlice': grpc.unary_unary_rpc_method_handler( + servicer.UpdateSlice, + request_deserializer=context__pb2.Slice.FromString, + response_serializer=context__pb2.SliceId.SerializeToString, + ), + 'DeleteSlice': grpc.unary_unary_rpc_method_handler( + servicer.DeleteSlice, + request_deserializer=context__pb2.SliceId.FromString, + response_serializer=context__pb2.Empty.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'slice.SliceService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + + + # This class is part of an EXPERIMENTAL API. +class SliceService(object): + """Missing associated documentation comment in .proto file.""" + + @staticmethod + def CreateSlice(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/slice.SliceService/CreateSlice', + context__pb2.Slice.SerializeToString, + context__pb2.SliceId.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def UpdateSlice(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/slice.SliceService/UpdateSlice', + context__pb2.Slice.SerializeToString, + context__pb2.SliceId.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def DeleteSlice(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/slice.SliceService/DeleteSlice', + context__pb2.SliceId.SerializeToString, + context__pb2.Empty.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/src/slice/requirements.in b/src/slice/requirements.in new file mode 100644 index 0000000000000000000000000000000000000000..162ecde82a076fce597850ac8d71de3880c9a5eb --- /dev/null +++ b/src/slice/requirements.in @@ -0,0 +1,6 @@ +grpcio==1.43.0 +grpcio-health-checking==1.43.0 +prometheus-client==0.13.0 +protobuf==3.19.3 +pytest==6.2.5 +pytest-benchmark==3.4.1 diff --git a/src/slice/service/SliceService.py b/src/slice/service/SliceService.py new file mode 100644 index 0000000000000000000000000000000000000000..7121ae4676d63977953bb3f66cb0754c8d89de88 --- /dev/null +++ b/src/slice/service/SliceService.py @@ -0,0 +1,28 @@ +# 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. + +from common.Constants import ServiceNameEnum +from common.Settings import get_service_port_grpc +from common.tools.service.GenericGrpcService import GenericGrpcService +from slice.proto.slice_pb2_grpc import add_SliceServiceServicer_to_server +from slice.service.SliceServiceServicerImpl import SliceServiceServicerImpl + +class SliceService(GenericGrpcService): + def __init__(self, cls_name: str = __name__) -> None: + port = get_service_port_grpc(ServiceNameEnum.SLICE) + super().__init__(port, cls_name=cls_name) + self.slice_servicer = SliceServiceServicerImpl() + + def install_servicers(self): + add_SliceServiceServicer_to_server(self.slice_servicer, self.server) diff --git a/src/slice/service/SliceServiceServicerImpl.py b/src/slice/service/SliceServiceServicerImpl.py new file mode 100644 index 0000000000000000000000000000000000000000..eae45240066cb4f88fd095ac3966daa5a270d5f4 --- /dev/null +++ b/src/slice/service/SliceServiceServicerImpl.py @@ -0,0 +1,134 @@ +# 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. + +import grpc, json, logging +from common.rpc_method_wrapper.Decorator import create_metrics, safe_and_metered_rpc_method +from context.client.ContextClient import ContextClient +from context.proto.context_pb2 import ( + ConfigActionEnum, Empty, Service, ServiceStatusEnum, ServiceTypeEnum, Slice, SliceId, SliceStatusEnum) +from interdomain.client.InterdomainClient import InterdomainClient +from service.client.ServiceClient import ServiceClient +from slice.proto.slice_pb2_grpc import SliceServiceServicer + +LOGGER = logging.getLogger(__name__) + +SERVICE_NAME = 'Slice' +METHOD_NAMES = ['CreateSlice', 'UpdateSlice', 'DeleteSlice'] +METRICS = create_metrics(SERVICE_NAME, METHOD_NAMES) + +class SliceServiceServicerImpl(SliceServiceServicer): + def __init__(self): + LOGGER.debug('Creating Servicer...') + LOGGER.debug('Servicer Created') + + def create_update(self, request : Slice) -> SliceId: + context_client = ContextClient() + + slice_id = context_client.SetSlice(request) + if len(request.slice_endpoint_ids) != 2: return slice_id + + domains = set() + for slice_endpoint_id in request.slice_endpoint_ids: + device_uuid = slice_endpoint_id.device_id.device_uuid.uuid + domains.add(device_uuid.split('@')[1]) + + is_multi_domain = len(domains) == 2 + if is_multi_domain: + interdomain_client = InterdomainClient() + slice_id = interdomain_client.RequestSlice(request) + else: + # pylint: disable=no-member + service_request = Service() + service_request.service_id.context_id.context_uuid.uuid = request.slice_id.context_id.context_uuid.uuid + service_request.service_id.service_uuid.uuid = request.slice_id.slice_uuid.uuid + service_request.service_type = ServiceTypeEnum.SERVICETYPE_L3NM + service_request.service_status.service_status = ServiceStatusEnum.SERVICESTATUS_PLANNED + + service_client = ServiceClient() + service_reply = service_client.CreateService(service_request) + if service_reply != service_request.service_id: # pylint: disable=no-member + raise Exception('Service creation failed. Wrong Service Id was returned') + + config_rule = service_request.service_config.config_rules.add() + config_rule.action = ConfigActionEnum.CONFIGACTION_SET + config_rule.resource_key = '/settings' + config_rule.resource_value = json.dumps( + {'mtu': 1512, 'address_families': ['IPV4'], 'bgp_as': 65000, 'bgp_route_target': '65000:333'}, + sort_keys=True) + + for slice_endpoint_id in request.slice_endpoint_ids: + device_uuid = slice_endpoint_id.device_id.device_uuid.uuid + endpoint_uuid = slice_endpoint_id.endpoint_uuid.uuid + + endpoint_id = service_request.service_endpoint_ids.add() + endpoint_id.device_id.device_uuid.uuid = device_uuid + endpoint_id.endpoint_uuid.uuid = endpoint_uuid + + config_rule = service_request.service_config.config_rules.add() + config_rule.action = ConfigActionEnum.CONFIGACTION_SET + config_rule.resource_key = '/device[{:s}]/endpoint[{:s}]/settings'.format(device_uuid, endpoint_uuid) + config_rule.resource_value = json.dumps( + {'router_id': '0.0.0.0', 'route_distinguisher': '0:0', 'sub_interface_index': 0, 'vlan_id': 0, + 'address_ip': '0.0.0.0', 'address_prefix': 0}, + sort_keys=True) + + service_reply = service_client.UpdateService(service_request) + if service_reply != service_request.service_id: # pylint: disable=no-member + raise Exception('Service update failed. Wrong Service Id was returned') + + reply = Slice() + reply.CopyFrom(request) + slice_service_id = reply.slice_service_ids.add() + slice_service_id.CopyFrom(service_reply) + context_client.SetSlice(reply) + slice_id = reply.slice_id + + slice_ = context_client.GetSlice(slice_id) + slice_active = Slice() + slice_active.CopyFrom(slice_) + slice_active.slice_status.slice_status = SliceStatusEnum.SLICESTATUS_ACTIVE + context_client.SetSlice(slice_active) + return slice_id + + @safe_and_metered_rpc_method(METRICS, LOGGER) + def CreateSlice(self, request : Slice, context : grpc.ServicerContext) -> SliceId: + #try: + # slice_ = context_client.GetSlice(request.slice_id) + # slice_id = slice_.slice_id + #except grpc.RpcError: + # slice_id = context_client.SetSlice(request) + #return slice_id + return self.create_update(request) + + @safe_and_metered_rpc_method(METRICS, LOGGER) + def UpdateSlice(self, request : Slice, context : grpc.ServicerContext) -> SliceId: + #slice_id = context_client.SetSlice(request) + #if len(request.slice_endpoint_ids) != 2: return slice_id + # + #domains = set() + #for slice_endpoint_id in request.slice_endpoint_ids: + # device_uuid = slice_endpoint_id.device_id.device_uuid.uuid + # domains.add(device_uuid.split('@')[0]) + # + #is_multi_domain = len(domains) == 2 + #if is_multi_domain: + # interdomain_client = InterdomainClient() + # return interdomain_client.LookUpSlice(request) + #else: + # raise NotImplementedError('Slice should create local services for single domain slice') + return self.create_update(request) + + @safe_and_metered_rpc_method(METRICS, LOGGER) + def DeleteSlice(self, request : SliceId, context : grpc.ServicerContext) -> Empty: + return Empty() diff --git a/src/slice/service/__init__.py b/src/slice/service/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/slice/service/__init__.py @@ -0,0 +1,14 @@ +# 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. + diff --git a/src/slice/service/__main__.py b/src/slice/service/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..f77d86bffe9b722f414be4f85adcaf0ef2cc4a8e --- /dev/null +++ b/src/slice/service/__main__.py @@ -0,0 +1,65 @@ +# 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. + +import logging, signal, sys, threading +from prometheus_client import start_http_server +from common.Constants import ServiceNameEnum +from common.Settings import ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_log_level, get_metrics_port, wait_for_environment_variables +from .SliceService import SliceService + +terminate = threading.Event() +LOGGER : logging.Logger = None + +def signal_handler(signal, frame): # pylint: disable=redefined-outer-name + LOGGER.warning('Terminate signal received') + terminate.set() + +def main(): + global LOGGER # pylint: disable=global-statement + + log_level = get_log_level() + logging.basicConfig(level=log_level) + LOGGER = logging.getLogger(__name__) + + wait_for_environment_variables([ + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_HOST ), + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC), + get_env_var_name(ServiceNameEnum.SERVICE, ENVVAR_SUFIX_SERVICE_HOST ), + get_env_var_name(ServiceNameEnum.SERVICE, ENVVAR_SUFIX_SERVICE_PORT_GRPC), + ]) + + signal.signal(signal.SIGINT, signal_handler) + signal.signal(signal.SIGTERM, signal_handler) + + LOGGER.info('Starting...') + + # Start metrics server + metrics_port = get_metrics_port() + start_http_server(metrics_port) + + # Starting slice service + grpc_service = SliceService() + grpc_service.start() + + # Wait for Ctrl+C or termination signal + while not terminate.wait(timeout=0.1): pass + + LOGGER.info('Terminating...') + grpc_service.stop() + + LOGGER.info('Bye') + return 0 + +if __name__ == '__main__': + sys.exit(main()) diff --git a/src/slice/tests/__init__.py b/src/slice/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/slice/tests/__init__.py @@ -0,0 +1,14 @@ +# 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. + diff --git a/src/slice/tests/test_unitary.py b/src/slice/tests/test_unitary.py new file mode 100644 index 0000000000000000000000000000000000000000..1fd5a75b4dc1bb0192c8eeda6a0d452c0a9465dd --- /dev/null +++ b/src/slice/tests/test_unitary.py @@ -0,0 +1,49 @@ +# 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. + +import logging, os, pytest +from common.Constants import ServiceNameEnum +from common.Settings import ( + ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_service_port_grpc) +from slice.client.SliceClient import SliceClient +from slice.service.SliceService import SliceService + +LOCAL_HOST = '127.0.0.1' +MOCKSERVICE_PORT = 10000 +SLICE_SERVICE_PORT = MOCKSERVICE_PORT + get_service_port_grpc(ServiceNameEnum.SLICE) # avoid privileged ports +os.environ[get_env_var_name(ServiceNameEnum.SLICE, ENVVAR_SUFIX_SERVICE_HOST )] = str(LOCAL_HOST) +os.environ[get_env_var_name(ServiceNameEnum.SLICE, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(SLICE_SERVICE_PORT) + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +@pytest.fixture(scope='session') +def slice_service(): + _service = SliceService() + _service.start() + yield _service + _service.stop() + +@pytest.fixture(scope='session') +def slice_client(slice_service : SliceService): # pylint: disable=redefined-outer-name + _client = SliceClient() + yield _client + _client.close() + +#def test_add_device_wrong_attributes(slice_client : SliceClient): +# # should fail with slice uuid is empty +# with pytest.raises(grpc._channel._InactiveRpcError) as e: +# slice_client.CreateUpdateSlice(TransportSlice()) +# assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT +# assert e.value.details() == 'slice.slice_id.slice_id.uuid() string is empty.' diff --git a/src/tests/.gitlab-ci.yml b/src/tests/.gitlab-ci.yml index e663b09ec1d79a14f76d37a4ac906e534667ac26..6fcac64803e92b238eb1a63ce92814e67e3138ab 100644 --- a/src/tests/.gitlab-ci.yml +++ b/src/tests/.gitlab-ci.yml @@ -14,4 +14,5 @@ # include the individual .gitlab-ci.yml of each integration test include: - - local: '/src/tests/ofc22_bootstrap_monitor_l3vpn/.gitlab-ci.yml' + - local: '/src/tests/ofc22/.gitlab-ci.yml' + - local: '/src/tests/oeccpsc22/.gitlab-ci.yml' diff --git a/src/tests/oeccpsc22/README.md b/src/tests/oeccpsc22/README.md new file mode 100644 index 0000000000000000000000000000000000000000..42e0228a52bdf9dfc21bc0358b78fb98677ed458 --- /dev/null +++ b/src/tests/oeccpsc22/README.md @@ -0,0 +1,8 @@ +# OECC/PSC'22 Paper - Interdomain slices +This functional test reproduces the experiment in paper "... paper title ..." presented at OECC/PSC'22 conference +[OECC/PSC'22](... demo link ...). + +## Functional test folder +This functional test can be found in folder `./src/tests/oeccpsc22/`. A convenience alias `./oeccpsc22/` pointing to that folder has been defined. + +# TO BE WRITTEN diff --git a/src/tests/oeccpsc22/__init__.py b/src/tests/oeccpsc22/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/tests/oeccpsc22/__init__.py @@ -0,0 +1,14 @@ +# 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. + diff --git a/src/tests/oeccpsc22/deploy_in_kubernetes.sh b/src/tests/oeccpsc22/deploy_in_kubernetes.sh new file mode 100755 index 0000000000000000000000000000000000000000..426e07e1376207065b02db3205e46dd2cbe9a39d --- /dev/null +++ b/src/tests/oeccpsc22/deploy_in_kubernetes.sh @@ -0,0 +1,159 @@ +#!/bin/bash +# 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. + + +# OECC/PSC 22 deployment settings +export REGISTRY_IMAGE="" +export COMPONENTS="context device monitoring service slice interdomain compute" # webui +export IMAGE_TAG="oeccpsc22" +export K8S_HOSTNAME="kubernetes-master" +#export GRAFANA_PASSWORD="admin123+" + +# Constants +GITLAB_REPO_URL="registry.gitlab.com/teraflow-h2020/controller" +TMP_FOLDER="./tmp" + +# Create a tmp folder for files modified during the deployment +TMP_MANIFESTS_FOLDER="$TMP_FOLDER/manifests" +mkdir -p $TMP_MANIFESTS_FOLDER +TMP_LOGS_FOLDER="$TMP_FOLDER/logs" +mkdir -p $TMP_LOGS_FOLDER + +export K8S_NAMESPACE_1="oeccpsc22-1" +export K8S_NAMESPACE_2="oeccpsc22-2" + +export EXTRA_MANIFESTS_1="./oeccpsc22/expose_services_teraflow_1.yaml" +export EXTRA_MANIFESTS_2="./oeccpsc22/expose_services_teraflow_2.yaml" + +echo "Deleting and Creating new namespaces..." +kubectl delete namespace $K8S_NAMESPACE_1 $K8S_NAMESPACE_2 +kubectl create namespace $K8S_NAMESPACE_1 +kubectl create namespace $K8S_NAMESPACE_2 +printf "\n" + +echo "Creating secrets for InfluxDB..." +#TODO: make sure to change this when having a production deployment +kubectl create secret generic influxdb-secrets --namespace=$K8S_NAMESPACE_1 --from-literal=INFLUXDB_DB="monitoring" --from-literal=INFLUXDB_ADMIN_USER="teraflow" --from-literal=INFLUXDB_ADMIN_PASSWORD="teraflow" --from-literal=INFLUXDB_HTTP_AUTH_ENABLED="True" +kubectl create secret generic monitoring-secrets --namespace=$K8S_NAMESPACE_1 --from-literal=INFLUXDB_DATABASE="monitoring" --from-literal=INFLUXDB_USER="teraflow" --from-literal=INFLUXDB_PASSWORD="teraflow" --from-literal=INFLUXDB_HOSTNAME="localhost" + +kubectl create secret generic influxdb-secrets --namespace=$K8S_NAMESPACE_2 --from-literal=INFLUXDB_DB="monitoring" --from-literal=INFLUXDB_ADMIN_USER="teraflow" --from-literal=INFLUXDB_ADMIN_PASSWORD="teraflow" --from-literal=INFLUXDB_HTTP_AUTH_ENABLED="True" +kubectl create secret generic monitoring-secrets --namespace=$K8S_NAMESPACE_2 --from-literal=INFLUXDB_DATABASE="monitoring" --from-literal=INFLUXDB_USER="teraflow" --from-literal=INFLUXDB_PASSWORD="teraflow" --from-literal=INFLUXDB_HOSTNAME="localhost" +printf "\n" + +echo "Pulling/Updating Docker images..." +docker pull redis:6.2 +docker pull influxdb:1.8 +docker pull grafana/grafana:8.2.6 +printf "\n" + +echo "Deploying components..." +for COMPONENT in $COMPONENTS; do + echo "Processing '$COMPONENT' component..." + IMAGE_NAME="$COMPONENT:$IMAGE_TAG" + IMAGE_URL="$REGISTRY_IMAGE/$IMAGE_NAME" + + echo " Building Docker image..." + BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}.log" + + if [ "$COMPONENT" == "automation" ] || [ "$COMPONENT" == "policy" ]; then + docker build -t "$IMAGE_NAME" -f ./src/"$COMPONENT"/Dockerfile ./src/"$COMPONENT"/ > "$BUILD_LOG" + else + docker build -t "$IMAGE_NAME" -f ./src/"$COMPONENT"/Dockerfile ./src/ > "$BUILD_LOG" + fi + + if [ -n "$REGISTRY_IMAGE" ]; then + echo "Pushing Docker image to '$REGISTRY_IMAGE'..." + + TAG_LOG="$TMP_LOGS_FOLDER/tag_${COMPONENT}.log" + docker tag "$IMAGE_NAME" "$IMAGE_URL" > "$TAG_LOG" + + PUSH_LOG="$TMP_LOGS_FOLDER/push_${COMPONENT}.log" + docker push "$IMAGE_URL" > "$PUSH_LOG" + fi + + echo " Adapting '$COMPONENT' manifest file..." + MANIFEST="$TMP_MANIFESTS_FOLDER/${COMPONENT}service.yaml" + cp ./manifests/"${COMPONENT}"service.yaml "$MANIFEST" + VERSION=$(grep -i "${GITLAB_REPO_URL}/${COMPONENT}:" "$MANIFEST" | cut -d ":" -f3) + + if [ -n "$REGISTRY_IMAGE" ]; then + + sed -E -i "s#image: $GITLAB_REPO_URL/$COMPONENT:${VERSION}#image: $IMAGE_URL#g" "$MANIFEST" + sed -E -i "s#imagePullPolicy: .*#imagePullPolicy: Always#g" "$MANIFEST" + + else + sed -E -i "s#image: $GITLAB_REPO_URL/$COMPONENT:${VERSION}#image: $IMAGE_NAME#g" "$MANIFEST" + sed -E -i "s#imagePullPolicy: .*#imagePullPolicy: Never#g" "$MANIFEST" + fi + + echo " Deploying '$COMPONENT' component to Kubernetes $K8S_NAMESPACE_1..." + DEPLOY_LOG="$TMP_LOGS_FOLDER/push_${COMPONENT}_1.log" + kubectl --namespace $K8S_NAMESPACE_1 apply -f "$MANIFEST" > "$DEPLOY_LOG" + kubectl --namespace $K8S_NAMESPACE_1 scale deployment --replicas=0 ${COMPONENT}service >> "$DEPLOY_LOG" + kubectl --namespace $K8S_NAMESPACE_1 scale deployment --replicas=1 ${COMPONENT}service >> "$DEPLOY_LOG" + + echo " Deploying '$COMPONENT' component to Kubernetes $K8S_NAMESPACE_2..." + DEPLOY_LOG="$TMP_LOGS_FOLDER/push_${COMPONENT}_2.log" + kubectl --namespace $K8S_NAMESPACE_2 apply -f "$MANIFEST" > "$DEPLOY_LOG" + kubectl --namespace $K8S_NAMESPACE_2 scale deployment --replicas=0 ${COMPONENT}service >> "$DEPLOY_LOG" + kubectl --namespace $K8S_NAMESPACE_2 scale deployment --replicas=1 ${COMPONENT}service >> "$DEPLOY_LOG" + + printf "\n" +done + +echo "Deploying extra manifests to Kubernetes $K8S_NAMESPACE_1..." +for EXTRA_MANIFEST in $EXTRA_MANIFESTS_1; do + echo "Processing manifest '$EXTRA_MANIFEST'..." + kubectl --namespace $K8S_NAMESPACE_1 apply -f $EXTRA_MANIFEST + printf "\n" +done + +echo "Deploying extra manifests to Kubernetes $K8S_NAMESPACE_2..." +for EXTRA_MANIFEST in $EXTRA_MANIFESTS_2; do + echo "Processing manifest '$EXTRA_MANIFEST'..." + kubectl --namespace $K8S_NAMESPACE_2 apply -f $EXTRA_MANIFEST + printf "\n" +done + +# By now, leave this control here. Some component dependencies are not well handled +for COMPONENT in $COMPONENTS; do + echo "Waiting for '$COMPONENT' component in Kubernetes $K8S_NAMESPACE_1..." + kubectl wait --namespace $K8S_NAMESPACE_1 --for='condition=available' --timeout=300s deployment/${COMPONENT}service + printf "\n" + + echo "Waiting for '$COMPONENT' component in Kubernetes $K8S_NAMESPACE_2..." + kubectl wait --namespace $K8S_NAMESPACE_2 --for='condition=available' --timeout=300s deployment/${COMPONENT}service + printf "\n" +done + +if [[ "$COMPONENTS" == *"webui"* ]]; then + echo "Configuring WebUI DataStores and Dashboards..." + ./configure_dashboards.sh + printf "\n\n" +fi + +echo "Removing dangling docker images..." +docker images --filter="dangling=true" --quiet | xargs -r docker rmi +printf "\n" + +echo "Reporting Deployment in Kubernetes $K8S_NAMESPACE_1..." +kubectl --namespace $K8S_NAMESPACE_1 get all +printf "\n" + +echo "Reporting Deployment in Kubernetes $K8S_NAMESPACE_2..." +kubectl --namespace $K8S_NAMESPACE_2 get all +printf "\n" + +echo "Done!" diff --git a/src/tests/oeccpsc22/dump_logs.sh b/src/tests/oeccpsc22/dump_logs.sh new file mode 100755 index 0000000000000000000000000000000000000000..196002a5fd6b9b208046ba1e22f156f628f60f1d --- /dev/null +++ b/src/tests/oeccpsc22/dump_logs.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# 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. + +mkdir -p tmp/exec_logs/ + +kubectl --namespace oeccpsc22-1 logs deployment/computeservice -c server > tmp/exec_logs/d1_compute.log +kubectl --namespace oeccpsc22-1 logs deployment/contextservice -c server > tmp/exec_logs/d1_context.log +kubectl --namespace oeccpsc22-1 logs deployment/deviceservice -c server > tmp/exec_logs/d1_device.log +kubectl --namespace oeccpsc22-1 logs deployment/interdomainservice -c server > tmp/exec_logs/d1_interdomain.log +kubectl --namespace oeccpsc22-1 logs deployment/monitoringservice -c server > tmp/exec_logs/d1_monitoring.log +kubectl --namespace oeccpsc22-1 logs deployment/serviceservice -c server > tmp/exec_logs/d1_service.log +kubectl --namespace oeccpsc22-1 logs deployment/sliceservice -c server > tmp/exec_logs/d1_slice.log + +kubectl --namespace oeccpsc22-2 logs deployment/computeservice -c server > tmp/exec_logs/d2_compute.log +kubectl --namespace oeccpsc22-2 logs deployment/contextservice -c server > tmp/exec_logs/d2_context.log +kubectl --namespace oeccpsc22-2 logs deployment/deviceservice -c server > tmp/exec_logs/d2_device.log +kubectl --namespace oeccpsc22-2 logs deployment/interdomainservice -c server > tmp/exec_logs/d2_interdomain.log +kubectl --namespace oeccpsc22-2 logs deployment/monitoringservice -c server > tmp/exec_logs/d2_monitoring.log +kubectl --namespace oeccpsc22-2 logs deployment/serviceservice -c server > tmp/exec_logs/d2_service.log +kubectl --namespace oeccpsc22-2 logs deployment/sliceservice -c server > tmp/exec_logs/d2_slice.log diff --git a/src/tests/oeccpsc22/expose_services_teraflow_1.yaml b/src/tests/oeccpsc22/expose_services_teraflow_1.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f2b8de0b1629082eab1a5e638c0e712db47ed0bd --- /dev/null +++ b/src/tests/oeccpsc22/expose_services_teraflow_1.yaml @@ -0,0 +1,106 @@ +# 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: v1 +kind: Service +metadata: + name: remote-teraflow +spec: + type: ExternalName + externalName: interdomainservice.oeccpsc22-2.svc.cluster.local + ports: + - name: grpc + protocol: TCP + port: 10010 +--- +apiVersion: v1 +kind: Service +metadata: + name: contextservice-public + labels: + app: contextservice +spec: + type: NodePort + selector: + app: contextservice + ports: + - name: grpc + protocol: TCP + port: 1010 + targetPort: 1010 + nodePort: 30111 + - name: rest + protocol: TCP + port: 8080 + targetPort: 8080 + nodePort: 30001 + - name: redis + protocol: TCP + port: 6379 + targetPort: 6379 + nodePort: 30631 +--- +apiVersion: v1 +kind: Service +metadata: + name: deviceservice-public + labels: + app: deviceservice +spec: + type: NodePort + selector: + app: deviceservice + ports: + - name: grpc + protocol: TCP + port: 2020 + targetPort: 2020 + nodePort: 30221 +--- +apiVersion: v1 +kind: Service +metadata: + name: computeservice-public +spec: + type: NodePort + selector: + app: computeservice + ports: + - name: http + protocol: TCP + port: 8080 + targetPort: 8080 + nodePort: 30881 +--- +apiVersion: v1 +kind: Service +metadata: + name: webuiservice-public + labels: + app: webuiservice +spec: + type: NodePort + selector: + app: webuiservice + ports: + - name: http + protocol: TCP + port: 8004 + targetPort: 8004 + nodePort: 30801 + - name: grafana + protocol: TCP + port: 3000 + targetPort: 3000 + nodePort: 30301 diff --git a/src/tests/oeccpsc22/expose_services_teraflow_2.yaml b/src/tests/oeccpsc22/expose_services_teraflow_2.yaml new file mode 100644 index 0000000000000000000000000000000000000000..8254c00aa09c9e15a047fd60b6140c68ef1f0e52 --- /dev/null +++ b/src/tests/oeccpsc22/expose_services_teraflow_2.yaml @@ -0,0 +1,106 @@ +# 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: v1 +kind: Service +metadata: + name: remote-teraflow +spec: + type: ExternalName + externalName: interdomainservice.oeccpsc22-1.svc.cluster.local + ports: + - name: grpc + protocol: TCP + port: 10010 +--- +apiVersion: v1 +kind: Service +metadata: + name: contextservice-public + labels: + app: contextservice +spec: + type: NodePort + selector: + app: contextservice + ports: + - name: grpc + protocol: TCP + port: 1010 + targetPort: 1010 + nodePort: 30112 + - name: rest + protocol: TCP + port: 8080 + targetPort: 8080 + nodePort: 30002 + - name: redis + protocol: TCP + port: 6379 + targetPort: 6379 + nodePort: 30632 +--- +apiVersion: v1 +kind: Service +metadata: + name: deviceservice-public + labels: + app: deviceservice +spec: + type: NodePort + selector: + app: deviceservice + ports: + - name: grpc + protocol: TCP + port: 2020 + targetPort: 2020 + nodePort: 30222 +--- +apiVersion: v1 +kind: Service +metadata: + name: computeservice-public +spec: + type: NodePort + selector: + app: computeservice + ports: + - name: http + protocol: TCP + port: 8080 + targetPort: 8080 + nodePort: 30882 +--- +apiVersion: v1 +kind: Service +metadata: + name: webuiservice-public + labels: + app: webuiservice +spec: + type: NodePort + selector: + app: webuiservice + ports: + - name: http + protocol: TCP + port: 8004 + targetPort: 8004 + nodePort: 30802 + - name: grafana + protocol: TCP + port: 3000 + targetPort: 3000 + nodePort: 30302 diff --git a/src/tests/oeccpsc22/run_test_01_bootstrap.sh b/src/tests/oeccpsc22/run_test_01_bootstrap.sh new file mode 100755 index 0000000000000000000000000000000000000000..e8df6ffb67f6756f9f757ae12c6a438d0c609853 --- /dev/null +++ b/src/tests/oeccpsc22/run_test_01_bootstrap.sh @@ -0,0 +1,60 @@ +#!/bin/bash +# 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. + + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc +COVERAGEFILE=$PROJECTDIR/coverage/.coverage + +# Configure the correct folder on the .coveragerc file +cat $PROJECTDIR/coverage/.coveragerc.template | sed s+~/teraflow/controller+$PROJECTDIR+g > $RCFILE + +# Destroy old coverage file +rm -f $COVERAGEFILE + +# Set the name of the Kubernetes namespace and hostname to use. +K8S_NAMESPACE_D1="oeccpsc22-1" +K8S_NAMESPACE_D2="oeccpsc22-2" +# K8S_HOSTNAME="kubernetes-master" +# dynamically gets the name of the K8s master node +K8S_HOSTNAME=`kubectl get nodes --selector=node-role.kubernetes.io/master | tr -s " " | cut -f1 -d" " | sed -n '2 p'` + +# Flush Context database +kubectl --namespace $K8S_NAMESPACE_D1 exec -it deployment/contextservice --container redis -- redis-cli FLUSHALL +kubectl --namespace $K8S_NAMESPACE_D2 exec -it deployment/contextservice --container redis -- redis-cli FLUSHALL + +export D1_CONTEXTSERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D1_CONTEXTSERVICE_SERVICE_PORT_GRPC=$(kubectl get service contextservice-public --namespace $K8S_NAMESPACE_D1 -o 'jsonpath={.spec.ports[?(@.port==1010)].nodePort}') +export D1_DEVICESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D1_DEVICESERVICE_SERVICE_PORT_GRPC=$(kubectl get service deviceservice-public --namespace $K8S_NAMESPACE_D1 -o 'jsonpath={.spec.ports[?(@.port==2020)].nodePort}') +export D1_COMPUTESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D1_COMPUTESERVICE_SERVICE_PORT_HTTP=$(kubectl get service computeservice-public --namespace $K8S_NAMESPACE_D1 -o 'jsonpath={.spec.ports[?(@.port==8080)].nodePort}') + +export D2_CONTEXTSERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D2_CONTEXTSERVICE_SERVICE_PORT_GRPC=$(kubectl get service contextservice-public --namespace $K8S_NAMESPACE_D2 -o 'jsonpath={.spec.ports[?(@.port==1010)].nodePort}') +export D2_DEVICESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D2_DEVICESERVICE_SERVICE_PORT_GRPC=$(kubectl get service deviceservice-public --namespace $K8S_NAMESPACE_D2 -o 'jsonpath={.spec.ports[?(@.port==2020)].nodePort}') +export D2_COMPUTESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D2_COMPUTESERVICE_SERVICE_PORT_HTTP=$(kubectl get service computeservice-public --namespace $K8S_NAMESPACE_D2 -o 'jsonpath={.spec.ports[?(@.port==8080)].nodePort}') + +# Useful flags for pytest: +#-o log_cli=true -o log_file=device.log -o log_file_level=DEBUG + +# Run functional test and analyze coverage of code at same time + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + tests/oeccpsc22/tests/test_functional_bootstrap.py diff --git a/src/tests/oeccpsc22/run_test_02_create_interdomain_slice.sh b/src/tests/oeccpsc22/run_test_02_create_interdomain_slice.sh new file mode 100755 index 0000000000000000000000000000000000000000..b9ab66cb343b31f34b394b00ff7fcabdac22e8d3 --- /dev/null +++ b/src/tests/oeccpsc22/run_test_02_create_interdomain_slice.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# 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. + + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc +COVERAGEFILE=$PROJECTDIR/coverage/.coverage + +# Set the name of the Kubernetes namespace and hostname to use. +K8S_NAMESPACE_D1="oeccpsc22-1" +K8S_NAMESPACE_D2="oeccpsc22-2" +# dynamically gets the name of the K8s master node +K8S_HOSTNAME=`kubectl get nodes --selector=node-role.kubernetes.io/master | tr -s " " | cut -f1 -d" " | sed -n '2 p'` + +export D1_CONTEXTSERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D1_CONTEXTSERVICE_SERVICE_PORT_GRPC=$(kubectl get service contextservice-public --namespace $K8S_NAMESPACE_D1 -o 'jsonpath={.spec.ports[?(@.port==1010)].nodePort}') +export D1_DEVICESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D1_DEVICESERVICE_SERVICE_PORT_GRPC=$(kubectl get service deviceservice-public --namespace $K8S_NAMESPACE_D1 -o 'jsonpath={.spec.ports[?(@.port==2020)].nodePort}') +export D1_COMPUTESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D1_COMPUTESERVICE_SERVICE_PORT_HTTP=$(kubectl get service computeservice-public --namespace $K8S_NAMESPACE_D1 -o 'jsonpath={.spec.ports[?(@.port==8080)].nodePort}') + +export D2_CONTEXTSERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D2_CONTEXTSERVICE_SERVICE_PORT_GRPC=$(kubectl get service contextservice-public --namespace $K8S_NAMESPACE_D2 -o 'jsonpath={.spec.ports[?(@.port==1010)].nodePort}') +export D2_DEVICESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D2_DEVICESERVICE_SERVICE_PORT_GRPC=$(kubectl get service deviceservice-public --namespace $K8S_NAMESPACE_D2 -o 'jsonpath={.spec.ports[?(@.port==2020)].nodePort}') +export D2_COMPUTESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D2_COMPUTESERVICE_SERVICE_PORT_HTTP=$(kubectl get service computeservice-public --namespace $K8S_NAMESPACE_D2 -o 'jsonpath={.spec.ports[?(@.port==8080)].nodePort}') + +# Useful flags for pytest: +#-o log_cli=true -o log_file=device.log -o log_file_level=DEBUG + +# Run functional test and analyze coverage of code at same time + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + tests/oeccpsc22/tests/test_functional_create_interdomain_slice.py diff --git a/src/tests/oeccpsc22/run_test_03_delete_interdomain_slice.sh b/src/tests/oeccpsc22/run_test_03_delete_interdomain_slice.sh new file mode 100755 index 0000000000000000000000000000000000000000..b0080ce3759badc047bf218ab9a13c1bea722115 --- /dev/null +++ b/src/tests/oeccpsc22/run_test_03_delete_interdomain_slice.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# 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. + + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc +COVERAGEFILE=$PROJECTDIR/coverage/.coverage + +# Set the name of the Kubernetes namespace and hostname to use. +K8S_NAMESPACE_D1="oeccpsc22-1" +K8S_NAMESPACE_D2="oeccpsc22-2" +# dynamically gets the name of the K8s master node +K8S_HOSTNAME=`kubectl get nodes --selector=node-role.kubernetes.io/master | tr -s " " | cut -f1 -d" " | sed -n '2 p'` + +export D1_CONTEXTSERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D1_CONTEXTSERVICE_SERVICE_PORT_GRPC=$(kubectl get service contextservice-public --namespace $K8S_NAMESPACE_D1 -o 'jsonpath={.spec.ports[?(@.port==1010)].nodePort}') +export D1_DEVICESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D1_DEVICESERVICE_SERVICE_PORT_GRPC=$(kubectl get service deviceservice-public --namespace $K8S_NAMESPACE_D1 -o 'jsonpath={.spec.ports[?(@.port==2020)].nodePort}') +export D1_COMPUTESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D1_COMPUTESERVICE_SERVICE_PORT_HTTP=$(kubectl get service computeservice-public --namespace $K8S_NAMESPACE_D1 -o 'jsonpath={.spec.ports[?(@.port==8080)].nodePort}') + +export D2_CONTEXTSERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D2_CONTEXTSERVICE_SERVICE_PORT_GRPC=$(kubectl get service contextservice-public --namespace $K8S_NAMESPACE_D2 -o 'jsonpath={.spec.ports[?(@.port==1010)].nodePort}') +export D2_DEVICESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D2_DEVICESERVICE_SERVICE_PORT_GRPC=$(kubectl get service deviceservice-public --namespace $K8S_NAMESPACE_D2 -o 'jsonpath={.spec.ports[?(@.port==2020)].nodePort}') +export D2_COMPUTESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D2_COMPUTESERVICE_SERVICE_PORT_HTTP=$(kubectl get service computeservice-public --namespace $K8S_NAMESPACE_D2 -o 'jsonpath={.spec.ports[?(@.port==8080)].nodePort}') + +# Useful flags for pytest: +#-o log_cli=true -o log_file=device.log -o log_file_level=DEBUG + +# Run functional test and analyze coverage of code at same time + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + tests/oeccpsc22/tests/test_functional_delete_interdomain_slice.py diff --git a/src/tests/oeccpsc22/run_test_04_cleanup.sh b/src/tests/oeccpsc22/run_test_04_cleanup.sh new file mode 100755 index 0000000000000000000000000000000000000000..d0420820c487862e5faa469dc4000dda3da71be6 --- /dev/null +++ b/src/tests/oeccpsc22/run_test_04_cleanup.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# 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. + + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc +COVERAGEFILE=$PROJECTDIR/coverage/.coverage + +# Set the name of the Kubernetes namespace and hostname to use. +K8S_NAMESPACE_D1="oeccpsc22-1" +K8S_NAMESPACE_D2="oeccpsc22-2" +# dynamically gets the name of the K8s master node +K8S_HOSTNAME=`kubectl get nodes --selector=node-role.kubernetes.io/master | tr -s " " | cut -f1 -d" " | sed -n '2 p'` + +export D1_CONTEXTSERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D1_CONTEXTSERVICE_SERVICE_PORT_GRPC=$(kubectl get service contextservice-public --namespace $K8S_NAMESPACE_D1 -o 'jsonpath={.spec.ports[?(@.port==1010)].nodePort}') +export D1_DEVICESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D1_DEVICESERVICE_SERVICE_PORT_GRPC=$(kubectl get service deviceservice-public --namespace $K8S_NAMESPACE_D1 -o 'jsonpath={.spec.ports[?(@.port==2020)].nodePort}') +export D1_COMPUTESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D1_COMPUTESERVICE_SERVICE_PORT_HTTP=$(kubectl get service computeservice-public --namespace $K8S_NAMESPACE_D1 -o 'jsonpath={.spec.ports[?(@.port==8080)].nodePort}') + +export D2_CONTEXTSERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D2_CONTEXTSERVICE_SERVICE_PORT_GRPC=$(kubectl get service contextservice-public --namespace $K8S_NAMESPACE_D2 -o 'jsonpath={.spec.ports[?(@.port==1010)].nodePort}') +export D2_DEVICESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D2_DEVICESERVICE_SERVICE_PORT_GRPC=$(kubectl get service deviceservice-public --namespace $K8S_NAMESPACE_D2 -o 'jsonpath={.spec.ports[?(@.port==2020)].nodePort}') +export D2_COMPUTESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D2_COMPUTESERVICE_SERVICE_PORT_HTTP=$(kubectl get service computeservice-public --namespace $K8S_NAMESPACE_D2 -o 'jsonpath={.spec.ports[?(@.port==8080)].nodePort}') + +# Useful flags for pytest: +#-o log_cli=true -o log_file=device.log -o log_file_level=DEBUG + +# Run functional test and analyze coverage of code at same time + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + tests/oeccpsc22/tests/test_functional_cleanup.py diff --git a/src/tests/oeccpsc22/show_deploy.sh b/src/tests/oeccpsc22/show_deploy.sh new file mode 100755 index 0000000000000000000000000000000000000000..90d6914890cfd37db37ed3b3ea8266372c067c20 --- /dev/null +++ b/src/tests/oeccpsc22/show_deploy.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# 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. + +# Deploy TeraFlow instance 1 +printf "TeraFlow Instance 1:\n--------------------\n" +export K8S_NAMESPACE="oeccpsc22-1" +kubectl --namespace $K8S_NAMESPACE get all + +printf "\n\n" + +# Deploy TeraFlow instance 2 +printf "TeraFlow Instance 2:\n--------------------\n" +export K8S_NAMESPACE="oeccpsc22-2" +kubectl --namespace $K8S_NAMESPACE get all diff --git a/src/tests/oeccpsc22/tests/.gitignore b/src/tests/oeccpsc22/tests/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..76cb708d1b532c9b69166e55f36bcb912fd5e370 --- /dev/null +++ b/src/tests/oeccpsc22/tests/.gitignore @@ -0,0 +1,2 @@ +# Add here your files containing confidential testbed details such as IP addresses, ports, usernames, passwords, etc. +Credentials.py diff --git a/src/tests/oeccpsc22/tests/Objects_Domain_1.py b/src/tests/oeccpsc22/tests/Objects_Domain_1.py new file mode 100644 index 0000000000000000000000000000000000000000..8b26348c94b827e4e418a458f21b28a863c4cb68 --- /dev/null +++ b/src/tests/oeccpsc22/tests/Objects_Domain_1.py @@ -0,0 +1,133 @@ +# 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. + +from common.Constants import DEFAULT_CONTEXT_UUID, DEFAULT_TOPOLOGY_UUID +from common.tools.object_factory.Context import json_context, json_context_id +from common.tools.object_factory.Device import ( + json_device_emulated_connect_rules, json_device_emulated_packet_router_disabled, json_device_id) +from common.tools.object_factory.Link import json_link, json_link_id +from common.tools.object_factory.Topology import json_topology, json_topology_id +from .Tools import get_link_uuid, json_endpoint_ids + +# ----- Context -------------------------------------------------------------------------------------------------------- +D1_CONTEXT_ID = json_context_id(DEFAULT_CONTEXT_UUID) +D1_CONTEXT = json_context(DEFAULT_CONTEXT_UUID) + +# ----- Topology ------------------------------------------------------------------------------------------------------- +D1_TOPOLOGY_ID = json_topology_id(DEFAULT_TOPOLOGY_UUID, context_id=D1_CONTEXT_ID) +D1_TOPOLOGY = json_topology(DEFAULT_TOPOLOGY_UUID, context_id=D1_CONTEXT_ID) + +# ----- Devices -------------------------------------------------------------------------------------------------------- +# Assume all devices have the same architecture of endpoints +D1_DEVICE_ENDPOINT_DEFS = [ + # Trunk ports + ('1/1', '25Gbps', []), ('1/2', '25Gbps', []), ('1/3', '25Gbps', []), ('1/4', '25Gbps', []), + # Inter-domain ports + ('2/1', '100Gbps', []), ('2/2', '100Gbps', []), + # Access ports + ('3/1', '10Gbps', []), ('3/2', '10Gbps', []), ('3/3', '10Gbps', []), ('3/4', '10Gbps', []), + ('3/5', '10Gbps', []), ('3/6', '10Gbps', []), ('3/7', '10Gbps', []), ('3/8', '10Gbps', []), +] + +D1_DEVICE_D1R1_UUID = 'R1@D1' +D1_DEVICE_D1R1_ID = json_device_id(D1_DEVICE_D1R1_UUID) +D1_DEVICE_D1R1 = json_device_emulated_packet_router_disabled(D1_DEVICE_D1R1_UUID) +D1_DEVICE_D1R1_CONNECT_RULES = json_device_emulated_connect_rules(D1_DEVICE_ENDPOINT_DEFS) + +D1_DEVICE_D1R2_UUID = 'R2@D1' +D1_DEVICE_D1R2_ID = json_device_id(D1_DEVICE_D1R2_UUID) +D1_DEVICE_D1R2 = json_device_emulated_packet_router_disabled(D1_DEVICE_D1R2_UUID) +D1_DEVICE_D1R2_CONNECT_RULES = json_device_emulated_connect_rules(D1_DEVICE_ENDPOINT_DEFS) + +D1_DEVICE_D1R3_UUID = 'R3@D1' +D1_DEVICE_D1R3_ID = json_device_id(D1_DEVICE_D1R3_UUID) +D1_DEVICE_D1R3 = json_device_emulated_packet_router_disabled(D1_DEVICE_D1R3_UUID) +D1_DEVICE_D1R3_CONNECT_RULES = json_device_emulated_connect_rules(D1_DEVICE_ENDPOINT_DEFS) + +D1_DEVICE_D1R4_UUID = 'R4@D1' +D1_DEVICE_D1R4_ID = json_device_id(D1_DEVICE_D1R4_UUID) +D1_DEVICE_D1R4 = json_device_emulated_packet_router_disabled(D1_DEVICE_D1R4_UUID) +D1_DEVICE_D1R4_CONNECT_RULES = json_device_emulated_connect_rules(D1_DEVICE_ENDPOINT_DEFS) + +# Virtual devices on remote domains +D1_DEVICE_D2R1_UUID = 'R1@D2' +D1_DEVICE_D2R1_ID = json_device_id(D1_DEVICE_D2R1_UUID) +D1_DEVICE_D2R1 = json_device_emulated_packet_router_disabled(D1_DEVICE_D2R1_UUID) +D1_DEVICE_D2R1_CONNECT_RULES = json_device_emulated_connect_rules(D1_DEVICE_ENDPOINT_DEFS) + +D1_DEVICE_D2R4_UUID = 'R4@D2' +D1_DEVICE_D2R4_ID = json_device_id(D1_DEVICE_D2R4_UUID) +D1_DEVICE_D2R4 = json_device_emulated_packet_router_disabled(D1_DEVICE_D2R4_UUID) +D1_DEVICE_D2R4_CONNECT_RULES = json_device_emulated_connect_rules(D1_DEVICE_ENDPOINT_DEFS) + +D1_ENDPOINT_IDS = {} +D1_ENDPOINT_IDS.update(json_endpoint_ids(D1_DEVICE_D1R1_ID, D1_DEVICE_ENDPOINT_DEFS)) +D1_ENDPOINT_IDS.update(json_endpoint_ids(D1_DEVICE_D1R2_ID, D1_DEVICE_ENDPOINT_DEFS)) +D1_ENDPOINT_IDS.update(json_endpoint_ids(D1_DEVICE_D1R3_ID, D1_DEVICE_ENDPOINT_DEFS)) +D1_ENDPOINT_IDS.update(json_endpoint_ids(D1_DEVICE_D1R4_ID, D1_DEVICE_ENDPOINT_DEFS)) +D1_ENDPOINT_IDS.update(json_endpoint_ids(D1_DEVICE_D2R1_ID, D1_DEVICE_ENDPOINT_DEFS)) +D1_ENDPOINT_IDS.update(json_endpoint_ids(D1_DEVICE_D2R4_ID, D1_DEVICE_ENDPOINT_DEFS)) + + +# ----- Links ---------------------------------------------------------------------------------------------------------- +# Intra-domain links +D1_LINK_D1R1_D1R2_UUID = get_link_uuid( + D1_ENDPOINT_IDS[D1_DEVICE_D1R1_UUID]['1/2'], D1_ENDPOINT_IDS[D1_DEVICE_D1R2_UUID]['1/1']) +D1_LINK_D1R1_D1R2_ID = json_link_id(D1_LINK_D1R1_D1R2_UUID) +D1_LINK_D1R1_D1R2 = json_link(D1_LINK_D1R1_D1R2_UUID, [ + D1_ENDPOINT_IDS[D1_DEVICE_D1R1_UUID]['1/2'], D1_ENDPOINT_IDS[D1_DEVICE_D1R2_UUID]['1/1']]) + +D1_LINK_D1R2_D1R3_UUID = get_link_uuid( + D1_ENDPOINT_IDS[D1_DEVICE_D1R2_UUID]['1/2'], D1_ENDPOINT_IDS[D1_DEVICE_D1R3_UUID]['1/1']) +D1_LINK_D1R2_D1R3_ID = json_link_id(D1_LINK_D1R2_D1R3_UUID) +D1_LINK_D1R2_D1R3 = json_link(D1_LINK_D1R2_D1R3_UUID, [ + D1_ENDPOINT_IDS[D1_DEVICE_D1R2_UUID]['1/2'], D1_ENDPOINT_IDS[D1_DEVICE_D1R3_UUID]['1/1']]) + +D1_LINK_D1R3_D1R4_UUID = get_link_uuid( + D1_ENDPOINT_IDS[D1_DEVICE_D1R3_UUID]['1/2'], D1_ENDPOINT_IDS[D1_DEVICE_D1R4_UUID]['1/1']) +D1_LINK_D1R3_D1R4_ID = json_link_id(D1_LINK_D1R3_D1R4_UUID) +D1_LINK_D1R3_D1R4 = json_link(D1_LINK_D1R3_D1R4_UUID, [ + D1_ENDPOINT_IDS[D1_DEVICE_D1R3_UUID]['1/2'], D1_ENDPOINT_IDS[D1_DEVICE_D1R4_UUID]['1/1']]) + +D1_LINK_D1R4_D1R1_UUID = get_link_uuid( + D1_ENDPOINT_IDS[D1_DEVICE_D1R4_UUID]['1/2'], D1_ENDPOINT_IDS[D1_DEVICE_D1R1_UUID]['1/1']) +D1_LINK_D1R4_D1R1_ID = json_link_id(D1_LINK_D1R4_D1R1_UUID) +D1_LINK_D1R4_D1R1 = json_link(D1_LINK_D1R4_D1R1_UUID, [ + D1_ENDPOINT_IDS[D1_DEVICE_D1R4_UUID]['1/2'], D1_ENDPOINT_IDS[D1_DEVICE_D1R1_UUID]['1/1']]) + +# Inter-domain links +D1_LINK_D1R4_D2R1_UUID = get_link_uuid( + D1_ENDPOINT_IDS[D1_DEVICE_D1R4_UUID]['2/1'], D1_ENDPOINT_IDS[D1_DEVICE_D2R1_UUID]['2/1']) +D1_LINK_D1R4_D2R1_ID = json_link_id(D1_LINK_D1R4_D2R1_UUID) +D1_LINK_D1R4_D2R1 = json_link(D1_LINK_D1R4_D2R1_UUID, [ + D1_ENDPOINT_IDS[D1_DEVICE_D1R4_UUID]['2/1'], D1_ENDPOINT_IDS[D1_DEVICE_D2R1_UUID]['2/1']]) + +# ----- Object Collections --------------------------------------------------------------------------------------------- + +D1_CONTEXTS = [D1_CONTEXT] +D1_TOPOLOGIES = [D1_TOPOLOGY] + +D1_DEVICES = [ + (D1_DEVICE_D1R1, D1_DEVICE_D1R1_CONNECT_RULES), + (D1_DEVICE_D1R2, D1_DEVICE_D1R2_CONNECT_RULES), + (D1_DEVICE_D1R3, D1_DEVICE_D1R3_CONNECT_RULES), + (D1_DEVICE_D1R4, D1_DEVICE_D1R4_CONNECT_RULES), + (D1_DEVICE_D2R1, D1_DEVICE_D2R1_CONNECT_RULES), + (D1_DEVICE_D2R4, D1_DEVICE_D2R4_CONNECT_RULES), +] + +D1_LINKS = [ + D1_LINK_D1R1_D1R2, D1_LINK_D1R2_D1R3, D1_LINK_D1R3_D1R4, D1_LINK_D1R4_D1R1, + D1_LINK_D1R4_D2R1, +] diff --git a/src/tests/oeccpsc22/tests/Objects_Domain_2.py b/src/tests/oeccpsc22/tests/Objects_Domain_2.py new file mode 100644 index 0000000000000000000000000000000000000000..f9133809243effc0a7d22c953046a4af4d6bad3e --- /dev/null +++ b/src/tests/oeccpsc22/tests/Objects_Domain_2.py @@ -0,0 +1,133 @@ +# 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. + +from common.Constants import DEFAULT_CONTEXT_UUID, DEFAULT_TOPOLOGY_UUID +from common.tools.object_factory.Context import json_context, json_context_id +from common.tools.object_factory.Device import ( + json_device_emulated_connect_rules, json_device_emulated_packet_router_disabled, json_device_id) +from common.tools.object_factory.Link import json_link, json_link_id +from common.tools.object_factory.Topology import json_topology, json_topology_id +from .Tools import get_link_uuid, json_endpoint_ids + +# ----- Context -------------------------------------------------------------------------------------------------------- +D2_CONTEXT_ID = json_context_id(DEFAULT_CONTEXT_UUID) +D2_CONTEXT = json_context(DEFAULT_CONTEXT_UUID) + +# ----- Topology ------------------------------------------------------------------------------------------------------- +D2_TOPOLOGY_ID = json_topology_id(DEFAULT_TOPOLOGY_UUID, context_id=D2_CONTEXT_ID) +D2_TOPOLOGY = json_topology(DEFAULT_TOPOLOGY_UUID, context_id=D2_CONTEXT_ID) + +# ----- Devices -------------------------------------------------------------------------------------------------------- +# Assume all devices have the same architecture of endpoints +D2_DEVICE_ENDPOINT_DEFS = [ + # Trunk ports + ('1/1', '25Gbps', []), ('1/2', '25Gbps', []), ('1/3', '25Gbps', []), ('1/4', '25Gbps', []), + # Inter-domain ports + ('2/1', '100Gbps', []), ('2/2', '100Gbps', []), + # Access ports + ('3/1', '10Gbps', []), ('3/2', '10Gbps', []), ('3/3', '10Gbps', []), ('3/4', '10Gbps', []), + ('3/5', '10Gbps', []), ('3/6', '10Gbps', []), ('3/7', '10Gbps', []), ('3/8', '10Gbps', []), +] + +D2_DEVICE_D2R1_UUID = 'R1@D2' +D2_DEVICE_D2R1_ID = json_device_id(D2_DEVICE_D2R1_UUID) +D2_DEVICE_D2R1 = json_device_emulated_packet_router_disabled(D2_DEVICE_D2R1_UUID) +D2_DEVICE_D2R1_CONNECT_RULES = json_device_emulated_connect_rules(D2_DEVICE_ENDPOINT_DEFS) + +D2_DEVICE_D2R2_UUID = 'R2@D2' +D2_DEVICE_D2R2_ID = json_device_id(D2_DEVICE_D2R2_UUID) +D2_DEVICE_D2R2 = json_device_emulated_packet_router_disabled(D2_DEVICE_D2R2_UUID) +D2_DEVICE_D2R2_CONNECT_RULES = json_device_emulated_connect_rules(D2_DEVICE_ENDPOINT_DEFS) + +D2_DEVICE_D2R3_UUID = 'R3@D2' +D2_DEVICE_D2R3_ID = json_device_id(D2_DEVICE_D2R3_UUID) +D2_DEVICE_D2R3 = json_device_emulated_packet_router_disabled(D2_DEVICE_D2R3_UUID) +D2_DEVICE_D2R3_CONNECT_RULES = json_device_emulated_connect_rules(D2_DEVICE_ENDPOINT_DEFS) + +D2_DEVICE_D2R4_UUID = 'R4@D2' +D2_DEVICE_D2R4_ID = json_device_id(D2_DEVICE_D2R4_UUID) +D2_DEVICE_D2R4 = json_device_emulated_packet_router_disabled(D2_DEVICE_D2R4_UUID) +D2_DEVICE_D2R4_CONNECT_RULES = json_device_emulated_connect_rules(D2_DEVICE_ENDPOINT_DEFS) + +# Virtual devices on remote domains +D2_DEVICE_D1R1_UUID = 'R1@D1' +D2_DEVICE_D1R1_ID = json_device_id(D2_DEVICE_D1R1_UUID) +D2_DEVICE_D1R1 = json_device_emulated_packet_router_disabled(D2_DEVICE_D1R1_UUID) +D2_DEVICE_D1R1_CONNECT_RULES = json_device_emulated_connect_rules(D2_DEVICE_ENDPOINT_DEFS) + +D2_DEVICE_D1R4_UUID = 'R4@D1' +D2_DEVICE_D1R4_ID = json_device_id(D2_DEVICE_D1R4_UUID) +D2_DEVICE_D1R4 = json_device_emulated_packet_router_disabled(D2_DEVICE_D1R4_UUID) +D2_DEVICE_D1R4_CONNECT_RULES = json_device_emulated_connect_rules(D2_DEVICE_ENDPOINT_DEFS) + +D2_ENDPOINT_IDS = {} +D2_ENDPOINT_IDS.update(json_endpoint_ids(D2_DEVICE_D2R1_ID, D2_DEVICE_ENDPOINT_DEFS)) +D2_ENDPOINT_IDS.update(json_endpoint_ids(D2_DEVICE_D2R2_ID, D2_DEVICE_ENDPOINT_DEFS)) +D2_ENDPOINT_IDS.update(json_endpoint_ids(D2_DEVICE_D2R3_ID, D2_DEVICE_ENDPOINT_DEFS)) +D2_ENDPOINT_IDS.update(json_endpoint_ids(D2_DEVICE_D2R4_ID, D2_DEVICE_ENDPOINT_DEFS)) +D2_ENDPOINT_IDS.update(json_endpoint_ids(D2_DEVICE_D1R1_ID, D2_DEVICE_ENDPOINT_DEFS)) +D2_ENDPOINT_IDS.update(json_endpoint_ids(D2_DEVICE_D1R4_ID, D2_DEVICE_ENDPOINT_DEFS)) + + +# ----- Links ---------------------------------------------------------------------------------------------------------- +# Intra-domain links +D2_LINK_D2R1_D2R2_UUID = get_link_uuid( + D2_ENDPOINT_IDS[D2_DEVICE_D2R1_UUID]['1/2'], D2_ENDPOINT_IDS[D2_DEVICE_D2R2_UUID]['1/1']) +D2_LINK_D2R1_D2R2_ID = json_link_id(D2_LINK_D2R1_D2R2_UUID) +D2_LINK_D2R1_D2R2 = json_link(D2_LINK_D2R1_D2R2_UUID, [ + D2_ENDPOINT_IDS[D2_DEVICE_D2R1_UUID]['1/2'], D2_ENDPOINT_IDS[D2_DEVICE_D2R2_UUID]['1/1']]) + +D2_LINK_D2R2_D2R3_UUID = get_link_uuid( + D2_ENDPOINT_IDS[D2_DEVICE_D2R2_UUID]['1/2'], D2_ENDPOINT_IDS[D2_DEVICE_D2R3_UUID]['1/1']) +D2_LINK_D2R2_D2R3_ID = json_link_id(D2_LINK_D2R2_D2R3_UUID) +D2_LINK_D2R2_D2R3 = json_link(D2_LINK_D2R2_D2R3_UUID, [ + D2_ENDPOINT_IDS[D2_DEVICE_D2R2_UUID]['1/2'], D2_ENDPOINT_IDS[D2_DEVICE_D2R3_UUID]['1/1']]) + +D2_LINK_D2R3_D2R4_UUID = get_link_uuid( + D2_ENDPOINT_IDS[D2_DEVICE_D2R3_UUID]['1/2'], D2_ENDPOINT_IDS[D2_DEVICE_D2R4_UUID]['1/1']) +D2_LINK_D2R3_D2R4_ID = json_link_id(D2_LINK_D2R3_D2R4_UUID) +D2_LINK_D2R3_D2R4 = json_link(D2_LINK_D2R3_D2R4_UUID, [ + D2_ENDPOINT_IDS[D2_DEVICE_D2R3_UUID]['1/2'], D2_ENDPOINT_IDS[D2_DEVICE_D2R4_UUID]['1/1']]) + +D2_LINK_D2R4_D2R1_UUID = get_link_uuid( + D2_ENDPOINT_IDS[D2_DEVICE_D2R4_UUID]['1/2'], D2_ENDPOINT_IDS[D2_DEVICE_D2R1_UUID]['1/1']) +D2_LINK_D2R4_D2R1_ID = json_link_id(D2_LINK_D2R4_D2R1_UUID) +D2_LINK_D2R4_D2R1 = json_link(D2_LINK_D2R4_D2R1_UUID, [ + D2_ENDPOINT_IDS[D2_DEVICE_D2R4_UUID]['1/2'], D2_ENDPOINT_IDS[D2_DEVICE_D2R1_UUID]['1/1']]) + +# Inter-domain links +D2_LINK_D2R4_D1R1_UUID = get_link_uuid( + D2_ENDPOINT_IDS[D2_DEVICE_D2R4_UUID]['2/1'], D2_ENDPOINT_IDS[D2_DEVICE_D1R1_UUID]['2/1']) +D2_LINK_D2R4_D1R1_ID = json_link_id(D2_LINK_D2R4_D1R1_UUID) +D2_LINK_D2R4_D1R1 = json_link(D2_LINK_D2R4_D1R1_UUID, [ + D2_ENDPOINT_IDS[D2_DEVICE_D2R4_UUID]['2/1'], D2_ENDPOINT_IDS[D2_DEVICE_D1R1_UUID]['2/1']]) + +# ----- Object Collections --------------------------------------------------------------------------------------------- + +D2_CONTEXTS = [D2_CONTEXT] +D2_TOPOLOGIES = [D2_TOPOLOGY] + +D2_DEVICES = [ + (D2_DEVICE_D2R1, D2_DEVICE_D2R1_CONNECT_RULES), + (D2_DEVICE_D2R2, D2_DEVICE_D2R2_CONNECT_RULES), + (D2_DEVICE_D2R3, D2_DEVICE_D2R3_CONNECT_RULES), + (D2_DEVICE_D2R4, D2_DEVICE_D2R4_CONNECT_RULES), + (D2_DEVICE_D1R1, D2_DEVICE_D1R1_CONNECT_RULES), + (D2_DEVICE_D1R4, D2_DEVICE_D1R4_CONNECT_RULES), +] + +D2_LINKS = [ + D2_LINK_D2R1_D2R2, D2_LINK_D2R2_D2R3, D2_LINK_D2R3_D2R4, D2_LINK_D2R4_D2R1, + D2_LINK_D2R4_D1R1, +] diff --git a/src/tests/oeccpsc22/tests/Objects_Service.py b/src/tests/oeccpsc22/tests/Objects_Service.py new file mode 100644 index 0000000000000000000000000000000000000000..a9ffadc0fdbe5f464772e195c892112131a2fb69 --- /dev/null +++ b/src/tests/oeccpsc22/tests/Objects_Service.py @@ -0,0 +1,37 @@ +from .Objects_Domain_1 import D1_DEVICE_D1R1_UUID, D1_ENDPOINT_IDS +from .Objects_Domain_2 import D2_DEVICE_D2R4_UUID, D2_ENDPOINT_IDS +from .Tools import compose_bearer, compose_service_endpoint_id + +# ----- WIM Service Settings ------------------------------------------------------------------------------------------- +WIM_SEP_D1R1_ID = compose_service_endpoint_id(D1_ENDPOINT_IDS[D1_DEVICE_D1R1_UUID]['3/1']) +WIM_SEP_D1R1_ROUTER_ID = '10.10.10.1' +WIM_SEP_D1R1_ROUTER_DIST = '65000:111' +WIM_SEP_D1R1_SITE_ID = '1' +WIM_SEP_D1R1_BEARER = compose_bearer(D1_ENDPOINT_IDS[D1_DEVICE_D1R1_UUID]['3/1']) +WIM_SRV_D1R1_VLAN_ID = 400 + +WIM_SEP_D2R4_ID = compose_service_endpoint_id(D2_ENDPOINT_IDS[D2_DEVICE_D2R4_UUID]['3/3']) +WIM_SEP_D2R4_ROUTER_ID = '20.20.20.1' +WIM_SEP_D2R4_ROUTER_DIST = '65000:222' +WIM_SEP_D2R4_SITE_ID = '2' +WIM_SEP_D2R4_BEARER = compose_bearer(D2_ENDPOINT_IDS[D2_DEVICE_D2R4_UUID]['3/3']) +WIM_SRV_D2R4_VLAN_ID = 500 + +WIM_USERNAME = 'admin' +WIM_PASSWORD = 'admin' + +WIM_MAPPING = [ + {'device-id': D1_DEVICE_D1R1_UUID, 'service_endpoint_id': WIM_SEP_D1R1_ID, + 'service_mapping_info': {'bearer': {'bearer-reference': WIM_SEP_D1R1_BEARER}, 'site-id': WIM_SEP_D1R1_SITE_ID}}, + {'device-id': D2_DEVICE_D2R4_UUID, 'service_endpoint_id': WIM_SEP_D2R4_ID, + 'service_mapping_info': {'bearer': {'bearer-reference': WIM_SEP_D2R4_BEARER}, 'site-id': WIM_SEP_D2R4_SITE_ID}}, +] +WIM_SERVICE_TYPE = 'ELAN' +WIM_SERVICE_CONNECTION_POINTS = [ + {'service_endpoint_id': WIM_SEP_D1R1_ID, + 'service_endpoint_encapsulation_type': 'dot1q', + 'service_endpoint_encapsulation_info': {'vlan': WIM_SRV_D1R1_VLAN_ID}}, + {'service_endpoint_id': WIM_SEP_D2R4_ID, + 'service_endpoint_encapsulation_type': 'dot1q', + 'service_endpoint_encapsulation_info': {'vlan': WIM_SRV_D2R4_VLAN_ID}}, +] diff --git a/src/tests/oeccpsc22/tests/Tools.py b/src/tests/oeccpsc22/tests/Tools.py new file mode 100644 index 0000000000000000000000000000000000000000..a782b6bb3e541e4331f5f95164e69def5640f556 --- /dev/null +++ b/src/tests/oeccpsc22/tests/Tools.py @@ -0,0 +1,25 @@ +from typing import Dict, List, Tuple +from common.tools.object_factory.EndPoint import json_endpoint_id + +def json_endpoint_ids(device_id : Dict, endpoint_descriptors : List[Tuple[str, str, List[int]]]): + return { + device_id['device_uuid']['uuid']: { + ep_uuid: json_endpoint_id(device_id, ep_uuid, topology_id=None) + for ep_uuid, _, _ in endpoint_descriptors + } + } + +def get_link_uuid(a_endpoint_id : Dict, z_endpoint_id : Dict) -> str: + return '{:s}/{:s}=={:s}/{:s}'.format( + a_endpoint_id['device_id']['device_uuid']['uuid'], a_endpoint_id['endpoint_uuid']['uuid'], + a_endpoint_id['device_id']['device_uuid']['uuid'], z_endpoint_id['endpoint_uuid']['uuid']) + +def compose_service_endpoint_id(endpoint_id): + device_uuid = endpoint_id['device_id']['device_uuid']['uuid'] + endpoint_uuid = endpoint_id['endpoint_uuid']['uuid'] + return ':'.join([device_uuid, endpoint_uuid]) + +def compose_bearer(endpoint_id): + device_uuid = endpoint_id['device_id']['device_uuid']['uuid'] + endpoint_uuid = endpoint_id['endpoint_uuid']['uuid'] + return ':'.join([device_uuid, endpoint_uuid]) diff --git a/src/tests/oeccpsc22/tests/__init__.py b/src/tests/oeccpsc22/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/tests/oeccpsc22/tests/__init__.py @@ -0,0 +1,14 @@ +# 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. + diff --git a/src/tests/oeccpsc22/tests/test_functional_bootstrap.py b/src/tests/oeccpsc22/tests/test_functional_bootstrap.py new file mode 100644 index 0000000000000000000000000000000000000000..452394c0165b268c2defa69b899ba554ef4b1504 --- /dev/null +++ b/src/tests/oeccpsc22/tests/test_functional_bootstrap.py @@ -0,0 +1,213 @@ +# 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. + +import copy, logging, pytest +from common.Settings import get_setting +from context.client.ContextClient import ContextClient +from context.proto.context_pb2 import Context, ContextId, Device, Empty, Link, Topology +from device.client.DeviceClient import DeviceClient +from .Objects_Domain_1 import D1_CONTEXT_ID, D1_CONTEXTS, D1_DEVICES, D1_LINKS, D1_TOPOLOGIES +from .Objects_Domain_2 import D2_CONTEXT_ID, D2_CONTEXTS, D2_DEVICES, D2_LINKS, D2_TOPOLOGIES + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +@pytest.fixture(scope='session') +def d1_context_client(): + _client = ContextClient( + get_setting('D1_CONTEXTSERVICE_SERVICE_HOST'), get_setting('D1_CONTEXTSERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + +@pytest.fixture(scope='session') +def d1_device_client(): + _client = DeviceClient( + get_setting('D1_DEVICESERVICE_SERVICE_HOST'), get_setting('D1_DEVICESERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + +@pytest.fixture(scope='session') +def d2_context_client(): + _client = ContextClient( + get_setting('D2_CONTEXTSERVICE_SERVICE_HOST'), get_setting('D2_CONTEXTSERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + +@pytest.fixture(scope='session') +def d2_device_client(): + _client = DeviceClient( + get_setting('D2_DEVICESERVICE_SERVICE_HOST'), get_setting('D2_DEVICESERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + + +def test_scenario_empty( + d1_context_client : ContextClient, # pylint: disable=redefined-outer-name + d2_context_client : ContextClient): # pylint: disable=redefined-outer-name + + def per_domain(context_client): + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == 0 + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == 0 + + response = context_client.ListLinks(Empty()) + assert len(response.links) == 0 + + # ----- List entities - Ensure database is empty ------------------------------------------------------------------- + per_domain(d1_context_client) + per_domain(d2_context_client) + + +def test_prepare_scenario( + d1_context_client : ContextClient, # pylint: disable=redefined-outer-name + d2_context_client : ContextClient): # pylint: disable=redefined-outer-name + + def per_domain(contexts, topologies, context_client): + for context in contexts: + context_uuid = context['context_id']['context_uuid']['uuid'] + LOGGER.info('Adding Context {:s}'.format(context_uuid)) + response = context_client.SetContext(Context(**context)) + assert response.context_uuid.uuid == context_uuid + + for topology in topologies: + context_uuid = topology['topology_id']['context_id']['context_uuid']['uuid'] + topology_uuid = topology['topology_id']['topology_uuid']['uuid'] + LOGGER.info('Adding Topology {:s}/{:s}'.format(context_uuid, topology_uuid)) + response = context_client.SetTopology(Topology(**topology)) + assert response.context_id.context_uuid.uuid == context_uuid + assert response.topology_uuid.uuid == topology_uuid + + # ----- Create Contexts and Topologies ----------------------------------------------------------------------------- + per_domain(D1_CONTEXTS, D1_TOPOLOGIES, d1_context_client) + per_domain(D2_CONTEXTS, D2_TOPOLOGIES, d2_context_client) + + +def test_scenario_ready( + d1_context_client : ContextClient, # pylint: disable=redefined-outer-name + d2_context_client : ContextClient): # pylint: disable=redefined-outer-name + + def per_domain(contexts, topologies, context_id, context_client): + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == len(contexts) + + response = context_client.ListTopologies(ContextId(**context_id)) + assert len(response.topologies) == len(topologies) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == 0 + + response = context_client.ListLinks(Empty()) + assert len(response.links) == 0 + + response = context_client.ListSlices(ContextId(**context_id)) + assert len(response.slices) == 0 + + response = context_client.ListServices(ContextId(**context_id)) + assert len(response.services) == 0 + + # ----- List entities - Ensure scenario is ready ------------------------------------------------------------------- + per_domain(D1_CONTEXTS, D1_TOPOLOGIES, D1_CONTEXT_ID, d1_context_client) + per_domain(D2_CONTEXTS, D2_TOPOLOGIES, D2_CONTEXT_ID, d2_context_client) + + +def test_devices_bootstraping( + d1_device_client : DeviceClient, # pylint: disable=redefined-outer-name + d2_device_client : DeviceClient): # pylint: disable=redefined-outer-name + + def per_domain(devices, device_client): + for device, connect_rules in devices: + device_uuid = device['device_id']['device_uuid']['uuid'] + LOGGER.info('Adding Device {:s}'.format(device_uuid)) + device_with_connect_rules = copy.deepcopy(device) + device_with_connect_rules['device_config']['config_rules'].extend(connect_rules) + response = device_client.AddDevice(Device(**device_with_connect_rules)) + assert response.device_uuid.uuid == device_uuid + + # ----- Create Devices and Validate Collected Events --------------------------------------------------------------- + per_domain(D1_DEVICES, d1_device_client) + per_domain(D2_DEVICES, d2_device_client) + + +def test_devices_bootstrapped( + d1_context_client : ContextClient, # pylint: disable=redefined-outer-name + d2_context_client : ContextClient): # pylint: disable=redefined-outer-name + + def per_domain(contexts, topologies, devices, context_id, context_client): + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == len(contexts) + + response = context_client.ListTopologies(ContextId(**context_id)) + assert len(response.topologies) == len(topologies) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == len(devices) + + response = context_client.ListLinks(Empty()) + assert len(response.links) == 0 + + response = context_client.ListSlices(ContextId(**context_id)) + assert len(response.slices) == 0 + + response = context_client.ListServices(ContextId(**context_id)) + assert len(response.services) == 0 + + # ----- List entities - Ensure bevices are created ----------------------------------------------------------------- + per_domain(D1_CONTEXTS, D1_TOPOLOGIES, D1_DEVICES, D1_CONTEXT_ID, d1_context_client) + per_domain(D2_CONTEXTS, D2_TOPOLOGIES, D2_DEVICES, D2_CONTEXT_ID, d2_context_client) + + +def test_links_creation( + d1_context_client : ContextClient, # pylint: disable=redefined-outer-name + d2_context_client : ContextClient): # pylint: disable=redefined-outer-name + + def per_domain(links, context_client): + for link in links: + link_uuid = link['link_id']['link_uuid']['uuid'] + LOGGER.info('Adding Link {:s}'.format(link_uuid)) + response = context_client.SetLink(Link(**link)) + assert response.link_uuid.uuid == link_uuid + + # ----- Create Links and Validate Collected Events ----------------------------------------------------------------- + per_domain(D1_LINKS, d1_context_client) + per_domain(D2_LINKS, d2_context_client) + + +def test_links_created( + d1_context_client : ContextClient, # pylint: disable=redefined-outer-name + d2_context_client : ContextClient): # pylint: disable=redefined-outer-name + + def per_domain(contexts, topologies, devices, links, context_id, context_client): + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == len(contexts) + + response = context_client.ListTopologies(ContextId(**context_id)) + assert len(response.topologies) == len(topologies) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == len(devices) + + response = context_client.ListLinks(Empty()) + assert len(response.links) == len(links) + + response = context_client.ListSlices(ContextId(**context_id)) + assert len(response.slices) == 0 + + response = context_client.ListServices(ContextId(**context_id)) + assert len(response.services) == 0 + + # ----- List entities - Ensure links are created ------------------------------------------------------------------- + per_domain(D1_CONTEXTS, D1_TOPOLOGIES, D1_DEVICES, D1_LINKS, D1_CONTEXT_ID, d1_context_client) + per_domain(D2_CONTEXTS, D2_TOPOLOGIES, D2_DEVICES, D2_LINKS, D2_CONTEXT_ID, d2_context_client) diff --git a/src/tests/oeccpsc22/tests/test_functional_cleanup.py b/src/tests/oeccpsc22/tests/test_functional_cleanup.py new file mode 100644 index 0000000000000000000000000000000000000000..eb78a585079e3ee757a836433bf23423a3ad899d --- /dev/null +++ b/src/tests/oeccpsc22/tests/test_functional_cleanup.py @@ -0,0 +1,123 @@ +# 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. + +import logging, pytest +from common.Settings import get_setting +from common.tests.EventTools import EVENT_REMOVE, check_events +from common.tools.object_factory.Context import json_context_id +from common.tools.object_factory.Device import json_device_id +from common.tools.object_factory.Link import json_link_id +from common.tools.object_factory.Topology import json_topology_id +from context.client.ContextClient import ContextClient +from context.client.EventsCollector import EventsCollector +from context.proto.context_pb2 import ContextId, DeviceId, Empty, LinkId, TopologyId +from device.client.DeviceClient import DeviceClient +from .Objects import CONTEXT_ID, CONTEXTS, DEVICES, LINKS, TOPOLOGIES + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + + +@pytest.fixture(scope='session') +def context_client(): + _client = ContextClient(get_setting('CONTEXTSERVICE_SERVICE_HOST'), get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + + +@pytest.fixture(scope='session') +def device_client(): + _client = DeviceClient(get_setting('DEVICESERVICE_SERVICE_HOST'), get_setting('DEVICESERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + + +def test_services_removed(context_client : ContextClient): # pylint: disable=redefined-outer-name + # ----- List entities - Ensure service is removed ------------------------------------------------------------------ + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == len(CONTEXTS) + + response = context_client.ListTopologies(ContextId(**CONTEXT_ID)) + assert len(response.topologies) == len(TOPOLOGIES) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == len(DEVICES) + + response = context_client.ListLinks(Empty()) + assert len(response.links) == len(LINKS) + + response = context_client.ListServices(ContextId(**CONTEXT_ID)) + assert len(response.services) == 0 + + +def test_scenario_cleanup( + context_client : ContextClient, device_client : DeviceClient): # pylint: disable=redefined-outer-name + + # ----- Start the EventsCollector ---------------------------------------------------------------------------------- + events_collector = EventsCollector(context_client) + events_collector.start() + + expected_events = [] + + # ----- Delete Links and Validate Collected Events ----------------------------------------------------------------- + for link in LINKS: + link_id = link['link_id'] + link_uuid = link_id['link_uuid']['uuid'] + LOGGER.info('Deleting Link {:s}'.format(link_uuid)) + context_client.RemoveLink(LinkId(**link_id)) + expected_events.append(('LinkEvent', EVENT_REMOVE, json_link_id(link_uuid))) + + # ----- Delete Devices and Validate Collected Events --------------------------------------------------------------- + for device, _ in DEVICES: + device_id = device['device_id'] + device_uuid = device_id['device_uuid']['uuid'] + LOGGER.info('Deleting Device {:s}'.format(device_uuid)) + device_client.DeleteDevice(DeviceId(**device_id)) + expected_events.append(('DeviceEvent', EVENT_REMOVE, json_device_id(device_uuid))) + + # ----- Delete Topologies and Validate Collected Events ------------------------------------------------------------ + for topology in TOPOLOGIES: + topology_id = topology['topology_id'] + context_uuid = topology_id['context_id']['context_uuid']['uuid'] + topology_uuid = topology_id['topology_uuid']['uuid'] + LOGGER.info('Deleting Topology {:s}/{:s}'.format(context_uuid, topology_uuid)) + context_client.RemoveTopology(TopologyId(**topology_id)) + context_id = json_context_id(context_uuid) + expected_events.append(('TopologyEvent', EVENT_REMOVE, json_topology_id(topology_uuid, context_id=context_id))) + + # ----- Delete Contexts and Validate Collected Events -------------------------------------------------------------- + for context in CONTEXTS: + context_id = context['context_id'] + context_uuid = context_id['context_uuid']['uuid'] + LOGGER.info('Deleting Context {:s}'.format(context_uuid)) + context_client.RemoveContext(ContextId(**context_id)) + expected_events.append(('ContextEvent', EVENT_REMOVE, json_context_id(context_uuid))) + + # ----- Validate Collected Events ---------------------------------------------------------------------------------- + check_events(events_collector, expected_events) + + # ----- Stop the EventsCollector ----------------------------------------------------------------------------------- + events_collector.stop() + + +def test_scenario_empty_again(context_client : ContextClient): # pylint: disable=redefined-outer-name + # ----- List entities - Ensure database is empty again ------------------------------------------------------------- + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == 0 + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == 0 + + response = context_client.ListLinks(Empty()) + assert len(response.links) == 0 diff --git a/src/tests/oeccpsc22/tests/test_functional_create_interdomain_slice.py b/src/tests/oeccpsc22/tests/test_functional_create_interdomain_slice.py new file mode 100644 index 0000000000000000000000000000000000000000..e6f6ccbc96152eb7e3a33317293261e28c89d713 --- /dev/null +++ b/src/tests/oeccpsc22/tests/test_functional_create_interdomain_slice.py @@ -0,0 +1,129 @@ +# 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. + +import logging, pytest +from common.DeviceTypes import DeviceTypeEnum +from common.Settings import get_setting +from common.tools.grpc.Tools import grpc_message_to_json_string +from compute.tests.mock_osm.MockOSM import MockOSM +from context.client.ContextClient import ContextClient +from context.proto.context_pb2 import ContextId, Empty +from .Objects_Domain_1 import D1_CONTEXT_ID, D1_CONTEXTS, D1_DEVICES, D1_LINKS, D1_TOPOLOGIES +from .Objects_Domain_2 import D2_CONTEXT_ID, D2_CONTEXTS, D2_DEVICES, D2_LINKS, D2_TOPOLOGIES +from .Objects_Service import WIM_MAPPING, WIM_PASSWORD, WIM_SERVICE_CONNECTION_POINTS, WIM_SERVICE_TYPE, WIM_USERNAME + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +DEVTYPE_EMU_PR = DeviceTypeEnum.EMULATED_PACKET_ROUTER.value +DEVTYPE_EMU_OLS = DeviceTypeEnum.EMULATED_OPTICAL_LINE_SYSTEM.value + + +@pytest.fixture(scope='session') +def d1_context_client(): + _client = ContextClient( + get_setting('D1_CONTEXTSERVICE_SERVICE_HOST'), get_setting('D1_CONTEXTSERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + + +@pytest.fixture(scope='session') +def d2_context_client(): + _client = ContextClient( + get_setting('D2_CONTEXTSERVICE_SERVICE_HOST'), get_setting('D2_CONTEXTSERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + + +@pytest.fixture(scope='session') +def d1_osm_wim(): + wim_url = 'http://{:s}:{:s}'.format( + get_setting('D1_COMPUTESERVICE_SERVICE_HOST'), str(get_setting('D1_COMPUTESERVICE_SERVICE_PORT_HTTP'))) + return MockOSM(wim_url, WIM_MAPPING, WIM_USERNAME, WIM_PASSWORD) + + +def test_scenario_is_correct( + d1_context_client : ContextClient, # pylint: disable=redefined-outer-name + d2_context_client : ContextClient): # pylint: disable=redefined-outer-name + + def per_domain(contexts, topologies, devices, links, context_id, context_client): + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == len(contexts) + + response = context_client.ListTopologies(ContextId(**context_id)) + assert len(response.topologies) == len(topologies) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == len(devices) + + response = context_client.ListLinks(Empty()) + assert len(response.links) == len(links) + + response = context_client.ListSlices(ContextId(**context_id)) + assert len(response.slices) == 0 + + response = context_client.ListServices(ContextId(**context_id)) + assert len(response.services) == 0 + + # ----- List entities - Ensure scenario is up ---------------------------------------------------------------------- + per_domain(D1_CONTEXTS, D1_TOPOLOGIES, D1_DEVICES, D1_LINKS, D1_CONTEXT_ID, d1_context_client) + per_domain(D2_CONTEXTS, D2_TOPOLOGIES, D2_DEVICES, D2_LINKS, D2_CONTEXT_ID, d2_context_client) + + +def test_interdomain_slice_creation( + d1_osm_wim : MockOSM): # pylint: disable=redefined-outer-name + + # ----- Create Inter-domain Slice ---------------------------------------------------------------------------------- + service_uuid = d1_osm_wim.create_connectivity_service(WIM_SERVICE_TYPE, WIM_SERVICE_CONNECTION_POINTS) + d1_osm_wim.get_connectivity_service_status(service_uuid) + + +def test_scenario_interdomain_slice_created( + d1_context_client : ContextClient, # pylint: disable=redefined-outer-name + d2_context_client : ContextClient): # pylint: disable=redefined-outer-name + + def per_domain(contexts, topologies, devices, links, context_id, context_client): + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == len(contexts) + + response = context_client.ListTopologies(ContextId(**context_id)) + assert len(response.topologies) == len(topologies) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == len(devices) + + response = context_client.ListLinks(Empty()) + assert len(response.links) == len(links) + + # TODO: implement validation of number of slices according to the domain they belong + #response = context_client.ListSlices(ContextId(**context_id)) + #LOGGER.info('Slices[{:d}] = {:s}'.format(len(response.slices), grpc_message_to_json_string(response))) + #assert len(response.slices) == (2 if D1 else 1) + # TODO: implement validation that slices are correct + + response = context_client.ListServices(ContextId(**context_id)) + LOGGER.info('Services[{:d}] = {:s}'.format(len(response.services), grpc_message_to_json_string(response))) + assert len(response.services) == 1 # L3NM + # TODO: improve validation of services created + for service in response.services: + service_id = service.service_id + response = context_client.ListConnections(service_id) + LOGGER.info(' ServiceId[{:s}] => Connections[{:d}] = {:s}'.format( + grpc_message_to_json_string(service_id), len(response.connections), + grpc_message_to_json_string(response))) + assert len(response.connections) == 1 # one connection per service + + # ----- List entities - Ensure service is created ------------------------------------------------------------------ + per_domain(D1_CONTEXTS, D1_TOPOLOGIES, D1_DEVICES, D1_LINKS, D1_CONTEXT_ID, d1_context_client) + per_domain(D2_CONTEXTS, D2_TOPOLOGIES, D2_DEVICES, D2_LINKS, D2_CONTEXT_ID, d2_context_client) diff --git a/src/tests/oeccpsc22/tests/test_functional_delete_interdomain_slice.py b/src/tests/oeccpsc22/tests/test_functional_delete_interdomain_slice.py new file mode 100644 index 0000000000000000000000000000000000000000..2830225be8738fb7b5e5b02f2d04007a94cbfa85 --- /dev/null +++ b/src/tests/oeccpsc22/tests/test_functional_delete_interdomain_slice.py @@ -0,0 +1,143 @@ +# 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. + +import logging, pytest +from common.DeviceTypes import DeviceTypeEnum +from common.Settings import get_setting +from common.tools.grpc.Tools import grpc_message_to_json_string +from compute.tests.mock_osm.MockOSM import MockOSM +from context.client.ContextClient import ContextClient +from context.proto.context_pb2 import ContextId, Empty +from .Objects_Domain_1 import D1_CONTEXT_ID, D1_CONTEXTS, D1_DEVICES, D1_LINKS, D1_TOPOLOGIES +from .Objects_Domain_2 import D2_CONTEXT_ID, D2_CONTEXTS, D2_DEVICES, D2_LINKS, D2_TOPOLOGIES +from .Objects_Service import WIM_MAPPING, WIM_PASSWORD, WIM_USERNAME + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +DEVTYPE_EMU_PR = DeviceTypeEnum.EMULATED_PACKET_ROUTER.value +DEVTYPE_EMU_OLS = DeviceTypeEnum.EMULATED_OPTICAL_LINE_SYSTEM.value + + +@pytest.fixture(scope='session') +def d1_context_client(): + _client = ContextClient( + get_setting('D1_CONTEXTSERVICE_SERVICE_HOST'), get_setting('D1_CONTEXTSERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + + +@pytest.fixture(scope='session') +def d2_context_client(): + _client = ContextClient( + get_setting('D2_CONTEXTSERVICE_SERVICE_HOST'), get_setting('D2_CONTEXTSERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + + +@pytest.fixture(scope='session') +def d1_osm_wim(): + wim_url = 'http://{:s}:{:s}'.format( + get_setting('D1_COMPUTESERVICE_SERVICE_HOST'), str(get_setting('D1_COMPUTESERVICE_SERVICE_PORT_HTTP'))) + return MockOSM(wim_url, WIM_MAPPING, WIM_USERNAME, WIM_PASSWORD) + + +def test_interdomain_slice_created( + d1_context_client : ContextClient, # pylint: disable=redefined-outer-name + d2_context_client : ContextClient): # pylint: disable=redefined-outer-name + + def per_domain(contexts, topologies, devices, links, context_id, context_client): + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == len(contexts) + + response = context_client.ListTopologies(ContextId(**context_id)) + assert len(response.topologies) == len(topologies) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == len(devices) + + response = context_client.ListLinks(Empty()) + assert len(response.links) == len(links) + + # TODO: implement validation of number of slices according to the domain they belong + #response = context_client.ListSlices(ContextId(**context_id)) + #LOGGER.info('Slices[{:d}] = {:s}'.format(len(response.slices), grpc_message_to_json_string(response))) + #assert len(response.slices) == (2 if D1 else 1) + # TODO: implement validation that slices are correct + + response = context_client.ListServices(ContextId(**context_id)) + LOGGER.info('Services[{:d}] = {:s}'.format(len(response.services), grpc_message_to_json_string(response))) + assert len(response.services) == 1 # L3NM + # TODO: improve validation of services created + for service in response.services: + service_id = service.service_id + response = context_client.ListConnections(service_id) + LOGGER.info(' ServiceId[{:s}] => Connections[{:d}] = {:s}'.format( + grpc_message_to_json_string(service_id), len(response.connections), + grpc_message_to_json_string(response))) + assert len(response.connections) == 1 # one connection per service + + # ----- List entities - Ensure Inter-domain slice is created ------------------------------------------------------- + per_domain(D1_CONTEXTS, D1_TOPOLOGIES, D1_DEVICES, D1_LINKS, D1_CONTEXT_ID, d1_context_client) + per_domain(D2_CONTEXTS, D2_TOPOLOGIES, D2_DEVICES, D2_LINKS, D2_CONTEXT_ID, d2_context_client) + + +def test_interdomain_slice_removal( + d1_context_client : ContextClient, # pylint: disable=redefined-outer-name + d1_osm_wim : MockOSM): # pylint: disable=redefined-outer-name + + # ----- Remove Inter-domain Slice ---------------------------------------------------------------------------------- + # TODO: implement retrieval of inter-domain slice to be deleted + #response = d1_context_client.ListSliceIds(ContextId(**D1_CONTEXT_ID)) + #LOGGER.info('SliceIds[{:d}] = {:s}'.format(len(response.slice_ids), grpc_message_to_json_string(response))) + #assert len(response.service_ids) == 2 # L3NM + TAPI + #service_uuids = set() + #for service_id in response.service_ids: + # service_uuid = service_id.service_uuid.uuid + # if service_uuid.endswith(':optical'): continue + # service_uuids.add(service_uuid) + # osm_wim.conn_info[service_uuid] = {} + + # TODO: implement removal of service + #assert len(service_uuids) == 1 # assume a single service has been created + #service_uuid = set(service_uuids).pop() + #osm_wim.delete_connectivity_service(service_uuid) + + +def test_interdomain_slice_removed( + d1_context_client : ContextClient, # pylint: disable=redefined-outer-name + d2_context_client : ContextClient): # pylint: disable=redefined-outer-name + + def per_domain(contexts, topologies, devices, links, context_id, context_client): + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == len(contexts) + + response = context_client.ListTopologies(ContextId(**context_id)) + assert len(response.topologies) == len(topologies) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == len(devices) + + response = context_client.ListLinks(Empty()) + assert len(response.links) == len(links) + + response = context_client.ListSlices(ContextId(**context_id)) + assert len(response.slices) == 0 + + response = context_client.ListServices(ContextId(**context_id)) + assert len(response.services) == 0 + + # ----- List entities - Ensure services removed -------------------------------------------------------------------- + per_domain(D1_CONTEXTS, D1_TOPOLOGIES, D1_DEVICES, D1_LINKS, D1_CONTEXT_ID, d1_context_client) + per_domain(D2_CONTEXTS, D2_TOPOLOGIES, D2_DEVICES, D2_LINKS, D2_CONTEXT_ID, d2_context_client) diff --git a/src/webui/.gitlab-ci.yml b/src/webui/.gitlab-ci.yml index 65fd7127848224d2afb7c45280a3d15ffbcab6c5..3865541d040a4320bac02caaa42f66f1e8ca10e9 100644 --- a/src/webui/.gitlab-ci.yml +++ b/src/webui/.gitlab-ci.yml @@ -55,7 +55,8 @@ unit test webui: - sleep 5 - docker ps -a - docker logs $IMAGE_NAME - - docker exec --user root -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=DEBUG --verbose ${IMAGE_NAME}/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml; coverage xml -o /opt/results/${IMAGE_NAME}_coverage.xml; ls -la /opt/results; coverage report --include='${IMAGE_NAME}/*' --show-missing" + - docker exec --user root -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=DEBUG --verbose ${IMAGE_NAME}/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml" + - docker exec --user root -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing" coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' after_script: - docker rm -f $IMAGE_NAME @@ -74,7 +75,6 @@ unit test webui: when: always reports: junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml - cobertura: src/$IMAGE_NAME/tests/${IMAGE_NAME}_coverage.xml # Deployment of the webui service in Kubernetes Cluster deploy webui: diff --git a/src/webui/genproto.sh b/src/webui/genproto.sh index 18a0d4f921c3bca9b838a47e06ddb02e344e957c..290ae02941878e86c1a770299e0e9139646792c5 100755 --- a/src/webui/genproto.sh +++ b/src/webui/genproto.sh @@ -1,6 +1,6 @@ #!/bin/bash -eu # -# Copyright 2018 Google LLC +# 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. @@ -14,14 +14,27 @@ # See the License for the specific language governing permissions and # limitations under the License. -#!/bin/bash -e - # Make folder containing the script the root folder for its execution cd $(dirname $0) rm -rf proto/*.py rm -rf proto/__pycache__ -touch proto/__init__.py +tee proto/__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 # building protos of services used # python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto compute.proto diff --git a/src/webui/proto/context_pb2.py b/src/webui/proto/context_pb2.py index 68602b16f264ceac9acc3ef6669b09d5984e72c2..50d501d3ac053ad644554331af26e3c40cd426a1 100644 --- a/src/webui/proto/context_pb2.py +++ b/src/webui/proto/context_pb2.py @@ -21,7 +21,7 @@ DESCRIPTOR = _descriptor.FileDescriptor( syntax='proto3', serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\rcontext.proto\x12\x07\x63ontext\x1a\x16kpi_sample_types.proto\"\x07\n\x05\x45mpty\"\x14\n\x04Uuid\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"F\n\x05\x45vent\x12\x11\n\ttimestamp\x18\x01 \x01(\x01\x12*\n\nevent_type\x18\x02 \x01(\x0e\x32\x16.context.EventTypeEnum\"0\n\tContextId\x12#\n\x0c\x63ontext_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xb6\x01\n\x07\x43ontext\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12)\n\x0ctopology_ids\x18\x02 \x03(\x0b\x32\x13.context.TopologyId\x12\'\n\x0bservice_ids\x18\x03 \x03(\x0b\x32\x12.context.ServiceId\x12/\n\ncontroller\x18\x04 \x01(\x0b\x32\x1b.context.TeraFlowController\"8\n\rContextIdList\x12\'\n\x0b\x63ontext_ids\x18\x01 \x03(\x0b\x32\x12.context.ContextId\"1\n\x0b\x43ontextList\x12\"\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32\x10.context.Context\"U\n\x0c\x43ontextEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\ncontext_id\x18\x02 \x01(\x0b\x32\x12.context.ContextId\"Z\n\nTopologyId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12$\n\rtopology_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"~\n\x08Topology\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12%\n\ndevice_ids\x18\x02 \x03(\x0b\x32\x11.context.DeviceId\x12!\n\x08link_ids\x18\x03 \x03(\x0b\x32\x0f.context.LinkId\";\n\x0eTopologyIdList\x12)\n\x0ctopology_ids\x18\x01 \x03(\x0b\x32\x13.context.TopologyId\"5\n\x0cTopologyList\x12%\n\ntopologies\x18\x01 \x03(\x0b\x32\x11.context.Topology\"X\n\rTopologyEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12(\n\x0btopology_id\x18\x02 \x01(\x0b\x32\x13.context.TopologyId\".\n\x08\x44\x65viceId\x12\"\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x9a\x02\n\x06\x44\x65vice\x12$\n\tdevice_id\x18\x01 \x01(\x0b\x32\x11.context.DeviceId\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12,\n\rdevice_config\x18\x03 \x01(\x0b\x32\x15.context.DeviceConfig\x12G\n\x19\x64\x65vice_operational_status\x18\x04 \x01(\x0e\x32$.context.DeviceOperationalStatusEnum\x12\x31\n\x0e\x64\x65vice_drivers\x18\x05 \x03(\x0e\x32\x19.context.DeviceDriverEnum\x12+\n\x10\x64\x65vice_endpoints\x18\x06 \x03(\x0b\x32\x11.context.EndPoint\"9\n\x0c\x44\x65viceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"5\n\x0c\x44\x65viceIdList\x12%\n\ndevice_ids\x18\x01 \x03(\x0b\x32\x11.context.DeviceId\".\n\nDeviceList\x12 \n\x07\x64\x65vices\x18\x01 \x03(\x0b\x32\x0f.context.Device\"R\n\x0b\x44\x65viceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"*\n\x06LinkId\x12 \n\tlink_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"X\n\x04Link\x12 \n\x07link_id\x18\x01 \x01(\x0b\x32\x0f.context.LinkId\x12.\n\x11link_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\"/\n\nLinkIdList\x12!\n\x08link_ids\x18\x01 \x03(\x0b\x32\x0f.context.LinkId\"(\n\x08LinkList\x12\x1c\n\x05links\x18\x01 \x03(\x0b\x32\r.context.Link\"L\n\tLinkEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12 \n\x07link_id\x18\x02 \x01(\x0b\x32\x0f.context.LinkId\"X\n\tServiceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12#\n\x0cservice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\xa6\x02\n\x07Service\x12&\n\nservice_id\x18\x01 \x01(\x0b\x32\x12.context.ServiceId\x12.\n\x0cservice_type\x18\x02 \x01(\x0e\x32\x18.context.ServiceTypeEnum\x12\x31\n\x14service_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12\x30\n\x13service_constraints\x18\x04 \x03(\x0b\x32\x13.context.Constraint\x12.\n\x0eservice_status\x18\x05 \x01(\x0b\x32\x16.context.ServiceStatus\x12.\n\x0eservice_config\x18\x06 \x01(\x0b\x32\x16.context.ServiceConfig\"C\n\rServiceStatus\x12\x32\n\x0eservice_status\x18\x01 \x01(\x0e\x32\x1a.context.ServiceStatusEnum\":\n\rServiceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"8\n\rServiceIdList\x12\'\n\x0bservice_ids\x18\x01 \x03(\x0b\x32\x12.context.ServiceId\"1\n\x0bServiceList\x12\"\n\x08services\x18\x01 \x03(\x0b\x32\x10.context.Service\"U\n\x0cServiceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\"6\n\x0c\x43onnectionId\x12&\n\x0f\x63onnection_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xc4\x01\n\nConnection\x12,\n\rconnection_id\x18\x01 \x01(\x0b\x32\x15.context.ConnectionId\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\x12\x33\n\x16path_hops_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12+\n\x0fsub_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\"A\n\x10\x43onnectionIdList\x12-\n\x0e\x63onnection_ids\x18\x01 \x03(\x0b\x32\x15.context.ConnectionId\":\n\x0e\x43onnectionList\x12(\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x13.context.Connection\"^\n\x0f\x43onnectionEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12,\n\rconnection_id\x18\x02 \x01(\x0b\x32\x15.context.ConnectionId\"\x82\x01\n\nEndPointId\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\x12$\n\rendpoint_uuid\x18\x03 \x01(\x0b\x32\r.context.Uuid\"\x86\x01\n\x08\x45ndPoint\x12(\n\x0b\x65ndpoint_id\x18\x01 \x01(\x0b\x32\x13.context.EndPointId\x12\x15\n\rendpoint_type\x18\x02 \x01(\t\x12\x39\n\x10kpi_sample_types\x18\x03 \x03(\x0e\x32\x1f.kpi_sample_types.KpiSampleType\"e\n\nConfigRule\x12)\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x19.context.ConfigActionEnum\x12\x14\n\x0cresource_key\x18\x02 \x01(\t\x12\x16\n\x0eresource_value\x18\x03 \x01(\t\"?\n\nConstraint\x12\x17\n\x0f\x63onstraint_type\x18\x01 \x01(\t\x12\x18\n\x10\x63onstraint_value\x18\x02 \x01(\t\"^\n\x12TeraFlowController\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x12\n\nip_address\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\"U\n\x14\x41uthenticationResult\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x15\n\rauthenticated\x18\x02 \x01(\x08*j\n\rEventTypeEnum\x12\x17\n\x13\x45VENTTYPE_UNDEFINED\x10\x00\x12\x14\n\x10\x45VENTTYPE_CREATE\x10\x01\x12\x14\n\x10\x45VENTTYPE_UPDATE\x10\x02\x12\x14\n\x10\x45VENTTYPE_REMOVE\x10\x03*\xc5\x01\n\x10\x44\x65viceDriverEnum\x12\x1a\n\x16\x44\x45VICEDRIVER_UNDEFINED\x10\x00\x12\x1b\n\x17\x44\x45VICEDRIVER_OPENCONFIG\x10\x01\x12\x1e\n\x1a\x44\x45VICEDRIVER_TRANSPORT_API\x10\x02\x12\x13\n\x0f\x44\x45VICEDRIVER_P4\x10\x03\x12&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOGY\x10\x04\x12\x1b\n\x17\x44\x45VICEDRIVER_ONF_TR_352\x10\x05*\x8f\x01\n\x1b\x44\x65viceOperationalStatusEnum\x12%\n!DEVICEOPERATIONALSTATUS_UNDEFINED\x10\x00\x12$\n DEVICEOPERATIONALSTATUS_DISABLED\x10\x01\x12#\n\x1f\x44\x45VICEOPERATIONALSTATUS_ENABLED\x10\x02*\x81\x01\n\x0fServiceTypeEnum\x12\x17\n\x13SERVICETYPE_UNKNOWN\x10\x00\x12\x14\n\x10SERVICETYPE_L3NM\x10\x01\x12\x14\n\x10SERVICETYPE_L2NM\x10\x02\x12)\n%SERVICETYPE_TAPI_CONNECTIVITY_SERVICE\x10\x03*\x88\x01\n\x11ServiceStatusEnum\x12\x1b\n\x17SERVICESTATUS_UNDEFINED\x10\x00\x12\x19\n\x15SERVICESTATUS_PLANNED\x10\x01\x12\x18\n\x14SERVICESTATUS_ACTIVE\x10\x02\x12!\n\x1dSERVICESTATUS_PENDING_REMOVAL\x10\x03*]\n\x10\x43onfigActionEnum\x12\x1a\n\x16\x43ONFIGACTION_UNDEFINED\x10\x00\x12\x14\n\x10\x43ONFIGACTION_SET\x10\x01\x12\x17\n\x13\x43ONFIGACTION_DELETE\x10\x02\x32\xad\x10\n\x0e\x43ontextService\x12:\n\x0eListContextIds\x12\x0e.context.Empty\x1a\x16.context.ContextIdList\"\x00\x12\x36\n\x0cListContexts\x12\x0e.context.Empty\x1a\x14.context.ContextList\"\x00\x12\x34\n\nGetContext\x12\x12.context.ContextId\x1a\x10.context.Context\"\x00\x12\x34\n\nSetContext\x12\x10.context.Context\x1a\x12.context.ContextId\"\x00\x12\x35\n\rRemoveContext\x12\x12.context.ContextId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetContextEvents\x12\x0e.context.Empty\x1a\x15.context.ContextEvent\"\x00\x30\x01\x12@\n\x0fListTopologyIds\x12\x12.context.ContextId\x1a\x17.context.TopologyIdList\"\x00\x12=\n\x0eListTopologies\x12\x12.context.ContextId\x1a\x15.context.TopologyList\"\x00\x12\x37\n\x0bGetTopology\x12\x13.context.TopologyId\x1a\x11.context.Topology\"\x00\x12\x37\n\x0bSetTopology\x12\x11.context.Topology\x1a\x13.context.TopologyId\"\x00\x12\x37\n\x0eRemoveTopology\x12\x13.context.TopologyId\x1a\x0e.context.Empty\"\x00\x12?\n\x11GetTopologyEvents\x12\x0e.context.Empty\x1a\x16.context.TopologyEvent\"\x00\x30\x01\x12\x38\n\rListDeviceIds\x12\x0e.context.Empty\x1a\x15.context.DeviceIdList\"\x00\x12\x34\n\x0bListDevices\x12\x0e.context.Empty\x1a\x13.context.DeviceList\"\x00\x12\x31\n\tGetDevice\x12\x11.context.DeviceId\x1a\x0f.context.Device\"\x00\x12\x31\n\tSetDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0cRemoveDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x12;\n\x0fGetDeviceEvents\x12\x0e.context.Empty\x1a\x14.context.DeviceEvent\"\x00\x30\x01\x12\x34\n\x0bListLinkIds\x12\x0e.context.Empty\x1a\x13.context.LinkIdList\"\x00\x12\x30\n\tListLinks\x12\x0e.context.Empty\x1a\x11.context.LinkList\"\x00\x12+\n\x07GetLink\x12\x0f.context.LinkId\x1a\r.context.Link\"\x00\x12+\n\x07SetLink\x12\r.context.Link\x1a\x0f.context.LinkId\"\x00\x12/\n\nRemoveLink\x12\x0f.context.LinkId\x1a\x0e.context.Empty\"\x00\x12\x37\n\rGetLinkEvents\x12\x0e.context.Empty\x1a\x12.context.LinkEvent\"\x00\x30\x01\x12>\n\x0eListServiceIds\x12\x12.context.ContextId\x1a\x16.context.ServiceIdList\"\x00\x12:\n\x0cListServices\x12\x12.context.ContextId\x1a\x14.context.ServiceList\"\x00\x12\x34\n\nGetService\x12\x12.context.ServiceId\x1a\x10.context.Service\"\x00\x12\x34\n\nSetService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rRemoveService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetServiceEvents\x12\x0e.context.Empty\x1a\x15.context.ServiceEvent\"\x00\x30\x01\x12\x44\n\x11ListConnectionIds\x12\x12.context.ServiceId\x1a\x19.context.ConnectionIdList\"\x00\x12@\n\x0fListConnections\x12\x12.context.ServiceId\x1a\x17.context.ConnectionList\"\x00\x12=\n\rGetConnection\x12\x15.context.ConnectionId\x1a\x13.context.Connection\"\x00\x12=\n\rSetConnection\x12\x13.context.Connection\x1a\x15.context.ConnectionId\"\x00\x12;\n\x10RemoveConnection\x12\x15.context.ConnectionId\x1a\x0e.context.Empty\"\x00\x12\x43\n\x13GetConnectionEvents\x12\x0e.context.Empty\x1a\x18.context.ConnectionEvent\"\x00\x30\x01\x62\x06proto3' + serialized_pb=b'\n\rcontext.proto\x12\x07\x63ontext\x1a\x16kpi_sample_types.proto\"\x07\n\x05\x45mpty\"\x14\n\x04Uuid\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"F\n\x05\x45vent\x12\x11\n\ttimestamp\x18\x01 \x01(\x01\x12*\n\nevent_type\x18\x02 \x01(\x0e\x32\x16.context.EventTypeEnum\"0\n\tContextId\x12#\n\x0c\x63ontext_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xb6\x01\n\x07\x43ontext\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12)\n\x0ctopology_ids\x18\x02 \x03(\x0b\x32\x13.context.TopologyId\x12\'\n\x0bservice_ids\x18\x03 \x03(\x0b\x32\x12.context.ServiceId\x12/\n\ncontroller\x18\x04 \x01(\x0b\x32\x1b.context.TeraFlowController\"8\n\rContextIdList\x12\'\n\x0b\x63ontext_ids\x18\x01 \x03(\x0b\x32\x12.context.ContextId\"1\n\x0b\x43ontextList\x12\"\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32\x10.context.Context\"U\n\x0c\x43ontextEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\ncontext_id\x18\x02 \x01(\x0b\x32\x12.context.ContextId\"Z\n\nTopologyId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12$\n\rtopology_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"~\n\x08Topology\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12%\n\ndevice_ids\x18\x02 \x03(\x0b\x32\x11.context.DeviceId\x12!\n\x08link_ids\x18\x03 \x03(\x0b\x32\x0f.context.LinkId\";\n\x0eTopologyIdList\x12)\n\x0ctopology_ids\x18\x01 \x03(\x0b\x32\x13.context.TopologyId\"5\n\x0cTopologyList\x12%\n\ntopologies\x18\x01 \x03(\x0b\x32\x11.context.Topology\"X\n\rTopologyEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12(\n\x0btopology_id\x18\x02 \x01(\x0b\x32\x13.context.TopologyId\".\n\x08\x44\x65viceId\x12\"\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x9a\x02\n\x06\x44\x65vice\x12$\n\tdevice_id\x18\x01 \x01(\x0b\x32\x11.context.DeviceId\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12,\n\rdevice_config\x18\x03 \x01(\x0b\x32\x15.context.DeviceConfig\x12G\n\x19\x64\x65vice_operational_status\x18\x04 \x01(\x0e\x32$.context.DeviceOperationalStatusEnum\x12\x31\n\x0e\x64\x65vice_drivers\x18\x05 \x03(\x0e\x32\x19.context.DeviceDriverEnum\x12+\n\x10\x64\x65vice_endpoints\x18\x06 \x03(\x0b\x32\x11.context.EndPoint\"9\n\x0c\x44\x65viceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"5\n\x0c\x44\x65viceIdList\x12%\n\ndevice_ids\x18\x01 \x03(\x0b\x32\x11.context.DeviceId\".\n\nDeviceList\x12 \n\x07\x64\x65vices\x18\x01 \x03(\x0b\x32\x0f.context.Device\"R\n\x0b\x44\x65viceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"*\n\x06LinkId\x12 \n\tlink_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"X\n\x04Link\x12 \n\x07link_id\x18\x01 \x01(\x0b\x32\x0f.context.LinkId\x12.\n\x11link_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\"/\n\nLinkIdList\x12!\n\x08link_ids\x18\x01 \x03(\x0b\x32\x0f.context.LinkId\"(\n\x08LinkList\x12\x1c\n\x05links\x18\x01 \x03(\x0b\x32\r.context.Link\"L\n\tLinkEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12 \n\x07link_id\x18\x02 \x01(\x0b\x32\x0f.context.LinkId\"X\n\tServiceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12#\n\x0cservice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\xa6\x02\n\x07Service\x12&\n\nservice_id\x18\x01 \x01(\x0b\x32\x12.context.ServiceId\x12.\n\x0cservice_type\x18\x02 \x01(\x0e\x32\x18.context.ServiceTypeEnum\x12\x31\n\x14service_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12\x30\n\x13service_constraints\x18\x04 \x03(\x0b\x32\x13.context.Constraint\x12.\n\x0eservice_status\x18\x05 \x01(\x0b\x32\x16.context.ServiceStatus\x12.\n\x0eservice_config\x18\x06 \x01(\x0b\x32\x16.context.ServiceConfig\"C\n\rServiceStatus\x12\x32\n\x0eservice_status\x18\x01 \x01(\x0e\x32\x1a.context.ServiceStatusEnum\":\n\rServiceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"8\n\rServiceIdList\x12\'\n\x0bservice_ids\x18\x01 \x03(\x0b\x32\x12.context.ServiceId\"1\n\x0bServiceList\x12\"\n\x08services\x18\x01 \x03(\x0b\x32\x10.context.Service\"U\n\x0cServiceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\"T\n\x07SliceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12!\n\nslice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\x95\x02\n\x05Slice\x12\"\n\x08slice_id\x18\x01 \x01(\x0b\x32\x10.context.SliceId\x12/\n\x12slice_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\x12.\n\x11slice_constraints\x18\x03 \x03(\x0b\x32\x13.context.Constraint\x12-\n\x11slice_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\x12,\n\x12slice_subslice_ids\x18\x05 \x03(\x0b\x32\x10.context.SliceId\x12*\n\x0cslice_status\x18\x06 \x01(\x0b\x32\x14.context.SliceStatus\"=\n\x0bSliceStatus\x12.\n\x0cslice_status\x18\x01 \x01(\x0e\x32\x18.context.SliceStatusEnum\"2\n\x0bSliceIdList\x12#\n\tslice_ids\x18\x01 \x03(\x0b\x32\x10.context.SliceId\"+\n\tSliceList\x12\x1e\n\x06slices\x18\x01 \x03(\x0b\x32\x0e.context.Slice\"O\n\nSliceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12\"\n\x08slice_id\x18\x02 \x01(\x0b\x32\x10.context.SliceId\"6\n\x0c\x43onnectionId\x12&\n\x0f\x63onnection_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xc4\x01\n\nConnection\x12,\n\rconnection_id\x18\x01 \x01(\x0b\x32\x15.context.ConnectionId\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\x12\x33\n\x16path_hops_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12+\n\x0fsub_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\"A\n\x10\x43onnectionIdList\x12-\n\x0e\x63onnection_ids\x18\x01 \x03(\x0b\x32\x15.context.ConnectionId\":\n\x0e\x43onnectionList\x12(\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x13.context.Connection\"^\n\x0f\x43onnectionEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12,\n\rconnection_id\x18\x02 \x01(\x0b\x32\x15.context.ConnectionId\"\x82\x01\n\nEndPointId\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\x12$\n\rendpoint_uuid\x18\x03 \x01(\x0b\x32\r.context.Uuid\"\x86\x01\n\x08\x45ndPoint\x12(\n\x0b\x65ndpoint_id\x18\x01 \x01(\x0b\x32\x13.context.EndPointId\x12\x15\n\rendpoint_type\x18\x02 \x01(\t\x12\x39\n\x10kpi_sample_types\x18\x03 \x03(\x0e\x32\x1f.kpi_sample_types.KpiSampleType\"e\n\nConfigRule\x12)\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x19.context.ConfigActionEnum\x12\x14\n\x0cresource_key\x18\x02 \x01(\t\x12\x16\n\x0eresource_value\x18\x03 \x01(\t\"?\n\nConstraint\x12\x17\n\x0f\x63onstraint_type\x18\x01 \x01(\t\x12\x18\n\x10\x63onstraint_value\x18\x02 \x01(\t\"^\n\x12TeraFlowController\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x12\n\nip_address\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\"U\n\x14\x41uthenticationResult\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x15\n\rauthenticated\x18\x02 \x01(\x08*j\n\rEventTypeEnum\x12\x17\n\x13\x45VENTTYPE_UNDEFINED\x10\x00\x12\x14\n\x10\x45VENTTYPE_CREATE\x10\x01\x12\x14\n\x10\x45VENTTYPE_UPDATE\x10\x02\x12\x14\n\x10\x45VENTTYPE_REMOVE\x10\x03*\xc5\x01\n\x10\x44\x65viceDriverEnum\x12\x1a\n\x16\x44\x45VICEDRIVER_UNDEFINED\x10\x00\x12\x1b\n\x17\x44\x45VICEDRIVER_OPENCONFIG\x10\x01\x12\x1e\n\x1a\x44\x45VICEDRIVER_TRANSPORT_API\x10\x02\x12\x13\n\x0f\x44\x45VICEDRIVER_P4\x10\x03\x12&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOGY\x10\x04\x12\x1b\n\x17\x44\x45VICEDRIVER_ONF_TR_352\x10\x05*\x8f\x01\n\x1b\x44\x65viceOperationalStatusEnum\x12%\n!DEVICEOPERATIONALSTATUS_UNDEFINED\x10\x00\x12$\n DEVICEOPERATIONALSTATUS_DISABLED\x10\x01\x12#\n\x1f\x44\x45VICEOPERATIONALSTATUS_ENABLED\x10\x02*\x81\x01\n\x0fServiceTypeEnum\x12\x17\n\x13SERVICETYPE_UNKNOWN\x10\x00\x12\x14\n\x10SERVICETYPE_L3NM\x10\x01\x12\x14\n\x10SERVICETYPE_L2NM\x10\x02\x12)\n%SERVICETYPE_TAPI_CONNECTIVITY_SERVICE\x10\x03*\x88\x01\n\x11ServiceStatusEnum\x12\x1b\n\x17SERVICESTATUS_UNDEFINED\x10\x00\x12\x19\n\x15SERVICESTATUS_PLANNED\x10\x01\x12\x18\n\x14SERVICESTATUS_ACTIVE\x10\x02\x12!\n\x1dSERVICESTATUS_PENDING_REMOVAL\x10\x03*\x8b\x01\n\x0fSliceStatusEnum\x12\x19\n\x15SLICESTATUS_UNDEFINED\x10\x00\x12\x17\n\x13SLICESTATUS_PLANNED\x10\x01\x12\x14\n\x10SLICESTATUS_INIT\x10\x02\x12\x16\n\x12SLICESTATUS_ACTIVE\x10\x03\x12\x16\n\x12SLICESTATUS_DEINIT\x10\x04*]\n\x10\x43onfigActionEnum\x12\x1a\n\x16\x43ONFIGACTION_UNDEFINED\x10\x00\x12\x14\n\x10\x43ONFIGACTION_SET\x10\x01\x12\x17\n\x13\x43ONFIGACTION_DELETE\x10\x02\x32\xef\x12\n\x0e\x43ontextService\x12:\n\x0eListContextIds\x12\x0e.context.Empty\x1a\x16.context.ContextIdList\"\x00\x12\x36\n\x0cListContexts\x12\x0e.context.Empty\x1a\x14.context.ContextList\"\x00\x12\x34\n\nGetContext\x12\x12.context.ContextId\x1a\x10.context.Context\"\x00\x12\x34\n\nSetContext\x12\x10.context.Context\x1a\x12.context.ContextId\"\x00\x12\x35\n\rRemoveContext\x12\x12.context.ContextId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetContextEvents\x12\x0e.context.Empty\x1a\x15.context.ContextEvent\"\x00\x30\x01\x12@\n\x0fListTopologyIds\x12\x12.context.ContextId\x1a\x17.context.TopologyIdList\"\x00\x12=\n\x0eListTopologies\x12\x12.context.ContextId\x1a\x15.context.TopologyList\"\x00\x12\x37\n\x0bGetTopology\x12\x13.context.TopologyId\x1a\x11.context.Topology\"\x00\x12\x37\n\x0bSetTopology\x12\x11.context.Topology\x1a\x13.context.TopologyId\"\x00\x12\x37\n\x0eRemoveTopology\x12\x13.context.TopologyId\x1a\x0e.context.Empty\"\x00\x12?\n\x11GetTopologyEvents\x12\x0e.context.Empty\x1a\x16.context.TopologyEvent\"\x00\x30\x01\x12\x38\n\rListDeviceIds\x12\x0e.context.Empty\x1a\x15.context.DeviceIdList\"\x00\x12\x34\n\x0bListDevices\x12\x0e.context.Empty\x1a\x13.context.DeviceList\"\x00\x12\x31\n\tGetDevice\x12\x11.context.DeviceId\x1a\x0f.context.Device\"\x00\x12\x31\n\tSetDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0cRemoveDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x12;\n\x0fGetDeviceEvents\x12\x0e.context.Empty\x1a\x14.context.DeviceEvent\"\x00\x30\x01\x12\x34\n\x0bListLinkIds\x12\x0e.context.Empty\x1a\x13.context.LinkIdList\"\x00\x12\x30\n\tListLinks\x12\x0e.context.Empty\x1a\x11.context.LinkList\"\x00\x12+\n\x07GetLink\x12\x0f.context.LinkId\x1a\r.context.Link\"\x00\x12+\n\x07SetLink\x12\r.context.Link\x1a\x0f.context.LinkId\"\x00\x12/\n\nRemoveLink\x12\x0f.context.LinkId\x1a\x0e.context.Empty\"\x00\x12\x37\n\rGetLinkEvents\x12\x0e.context.Empty\x1a\x12.context.LinkEvent\"\x00\x30\x01\x12>\n\x0eListServiceIds\x12\x12.context.ContextId\x1a\x16.context.ServiceIdList\"\x00\x12:\n\x0cListServices\x12\x12.context.ContextId\x1a\x14.context.ServiceList\"\x00\x12\x34\n\nGetService\x12\x12.context.ServiceId\x1a\x10.context.Service\"\x00\x12\x34\n\nSetService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rRemoveService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetServiceEvents\x12\x0e.context.Empty\x1a\x15.context.ServiceEvent\"\x00\x30\x01\x12:\n\x0cListSliceIds\x12\x12.context.ContextId\x1a\x14.context.SliceIdList\"\x00\x12\x36\n\nListSlices\x12\x12.context.ContextId\x1a\x12.context.SliceList\"\x00\x12.\n\x08GetSlice\x12\x10.context.SliceId\x1a\x0e.context.Slice\"\x00\x12.\n\x08SetSlice\x12\x0e.context.Slice\x1a\x10.context.SliceId\"\x00\x12\x31\n\x0bRemoveSlice\x12\x10.context.SliceId\x1a\x0e.context.Empty\"\x00\x12\x39\n\x0eGetSliceEvents\x12\x0e.context.Empty\x1a\x13.context.SliceEvent\"\x00\x30\x01\x12\x44\n\x11ListConnectionIds\x12\x12.context.ServiceId\x1a\x19.context.ConnectionIdList\"\x00\x12@\n\x0fListConnections\x12\x12.context.ServiceId\x1a\x17.context.ConnectionList\"\x00\x12=\n\rGetConnection\x12\x15.context.ConnectionId\x1a\x13.context.Connection\"\x00\x12=\n\rSetConnection\x12\x13.context.Connection\x1a\x15.context.ConnectionId\"\x00\x12;\n\x10RemoveConnection\x12\x15.context.ConnectionId\x1a\x0e.context.Empty\"\x00\x12\x43\n\x13GetConnectionEvents\x12\x0e.context.Empty\x1a\x18.context.ConnectionEvent\"\x00\x30\x01\x62\x06proto3' , dependencies=[kpi__sample__types__pb2.DESCRIPTOR,]) @@ -55,8 +55,8 @@ _EVENTTYPEENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=3703, - serialized_end=3809, + serialized_start=4310, + serialized_end=4416, ) _sym_db.RegisterEnumDescriptor(_EVENTTYPEENUM) @@ -101,8 +101,8 @@ _DEVICEDRIVERENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=3812, - serialized_end=4009, + serialized_start=4419, + serialized_end=4616, ) _sym_db.RegisterEnumDescriptor(_DEVICEDRIVERENUM) @@ -132,8 +132,8 @@ _DEVICEOPERATIONALSTATUSENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4012, - serialized_end=4155, + serialized_start=4619, + serialized_end=4762, ) _sym_db.RegisterEnumDescriptor(_DEVICEOPERATIONALSTATUSENUM) @@ -168,8 +168,8 @@ _SERVICETYPEENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4158, - serialized_end=4287, + serialized_start=4765, + serialized_end=4894, ) _sym_db.RegisterEnumDescriptor(_SERVICETYPEENUM) @@ -204,12 +204,53 @@ _SERVICESTATUSENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4290, - serialized_end=4426, + serialized_start=4897, + serialized_end=5033, ) _sym_db.RegisterEnumDescriptor(_SERVICESTATUSENUM) ServiceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICESTATUSENUM) +_SLICESTATUSENUM = _descriptor.EnumDescriptor( + name='SliceStatusEnum', + full_name='context.SliceStatusEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_PLANNED', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_INIT', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_ACTIVE', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_DEINIT', index=4, number=4, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=5036, + serialized_end=5175, +) +_sym_db.RegisterEnumDescriptor(_SLICESTATUSENUM) + +SliceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SLICESTATUSENUM) _CONFIGACTIONENUM = _descriptor.EnumDescriptor( name='ConfigActionEnum', full_name='context.ConfigActionEnum', @@ -235,8 +276,8 @@ _CONFIGACTIONENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4428, - serialized_end=4521, + serialized_start=5177, + serialized_end=5270, ) _sym_db.RegisterEnumDescriptor(_CONFIGACTIONENUM) @@ -262,6 +303,11 @@ SERVICESTATUS_UNDEFINED = 0 SERVICESTATUS_PLANNED = 1 SERVICESTATUS_ACTIVE = 2 SERVICESTATUS_PENDING_REMOVAL = 3 +SLICESTATUS_UNDEFINED = 0 +SLICESTATUS_PLANNED = 1 +SLICESTATUS_INIT = 2 +SLICESTATUS_ACTIVE = 3 +SLICESTATUS_DEINIT = 4 CONFIGACTION_UNDEFINED = 0 CONFIGACTION_SET = 1 CONFIGACTION_DELETE = 2 @@ -1421,6 +1467,247 @@ _SERVICEEVENT = _descriptor.Descriptor( ) +_SLICEID = _descriptor.Descriptor( + name='SliceId', + full_name='context.SliceId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_id', full_name='context.SliceId.context_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_uuid', full_name='context.SliceId.slice_uuid', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2604, + serialized_end=2688, +) + + +_SLICE = _descriptor.Descriptor( + name='Slice', + full_name='context.Slice', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_id', full_name='context.Slice.slice_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_endpoint_ids', full_name='context.Slice.slice_endpoint_ids', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_constraints', full_name='context.Slice.slice_constraints', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_service_ids', full_name='context.Slice.slice_service_ids', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_subslice_ids', full_name='context.Slice.slice_subslice_ids', index=4, + number=5, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_status', full_name='context.Slice.slice_status', index=5, + number=6, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2691, + serialized_end=2968, +) + + +_SLICESTATUS = _descriptor.Descriptor( + name='SliceStatus', + full_name='context.SliceStatus', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_status', full_name='context.SliceStatus.slice_status', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2970, + serialized_end=3031, +) + + +_SLICEIDLIST = _descriptor.Descriptor( + name='SliceIdList', + full_name='context.SliceIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_ids', full_name='context.SliceIdList.slice_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3033, + serialized_end=3083, +) + + +_SLICELIST = _descriptor.Descriptor( + name='SliceList', + full_name='context.SliceList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slices', full_name='context.SliceList.slices', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3085, + serialized_end=3128, +) + + +_SLICEEVENT = _descriptor.Descriptor( + name='SliceEvent', + full_name='context.SliceEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.SliceEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_id', full_name='context.SliceEvent.slice_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3130, + serialized_end=3209, +) + + _CONNECTIONID = _descriptor.Descriptor( name='ConnectionId', full_name='context.ConnectionId', @@ -1448,8 +1735,8 @@ _CONNECTIONID = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2604, - serialized_end=2658, + serialized_start=3211, + serialized_end=3265, ) @@ -1501,8 +1788,8 @@ _CONNECTION = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2661, - serialized_end=2857, + serialized_start=3268, + serialized_end=3464, ) @@ -1533,8 +1820,8 @@ _CONNECTIONIDLIST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2859, - serialized_end=2924, + serialized_start=3466, + serialized_end=3531, ) @@ -1565,8 +1852,8 @@ _CONNECTIONLIST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2926, - serialized_end=2984, + serialized_start=3533, + serialized_end=3591, ) @@ -1604,8 +1891,8 @@ _CONNECTIONEVENT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2986, - serialized_end=3080, + serialized_start=3593, + serialized_end=3687, ) @@ -1650,8 +1937,8 @@ _ENDPOINTID = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3083, - serialized_end=3213, + serialized_start=3690, + serialized_end=3820, ) @@ -1696,8 +1983,8 @@ _ENDPOINT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3216, - serialized_end=3350, + serialized_start=3823, + serialized_end=3957, ) @@ -1742,8 +2029,8 @@ _CONFIGRULE = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3352, - serialized_end=3453, + serialized_start=3959, + serialized_end=4060, ) @@ -1781,8 +2068,8 @@ _CONSTRAINT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3455, - serialized_end=3518, + serialized_start=4062, + serialized_end=4125, ) @@ -1827,8 +2114,8 @@ _TERAFLOWCONTROLLER = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3520, - serialized_end=3614, + serialized_start=4127, + serialized_end=4221, ) @@ -1866,8 +2153,8 @@ _AUTHENTICATIONRESULT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3616, - serialized_end=3701, + serialized_start=4223, + serialized_end=4308, ) _EVENT.fields_by_name['event_type'].enum_type = _EVENTTYPEENUM @@ -1921,6 +2208,19 @@ _SERVICEIDLIST.fields_by_name['service_ids'].message_type = _SERVICEID _SERVICELIST.fields_by_name['services'].message_type = _SERVICE _SERVICEEVENT.fields_by_name['event'].message_type = _EVENT _SERVICEEVENT.fields_by_name['service_id'].message_type = _SERVICEID +_SLICEID.fields_by_name['context_id'].message_type = _CONTEXTID +_SLICEID.fields_by_name['slice_uuid'].message_type = _UUID +_SLICE.fields_by_name['slice_id'].message_type = _SLICEID +_SLICE.fields_by_name['slice_endpoint_ids'].message_type = _ENDPOINTID +_SLICE.fields_by_name['slice_constraints'].message_type = _CONSTRAINT +_SLICE.fields_by_name['slice_service_ids'].message_type = _SERVICEID +_SLICE.fields_by_name['slice_subslice_ids'].message_type = _SLICEID +_SLICE.fields_by_name['slice_status'].message_type = _SLICESTATUS +_SLICESTATUS.fields_by_name['slice_status'].enum_type = _SLICESTATUSENUM +_SLICEIDLIST.fields_by_name['slice_ids'].message_type = _SLICEID +_SLICELIST.fields_by_name['slices'].message_type = _SLICE +_SLICEEVENT.fields_by_name['event'].message_type = _EVENT +_SLICEEVENT.fields_by_name['slice_id'].message_type = _SLICEID _CONNECTIONID.fields_by_name['connection_uuid'].message_type = _UUID _CONNECTION.fields_by_name['connection_id'].message_type = _CONNECTIONID _CONNECTION.fields_by_name['service_id'].message_type = _SERVICEID @@ -1969,6 +2269,12 @@ DESCRIPTOR.message_types_by_name['ServiceConfig'] = _SERVICECONFIG DESCRIPTOR.message_types_by_name['ServiceIdList'] = _SERVICEIDLIST DESCRIPTOR.message_types_by_name['ServiceList'] = _SERVICELIST DESCRIPTOR.message_types_by_name['ServiceEvent'] = _SERVICEEVENT +DESCRIPTOR.message_types_by_name['SliceId'] = _SLICEID +DESCRIPTOR.message_types_by_name['Slice'] = _SLICE +DESCRIPTOR.message_types_by_name['SliceStatus'] = _SLICESTATUS +DESCRIPTOR.message_types_by_name['SliceIdList'] = _SLICEIDLIST +DESCRIPTOR.message_types_by_name['SliceList'] = _SLICELIST +DESCRIPTOR.message_types_by_name['SliceEvent'] = _SLICEEVENT DESCRIPTOR.message_types_by_name['ConnectionId'] = _CONNECTIONID DESCRIPTOR.message_types_by_name['Connection'] = _CONNECTION DESCRIPTOR.message_types_by_name['ConnectionIdList'] = _CONNECTIONIDLIST @@ -1985,6 +2291,7 @@ DESCRIPTOR.enum_types_by_name['DeviceDriverEnum'] = _DEVICEDRIVERENUM DESCRIPTOR.enum_types_by_name['DeviceOperationalStatusEnum'] = _DEVICEOPERATIONALSTATUSENUM DESCRIPTOR.enum_types_by_name['ServiceTypeEnum'] = _SERVICETYPEENUM DESCRIPTOR.enum_types_by_name['ServiceStatusEnum'] = _SERVICESTATUSENUM +DESCRIPTOR.enum_types_by_name['SliceStatusEnum'] = _SLICESTATUSENUM DESCRIPTOR.enum_types_by_name['ConfigActionEnum'] = _CONFIGACTIONENUM _sym_db.RegisterFileDescriptor(DESCRIPTOR) @@ -2205,6 +2512,48 @@ ServiceEvent = _reflection.GeneratedProtocolMessageType('ServiceEvent', (_messag }) _sym_db.RegisterMessage(ServiceEvent) +SliceId = _reflection.GeneratedProtocolMessageType('SliceId', (_message.Message,), { + 'DESCRIPTOR' : _SLICEID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceId) + }) +_sym_db.RegisterMessage(SliceId) + +Slice = _reflection.GeneratedProtocolMessageType('Slice', (_message.Message,), { + 'DESCRIPTOR' : _SLICE, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Slice) + }) +_sym_db.RegisterMessage(Slice) + +SliceStatus = _reflection.GeneratedProtocolMessageType('SliceStatus', (_message.Message,), { + 'DESCRIPTOR' : _SLICESTATUS, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceStatus) + }) +_sym_db.RegisterMessage(SliceStatus) + +SliceIdList = _reflection.GeneratedProtocolMessageType('SliceIdList', (_message.Message,), { + 'DESCRIPTOR' : _SLICEIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceIdList) + }) +_sym_db.RegisterMessage(SliceIdList) + +SliceList = _reflection.GeneratedProtocolMessageType('SliceList', (_message.Message,), { + 'DESCRIPTOR' : _SLICELIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceList) + }) +_sym_db.RegisterMessage(SliceList) + +SliceEvent = _reflection.GeneratedProtocolMessageType('SliceEvent', (_message.Message,), { + 'DESCRIPTOR' : _SLICEEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceEvent) + }) +_sym_db.RegisterMessage(SliceEvent) + ConnectionId = _reflection.GeneratedProtocolMessageType('ConnectionId', (_message.Message,), { 'DESCRIPTOR' : _CONNECTIONID, '__module__' : 'context_pb2' @@ -2291,8 +2640,8 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( index=0, serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_start=4524, - serialized_end=6617, + serialized_start=5273, + serialized_end=7688, methods=[ _descriptor.MethodDescriptor( name='ListContextIds', @@ -2594,10 +2943,70 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( serialized_options=None, create_key=_descriptor._internal_create_key, ), + _descriptor.MethodDescriptor( + name='ListSliceIds', + full_name='context.ContextService.ListSliceIds', + index=30, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SLICEIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListSlices', + full_name='context.ContextService.ListSlices', + index=31, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SLICELIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetSlice', + full_name='context.ContextService.GetSlice', + index=32, + containing_service=None, + input_type=_SLICEID, + output_type=_SLICE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetSlice', + full_name='context.ContextService.SetSlice', + index=33, + containing_service=None, + input_type=_SLICE, + output_type=_SLICEID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveSlice', + full_name='context.ContextService.RemoveSlice', + index=34, + containing_service=None, + input_type=_SLICEID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetSliceEvents', + full_name='context.ContextService.GetSliceEvents', + index=35, + containing_service=None, + input_type=_EMPTY, + output_type=_SLICEEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), _descriptor.MethodDescriptor( name='ListConnectionIds', full_name='context.ContextService.ListConnectionIds', - index=30, + index=36, containing_service=None, input_type=_SERVICEID, output_type=_CONNECTIONIDLIST, @@ -2607,7 +3016,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='ListConnections', full_name='context.ContextService.ListConnections', - index=31, + index=37, containing_service=None, input_type=_SERVICEID, output_type=_CONNECTIONLIST, @@ -2617,7 +3026,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='GetConnection', full_name='context.ContextService.GetConnection', - index=32, + index=38, containing_service=None, input_type=_CONNECTIONID, output_type=_CONNECTION, @@ -2627,7 +3036,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='SetConnection', full_name='context.ContextService.SetConnection', - index=33, + index=39, containing_service=None, input_type=_CONNECTION, output_type=_CONNECTIONID, @@ -2637,7 +3046,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='RemoveConnection', full_name='context.ContextService.RemoveConnection', - index=34, + index=40, containing_service=None, input_type=_CONNECTIONID, output_type=_EMPTY, @@ -2647,7 +3056,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='GetConnectionEvents', full_name='context.ContextService.GetConnectionEvents', - index=35, + index=41, containing_service=None, input_type=_EMPTY, output_type=_CONNECTIONEVENT, diff --git a/src/webui/proto/service_pb2.py b/src/webui/proto/service_pb2.py index 7a006915b8be39710a17faab075e382e322d918f..8e2806c7685e24ab90a3d59a19f1e4f99ebc9712 100644 --- a/src/webui/proto/service_pb2.py +++ b/src/webui/proto/service_pb2.py @@ -20,7 +20,7 @@ DESCRIPTOR = _descriptor.FileDescriptor( syntax='proto3', serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\rservice.proto\x12\x07service\x1a\rcontext.proto2\xfd\x01\n\x0eServiceService\x12\x37\n\rCreateService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x37\n\rUpdateService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rDeleteService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12\x42\n\x11GetConnectionList\x12\x12.context.ServiceId\x1a\x17.context.ConnectionList\"\x00\x62\x06proto3' + serialized_pb=b'\n\rservice.proto\x12\x07service\x1a\rcontext.proto2\xb9\x01\n\x0eServiceService\x12\x37\n\rCreateService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x37\n\rUpdateService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rDeleteService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x62\x06proto3' , dependencies=[context__pb2.DESCRIPTOR,]) @@ -38,7 +38,7 @@ _SERVICESERVICE = _descriptor.ServiceDescriptor( serialized_options=None, create_key=_descriptor._internal_create_key, serialized_start=42, - serialized_end=295, + serialized_end=227, methods=[ _descriptor.MethodDescriptor( name='CreateService', @@ -70,16 +70,6 @@ _SERVICESERVICE = _descriptor.ServiceDescriptor( serialized_options=None, create_key=_descriptor._internal_create_key, ), - _descriptor.MethodDescriptor( - name='GetConnectionList', - full_name='service.ServiceService.GetConnectionList', - index=3, - containing_service=None, - input_type=context__pb2._SERVICEID, - output_type=context__pb2._CONNECTIONLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), ]) _sym_db.RegisterServiceDescriptor(_SERVICESERVICE)