diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c8f78f4dfdebb51bfa985485f404b124a4c4ae60..ecc4236eae7276c5de40a3fd23e0f37945748aa0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,7 +12,6 @@ stages: include: - local: '/manifests/.gitlab-ci.yml' - local: '/src/monitoring/.gitlab-ci.yml' - #- local: '/src/centralizedattackdetector/.gitlab-ci.yml' - local: '/src/compute/.gitlab-ci.yml' - local: '/src/context/.gitlab-ci.yml' - local: '/src/device/.gitlab-ci.yml' @@ -22,7 +21,7 @@ include: - local: '/src/opticalcentralizedattackdetector/.gitlab-ci.yml' #- local: '/src/tester_integration/.gitlab-ci.yml' #- local: '/src/tester_functional/.gitlab-ci.yml' - #- local: '/src/automation/.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/automation/.gitlab-ci.yml' + - local: '/src/l3_distributedattackdetector/.gitlab-ci.yml' + - local: '/src/l3_centralizedattackdetector/.gitlab-ci.yml' + - local: '/src/l3_attackmitigator/.gitlab-ci.yml' diff --git a/deploy_in_kubernetes.sh b/deploy_in_kubernetes.sh index d98fb41e6a64907ffeabaa69dea915217939346e..c4019c7d790930f65aac3c898f75f605fb35611e 100755 --- a/deploy_in_kubernetes.sh +++ b/deploy_in_kubernetes.sh @@ -10,7 +10,7 @@ REGISTRY_IMAGE="" #REGISTRY_IMAGE="http://my-container-registry.local/" # Set the list of components you want to build images for, and deploy. -COMPONENTS="context device automation policy service compute monitoring centralizedattackdetector dbscanserving opticalattackmitigator opticalcentralizedattackdetector" # TODO: include opticalcentralizedattackdetector +COMPONENTS="context device automation policy service compute monitoring dbscanserving opticalattackmitigator opticalcentralizedattackdetector" # Set the tag you want to use for your images. IMAGE_TAG="tf-dev" diff --git a/install_development_dependencies.sh b/install_development_dependencies.sh index f46b5b0081e4190ac0b84f4ea2abd7213b2a30f9..4b66f9c92468cc3b6930e8c4a5372a611b2b965e 100755 --- a/install_development_dependencies.sh +++ b/install_development_dependencies.sh @@ -7,7 +7,7 @@ pip install --upgrade pip setuptools wheel pip-tools pylint pytest pytest-benchm echo "" > requirements.in #TODO: include here your component -COMPONENTS="compute context device service monitoring centralizedattackdetector opticalcentralizedattackdetector opticalattackmitigator dbscanserving" +COMPONENTS="compute context device service monitoring opticalcentralizedattackdetector opticalattackmitigator dbscanserving" # compiling dependencies from all components for component in $COMPONENTS diff --git a/manifests/centralizedattackdetectorservice.yaml b/manifests/centralizedattackdetectorservice.yaml deleted file mode 100644 index faf42a5550098c9e73d19e2587cc508dbd3cf7be..0000000000000000000000000000000000000000 --- a/manifests/centralizedattackdetectorservice.yaml +++ /dev/null @@ -1,70 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: centralizedattackdetectorervice -spec: - selector: - matchLabels: - app: centralizedattackdetectorervice - template: - metadata: - labels: - app: centralizedattackdetectorervice - spec: - terminationGracePeriodSeconds: 5 - containers: - - name: server - image: registry.gitlab.com/teraflow-h2020/controller/centralizedcybersecurity:latest - imagePullPolicy: Always - ports: - - containerPort: 10000 - env: - - name: DB_ENGINE - value: "redis" - - name: REDIS_DATABASE_ID - value: "0" - - name: LOG_LEVEL - value: "DEBUG" - readinessProbe: - exec: - command: ["/bin/grpc_health_probe", "-addr=:10000"] - livenessProbe: - exec: - command: ["/bin/grpc_health_probe", "-addr=:10000"] - resources: - requests: - cpu: 250m - memory: 512Mi - limits: - cpu: 700m - memory: 1024Mi ---- -apiVersion: v1 -kind: Service -metadata: - name: centralizedattackdetectorervice -spec: - type: ClusterIP - selector: - app: centralizedattackdetectorervice - ports: - - name: grpc - port: 10000 - targetPort: 10000 ---- -apiVersion: v1 -kind: Service -metadata: - name: centralizedattackdetectorervice-public - labels: - app: centralizedattackdetectorervice -spec: - type: NodePort - selector: - app: centralizedattackdetectorervice - ports: - - name: grpc - protocol: TCP - port: 10000 - targetPort: 10000 ---- diff --git a/manifests/l3_attackmitigatorservice.yaml b/manifests/l3_attackmitigatorservice.yaml index 7ac91b02fd2b3be51a9e810ae194fb0d7a9bf0d7..34f660324066c7a06b8debff276ed5444027fe4e 100644 --- a/manifests/l3_attackmitigatorservice.yaml +++ b/manifests/l3_attackmitigatorservice.yaml @@ -1,20 +1,20 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: attackmitigatorservice + name: l3_attackmitigatorservice spec: selector: matchLabels: - app: attackmitigatorservice + app: l3_attackmitigatorservice template: metadata: labels: - app: attackmitigatorservice + app: l3_attackmitigatorservice spec: terminationGracePeriodSeconds: 5 containers: - name: server - image: registry.gitlab.com/teraflow-h2020/controller/attackmitigator:latest + image: registry.gitlab.com/teraflow-h2020/controller/l3_attackmitigator:latest imagePullPolicy: Always ports: - containerPort: 10002 @@ -38,11 +38,11 @@ spec: apiVersion: v1 kind: Service metadata: - name: attackmitigatorservice + name: l3_attackmitigatorservice spec: type: ClusterIP selector: - app: attackmitigatorservice + app: l3_attackmitigatorservice ports: - name: grpc port: 10002 diff --git a/manifests/l3_centralizedattackdetectorservice.yaml b/manifests/l3_centralizedattackdetectorservice.yaml index 4b4b629294dc72f0d158b923364bb65d559df624..0393d83c29591d2fa4cc1a2b52abbcdc760de23a 100644 --- a/manifests/l3_centralizedattackdetectorservice.yaml +++ b/manifests/l3_centralizedattackdetectorservice.yaml @@ -1,20 +1,20 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: centralizedattackdetectorservice + name: l3_centralizedattackdetectorservice spec: selector: matchLabels: - app: centralizedattackdetectorservice + app: l3_centralizedattackdetectorservice template: metadata: labels: - app: centralizedattackdetectorservice + app: l3_centralizedattackdetectorservice spec: terminationGracePeriodSeconds: 5 containers: - name: server - image: registry.gitlab.com/teraflow-h2020/controller/centralizedattackdetector:latest + image: registry.gitlab.com/teraflow-h2020/controller/l3_centralizedattackdetector:latest imagePullPolicy: Always ports: - containerPort: 10001 @@ -38,11 +38,11 @@ spec: apiVersion: v1 kind: Service metadata: - name: centralizedattackdetectorservice + name: l3_centralizedattackdetectorservice spec: type: ClusterIP selector: - app: centralizedattackdetectorservice + app: l3_centralizedattackdetectorservice ports: - name: grpc port: 10001 diff --git a/manifests/l3_distributedattackdetectorservice.yaml b/manifests/l3_distributedattackdetectorservice.yaml index 22157d9a4e9faa3af6ea76c6212c7914a0868726..eff047b1b97733f808df01a23a11a930515eb3e5 100644 --- a/manifests/l3_distributedattackdetectorservice.yaml +++ b/manifests/l3_distributedattackdetectorservice.yaml @@ -1,20 +1,20 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: distributedattackdetectorservice + name: l3_distributedattackdetectorservice spec: selector: matchLabels: - app: distributedattackdetectorservice + app: l3_distributedattackdetectorservice template: metadata: labels: - app: distributedattackdetectorservice + app: l3_distributedattackdetectorservice spec: terminationGracePeriodSeconds: 5 containers: - name: server - image: registry.gitlab.com/teraflow-h2020/controller/distributedattackdetector:latest + image: registry.gitlab.com/teraflow-h2020/controller/l3_distributedattackdetector:latest imagePullPolicy: Always ports: - containerPort: 10000 @@ -38,11 +38,11 @@ spec: apiVersion: v1 kind: Service metadata: - name: distributedattackdetectorservice + name: l3_distributedattackdetectorservice spec: type: ClusterIP selector: - app: distributedattackdetectorservice + app: l3_distributedattackdetectorservice ports: - name: grpc port: 10000 diff --git a/manifests/monitoringservice.yaml b/manifests/monitoringservice.yaml index ca5f7108860570044fed9b149ec500c547010f9c..d1b4023fa1db0fcae1e8b6b83ceb665151c35822 100644 --- a/manifests/monitoringservice.yaml +++ b/manifests/monitoringservice.yaml @@ -74,4 +74,4 @@ spec: protocol: TCP port: 8086 targetPort: 8086 ---- \ No newline at end of file +--- diff --git a/report_coverage_centralized_attack_detector.sh b/report_coverage_centralized_attack_detector.sh deleted file mode 100755 index ea34a11315cfdfbc8c05427c8d4f6e78dad4b42c..0000000000000000000000000000000000000000 --- a/report_coverage_centralized_attack_detector.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -./report_coverage_all.sh | grep --color -E -i "^centralizedattackdetector/.*$|$" diff --git a/report_coverage_l3_attackmitigator.sh b/report_coverage_l3_attackmitigator.sh old mode 100644 new mode 100755 diff --git a/report_coverage_l3_centralizedattackdetector.sh b/report_coverage_l3_centralizedattackdetector.sh old mode 100644 new mode 100755 diff --git a/report_coverage_l3_distributedattackdetector.sh b/report_coverage_l3_distributedattackdetector.sh old mode 100644 new mode 100755 diff --git a/run_tests_locally.sh b/run_tests_locally.sh index b483de8062cb884cbdda5530176a97c5dd3f8bfa..eb421c608578dfbc1cb7ef954e319d76437f3f43 100755 --- a/run_tests_locally.sh +++ b/run_tests_locally.sh @@ -30,9 +30,6 @@ coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ common/message_broker/tests/test_unitary.py \ common/rpc_method_wrapper/tests/test_unitary.py -coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ - centralizedattackdetector/tests/test_unitary.py - coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ context/tests/test_unitary.py diff --git a/src/automation/.gitlab-ci.yml b/src/automation/.gitlab-ci.yml index 612a6a107075652c8ee624da661a646d0b3f3d1e..0e87fa4b3a726ddf9ae79c717487ae7a7fedd0e6 100644 --- a/src/automation/.gitlab-ci.yml +++ b/src/automation/.gitlab-ci.yml @@ -2,21 +2,24 @@ build automation: variables: IMAGE_NAME: 'automation' # name of the microservice - IMAGE_NAME_TEST: 'automation-test' # name of the microservice IMAGE_TAG: '0.0.1' # 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 + 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/** + - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml # Run tests, build & push the image unit_test automation: variables: IMAGE_NAME: 'automation' # name of the microservice - IMAGE_NAME_TEST: 'automation-test' # name of the microservice IMAGE_TAG: '0.0.1' # tag of the container image (production, development, etc) stage: unit_test needs: @@ -28,9 +31,14 @@ unit_test automation: - 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" + after_script: + - docker rm -f $IMAGE_NAME 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 - .gitlab-ci.yml # Deployment of automation service in Kubernetes Cluster @@ -45,3 +53,9 @@ deploy automation: - kubectl apply -f "manifests/automationservice.yaml" - kubectl delete pods --selector app=automationservice - kubectl get all + 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/automation/README.md b/src/automation/README.md index a66aab8ca54ea2661b943dc3f2b2d6d18777ca16..099980bcc4172bf9e5c2d59459f40ae4331696cf 100644 --- a/src/automation/README.md +++ b/src/automation/README.md @@ -2,20 +2,38 @@ The Automation service, also known as Zero-Touch Provisioning (ZTP), is tested on Ubuntu 20.04. Follow the instructions below to build, test, and run this service on your local environment. +## Automation Teraflow OS service architecture -## Compile code +| The Automation Teraflow OS service architecture consists of six (6) interfaces listed below: | +|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| 1. The `AutomationGateway` interface that implements all the rpc functions that are described in `automation.proto` file. | +| 2. The `ContextGateway` interface that communicates with a `Context` Service gRPC client and implements all the rpc functions that are described in `context.proto` file. | +| 3. The `DeviceGateway` interface that communicates with a `Device` Service gRPC client and implements all the rpc functions that are described in `device.proto` file. | +| 4. The `AutomationService` interface that implements the `addDevice()` method by communicating with a `Context` gRPC client & a `Device` gRPC client through the use of `ContextService` interface & `DeviceService` interface respectively. | +| 5. The `ContextService` interface that implements the `getDevice()` & `getDeviceEvents()` methods by communicating with a `Context` gRPC client through the use of `ContextGateway` interface. | +| 6. The `DeviceService` interface that implements the `getInitialConfiguration()` & `configureDevice()` methods by communicating with a `Device` gRPC client through the use of `DeviceGateway` interface. | -` -./mvnw compile -` -## Execute unit tests -` -./mvnw test -` -## Run service +## Run with dev profile -` -./mvnw quarkus:dev -` +```bash +./mvnw clean quarkus:dev +``` +## Running tests + +Run unit and functional tests `./mvnw clean test` + +## Deploying on a Kubernetes cluster + +To create the K8s manifest file under `target/kubernetes/kubernetes.yml` to be used run + +```bash +./mvnw clean package -DskipUTs -DskipITs +``` + +To deploy the application in a K8s cluster run + +```bash +kubectl apply -f "manifests/automationservice.yaml" +``` diff --git a/src/automation/pom.xml b/src/automation/pom.xml index 0bf37ea67c0953cc63da34046da93ab281adf76c..042185673a6fd069252fcbe655d33a83ca7b9ff5 100644 --- a/src/automation/pom.xml +++ b/src/automation/pom.xml @@ -83,6 +83,13 @@ </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/automation/src/main/proto/kpi_sample_types.proto b/src/automation/src/main/proto/kpi_sample_types.proto new file mode 120000 index 0000000000000000000000000000000000000000..98e748bbf4fbadbc04c3657f458d733f1bc7bdb8 --- /dev/null +++ b/src/automation/src/main/proto/kpi_sample_types.proto @@ -0,0 +1 @@ +../../../../../proto/kpi_sample_types.proto \ No newline at end of file diff --git a/src/automation/src/main/proto/monitoring.proto b/src/automation/src/main/proto/monitoring.proto new file mode 120000 index 0000000000000000000000000000000000000000..aceaa7328099fe736163be048ee1ad21a61d79a2 --- /dev/null +++ b/src/automation/src/main/proto/monitoring.proto @@ -0,0 +1 @@ +../../../../../proto/monitoring.proto \ No newline at end of file diff --git a/src/automation/target/generated-sources/grpc/context/ContextOuterClass.java b/src/automation/target/generated-sources/grpc/context/ContextOuterClass.java index 21d845ecd69f3ec21bdc185dfac5e2cbd171904d..3decce929e0eb9ac2e50c23f8aa3dba36b4321bf 100644 --- a/src/automation/target/generated-sources/grpc/context/ContextOuterClass.java +++ b/src/automation/target/generated-sources/grpc/context/ContextOuterClass.java @@ -28708,24 +28708,45 @@ public final class ContextOuterClass { context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder(); /** - * <pre> - *repeated kpi_sample_types.KpiSampleType kpi_sample_types = 3; - * </pre> - * * <code>string endpoint_type = 2;</code> * @return The endpointType. */ java.lang.String getEndpointType(); /** - * <pre> - *repeated kpi_sample_types.KpiSampleType kpi_sample_types = 3; - * </pre> - * * <code>string endpoint_type = 2;</code> * @return The bytes for endpointType. */ com.google.protobuf.ByteString getEndpointTypeBytes(); + + /** + * <code>repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3;</code> + * @return A list containing the kpiSampleTypes. + */ + java.util.List<kpi_sample_types.KpiSampleTypes.KpiSampleType> getKpiSampleTypesList(); + /** + * <code>repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3;</code> + * @return The count of kpiSampleTypes. + */ + int getKpiSampleTypesCount(); + /** + * <code>repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3;</code> + * @param index The index of the element to return. + * @return The kpiSampleTypes at the given index. + */ + kpi_sample_types.KpiSampleTypes.KpiSampleType getKpiSampleTypes(int index); + /** + * <code>repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3;</code> + * @return A list containing the enum numeric values on the wire for kpiSampleTypes. + */ + java.util.List<java.lang.Integer> + getKpiSampleTypesValueList(); + /** + * <code>repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3;</code> + * @param index The index of the value to return. + * @return The enum numeric value on the wire of kpiSampleTypes at the given index. + */ + int getKpiSampleTypesValue(int index); } /** * Protobuf type {@code context.EndPoint} @@ -28741,6 +28762,7 @@ public final class ContextOuterClass { } private EndPoint() { endpointType_ = ""; + kpiSampleTypes_ = java.util.Collections.emptyList(); } @java.lang.Override @@ -28763,6 +28785,7 @@ public final class ContextOuterClass { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } + int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -28792,6 +28815,29 @@ public final class ContextOuterClass { endpointType_ = s; break; } + case 24: { + int rawValue = input.readEnum(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + kpiSampleTypes_ = new java.util.ArrayList<java.lang.Integer>(); + mutable_bitField0_ |= 0x00000001; + } + kpiSampleTypes_.add(rawValue); + break; + } + case 26: { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while(input.getBytesUntilLimit() > 0) { + int rawValue = input.readEnum(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + kpiSampleTypes_ = new java.util.ArrayList<java.lang.Integer>(); + mutable_bitField0_ |= 0x00000001; + } + kpiSampleTypes_.add(rawValue); + } + input.popLimit(oldLimit); + break; + } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { @@ -28807,6 +28853,9 @@ public final class ContextOuterClass { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + kpiSampleTypes_ = java.util.Collections.unmodifiableList(kpiSampleTypes_); + } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } @@ -28853,10 +28902,6 @@ public final class ContextOuterClass { public static final int ENDPOINT_TYPE_FIELD_NUMBER = 2; private volatile java.lang.Object endpointType_; /** - * <pre> - *repeated kpi_sample_types.KpiSampleType kpi_sample_types = 3; - * </pre> - * * <code>string endpoint_type = 2;</code> * @return The endpointType. */ @@ -28874,10 +28919,6 @@ public final class ContextOuterClass { } } /** - * <pre> - *repeated kpi_sample_types.KpiSampleType kpi_sample_types = 3; - * </pre> - * * <code>string endpoint_type = 2;</code> * @return The bytes for endpointType. */ @@ -28896,6 +28937,64 @@ public final class ContextOuterClass { } } + public static final int KPI_SAMPLE_TYPES_FIELD_NUMBER = 3; + private java.util.List<java.lang.Integer> kpiSampleTypes_; + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, kpi_sample_types.KpiSampleTypes.KpiSampleType> kpiSampleTypes_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, kpi_sample_types.KpiSampleTypes.KpiSampleType>() { + public kpi_sample_types.KpiSampleTypes.KpiSampleType convert(java.lang.Integer from) { + @SuppressWarnings("deprecation") + kpi_sample_types.KpiSampleTypes.KpiSampleType result = kpi_sample_types.KpiSampleTypes.KpiSampleType.valueOf(from); + return result == null ? kpi_sample_types.KpiSampleTypes.KpiSampleType.UNRECOGNIZED : result; + } + }; + /** + * <code>repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3;</code> + * @return A list containing the kpiSampleTypes. + */ + @java.lang.Override + public java.util.List<kpi_sample_types.KpiSampleTypes.KpiSampleType> getKpiSampleTypesList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, kpi_sample_types.KpiSampleTypes.KpiSampleType>(kpiSampleTypes_, kpiSampleTypes_converter_); + } + /** + * <code>repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3;</code> + * @return The count of kpiSampleTypes. + */ + @java.lang.Override + public int getKpiSampleTypesCount() { + return kpiSampleTypes_.size(); + } + /** + * <code>repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3;</code> + * @param index The index of the element to return. + * @return The kpiSampleTypes at the given index. + */ + @java.lang.Override + public kpi_sample_types.KpiSampleTypes.KpiSampleType getKpiSampleTypes(int index) { + return kpiSampleTypes_converter_.convert(kpiSampleTypes_.get(index)); + } + /** + * <code>repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3;</code> + * @return A list containing the enum numeric values on the wire for kpiSampleTypes. + */ + @java.lang.Override + public java.util.List<java.lang.Integer> + getKpiSampleTypesValueList() { + return kpiSampleTypes_; + } + /** + * <code>repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3;</code> + * @param index The index of the value to return. + * @return The enum numeric value on the wire of kpiSampleTypes at the given index. + */ + @java.lang.Override + public int getKpiSampleTypesValue(int index) { + return kpiSampleTypes_.get(index); + } + private int kpiSampleTypesMemoizedSerializedSize; + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -28910,12 +29009,20 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); if (endpointId_ != null) { output.writeMessage(1, getEndpointId()); } if (!getEndpointTypeBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, endpointType_); } + if (getKpiSampleTypesList().size() > 0) { + output.writeUInt32NoTag(26); + output.writeUInt32NoTag(kpiSampleTypesMemoizedSerializedSize); + } + for (int i = 0; i < kpiSampleTypes_.size(); i++) { + output.writeEnumNoTag(kpiSampleTypes_.get(i)); + } unknownFields.writeTo(output); } @@ -28932,6 +29039,18 @@ public final class ContextOuterClass { if (!getEndpointTypeBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, endpointType_); } + { + int dataSize = 0; + for (int i = 0; i < kpiSampleTypes_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeEnumSizeNoTag(kpiSampleTypes_.get(i)); + } + size += dataSize; + if (!getKpiSampleTypesList().isEmpty()) { size += 1; + size += com.google.protobuf.CodedOutputStream + .computeUInt32SizeNoTag(dataSize); + }kpiSampleTypesMemoizedSerializedSize = dataSize; + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -28954,6 +29073,7 @@ public final class ContextOuterClass { } if (!getEndpointType() .equals(other.getEndpointType())) return false; + if (!kpiSampleTypes_.equals(other.kpiSampleTypes_)) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -28971,6 +29091,10 @@ public final class ContextOuterClass { } hash = (37 * hash) + ENDPOINT_TYPE_FIELD_NUMBER; hash = (53 * hash) + getEndpointType().hashCode(); + if (getKpiSampleTypesCount() > 0) { + hash = (37 * hash) + KPI_SAMPLE_TYPES_FIELD_NUMBER; + hash = (53 * hash) + kpiSampleTypes_.hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -29112,6 +29236,8 @@ public final class ContextOuterClass { } endpointType_ = ""; + kpiSampleTypes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); return this; } @@ -29138,12 +29264,18 @@ public final class ContextOuterClass { @java.lang.Override public context.ContextOuterClass.EndPoint buildPartial() { context.ContextOuterClass.EndPoint result = new context.ContextOuterClass.EndPoint(this); + int from_bitField0_ = bitField0_; if (endpointIdBuilder_ == null) { result.endpointId_ = endpointId_; } else { result.endpointId_ = endpointIdBuilder_.build(); } result.endpointType_ = endpointType_; + if (((bitField0_ & 0x00000001) != 0)) { + kpiSampleTypes_ = java.util.Collections.unmodifiableList(kpiSampleTypes_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.kpiSampleTypes_ = kpiSampleTypes_; onBuilt(); return result; } @@ -29199,6 +29331,16 @@ public final class ContextOuterClass { endpointType_ = other.endpointType_; onChanged(); } + if (!other.kpiSampleTypes_.isEmpty()) { + if (kpiSampleTypes_.isEmpty()) { + kpiSampleTypes_ = other.kpiSampleTypes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureKpiSampleTypesIsMutable(); + kpiSampleTypes_.addAll(other.kpiSampleTypes_); + } + onChanged(); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -29227,6 +29369,7 @@ public final class ContextOuterClass { } return this; } + private int bitField0_; private context.ContextOuterClass.EndPointId endpointId_; private com.google.protobuf.SingleFieldBuilderV3< @@ -29349,10 +29492,6 @@ public final class ContextOuterClass { private java.lang.Object endpointType_ = ""; /** - * <pre> - *repeated kpi_sample_types.KpiSampleType kpi_sample_types = 3; - * </pre> - * * <code>string endpoint_type = 2;</code> * @return The endpointType. */ @@ -29369,10 +29508,6 @@ public final class ContextOuterClass { } } /** - * <pre> - *repeated kpi_sample_types.KpiSampleType kpi_sample_types = 3; - * </pre> - * * <code>string endpoint_type = 2;</code> * @return The bytes for endpointType. */ @@ -29390,10 +29525,6 @@ public final class ContextOuterClass { } } /** - * <pre> - *repeated kpi_sample_types.KpiSampleType kpi_sample_types = 3; - * </pre> - * * <code>string endpoint_type = 2;</code> * @param value The endpointType to set. * @return This builder for chaining. @@ -29409,10 +29540,6 @@ public final class ContextOuterClass { return this; } /** - * <pre> - *repeated kpi_sample_types.KpiSampleType kpi_sample_types = 3; - * </pre> - * * <code>string endpoint_type = 2;</code> * @return This builder for chaining. */ @@ -29423,10 +29550,6 @@ public final class ContextOuterClass { return this; } /** - * <pre> - *repeated kpi_sample_types.KpiSampleType kpi_sample_types = 3; - * </pre> - * * <code>string endpoint_type = 2;</code> * @param value The bytes for endpointType to set. * @return This builder for chaining. @@ -29442,6 +29565,146 @@ public final class ContextOuterClass { onChanged(); return this; } + + private java.util.List<java.lang.Integer> kpiSampleTypes_ = + java.util.Collections.emptyList(); + private void ensureKpiSampleTypesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + kpiSampleTypes_ = new java.util.ArrayList<java.lang.Integer>(kpiSampleTypes_); + bitField0_ |= 0x00000001; + } + } + /** + * <code>repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3;</code> + * @return A list containing the kpiSampleTypes. + */ + public java.util.List<kpi_sample_types.KpiSampleTypes.KpiSampleType> getKpiSampleTypesList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, kpi_sample_types.KpiSampleTypes.KpiSampleType>(kpiSampleTypes_, kpiSampleTypes_converter_); + } + /** + * <code>repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3;</code> + * @return The count of kpiSampleTypes. + */ + public int getKpiSampleTypesCount() { + return kpiSampleTypes_.size(); + } + /** + * <code>repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3;</code> + * @param index The index of the element to return. + * @return The kpiSampleTypes at the given index. + */ + public kpi_sample_types.KpiSampleTypes.KpiSampleType getKpiSampleTypes(int index) { + return kpiSampleTypes_converter_.convert(kpiSampleTypes_.get(index)); + } + /** + * <code>repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3;</code> + * @param index The index to set the value at. + * @param value The kpiSampleTypes to set. + * @return This builder for chaining. + */ + public Builder setKpiSampleTypes( + int index, kpi_sample_types.KpiSampleTypes.KpiSampleType value) { + if (value == null) { + throw new NullPointerException(); + } + ensureKpiSampleTypesIsMutable(); + kpiSampleTypes_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * <code>repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3;</code> + * @param value The kpiSampleTypes to add. + * @return This builder for chaining. + */ + public Builder addKpiSampleTypes(kpi_sample_types.KpiSampleTypes.KpiSampleType value) { + if (value == null) { + throw new NullPointerException(); + } + ensureKpiSampleTypesIsMutable(); + kpiSampleTypes_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * <code>repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3;</code> + * @param values The kpiSampleTypes to add. + * @return This builder for chaining. + */ + public Builder addAllKpiSampleTypes( + java.lang.Iterable<? extends kpi_sample_types.KpiSampleTypes.KpiSampleType> values) { + ensureKpiSampleTypesIsMutable(); + for (kpi_sample_types.KpiSampleTypes.KpiSampleType value : values) { + kpiSampleTypes_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * <code>repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3;</code> + * @return This builder for chaining. + */ + public Builder clearKpiSampleTypes() { + kpiSampleTypes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * <code>repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3;</code> + * @return A list containing the enum numeric values on the wire for kpiSampleTypes. + */ + public java.util.List<java.lang.Integer> + getKpiSampleTypesValueList() { + return java.util.Collections.unmodifiableList(kpiSampleTypes_); + } + /** + * <code>repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3;</code> + * @param index The index of the value to return. + * @return The enum numeric value on the wire of kpiSampleTypes at the given index. + */ + public int getKpiSampleTypesValue(int index) { + return kpiSampleTypes_.get(index); + } + /** + * <code>repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3;</code> + * @param index The index of the value to return. + * @return The enum numeric value on the wire of kpiSampleTypes at the given index. + * @return This builder for chaining. + */ + public Builder setKpiSampleTypesValue( + int index, int value) { + ensureKpiSampleTypesIsMutable(); + kpiSampleTypes_.set(index, value); + onChanged(); + return this; + } + /** + * <code>repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3;</code> + * @param value The enum numeric value on the wire for kpiSampleTypes to add. + * @return This builder for chaining. + */ + public Builder addKpiSampleTypesValue(int value) { + ensureKpiSampleTypesIsMutable(); + kpiSampleTypes_.add(value); + onChanged(); + return this; + } + /** + * <code>repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3;</code> + * @param values The enum numeric values on the wire for kpiSampleTypes to add. + * @return This builder for chaining. + */ + public Builder addAllKpiSampleTypesValue( + java.lang.Iterable<java.lang.Integer> values) { + ensureKpiSampleTypesIsMutable(); + for (int value : values) { + kpiSampleTypes_.add(value); + } + onChanged(); + return this; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -36215,160 +36478,164 @@ public final class ContextOuterClass { descriptor; static { java.lang.String[] descriptorData = { - "\n\rcontext.proto\022\007context\"\007\n\005Empty\"\024\n\004Uui" + - "d\022\014\n\004uuid\030\001 \001(\t\"F\n\005Event\022\021\n\ttimestamp\030\001 " + - "\001(\001\022*\n\nevent_type\030\002 \001(\0162\026.context.EventT" + - "ypeEnum\"0\n\tContextId\022#\n\014context_uuid\030\001 \001" + - "(\0132\r.context.Uuid\"\266\001\n\007Context\022&\n\ncontext" + - "_id\030\001 \001(\0132\022.context.ContextId\022)\n\014topolog" + - "y_ids\030\002 \003(\0132\023.context.TopologyId\022\'\n\013serv" + - "ice_ids\030\003 \003(\0132\022.context.ServiceId\022/\n\ncon" + - "troller\030\004 \001(\0132\033.context.TeraFlowControll" + - "er\"8\n\rContextIdList\022\'\n\013context_ids\030\001 \003(\013" + - "2\022.context.ContextId\"1\n\013ContextList\022\"\n\010c" + - "ontexts\030\001 \003(\0132\020.context.Context\"U\n\014Conte" + - "xtEvent\022\035\n\005event\030\001 \001(\0132\016.context.Event\022&" + - "\n\ncontext_id\030\002 \001(\0132\022.context.ContextId\"Z" + - "\n\nTopologyId\022&\n\ncontext_id\030\001 \001(\0132\022.conte" + - "xt.ContextId\022$\n\rtopology_uuid\030\002 \001(\0132\r.co" + - "ntext.Uuid\"~\n\010Topology\022(\n\013topology_id\030\001 " + - "\001(\0132\023.context.TopologyId\022%\n\ndevice_ids\030\002" + - " \003(\0132\021.context.DeviceId\022!\n\010link_ids\030\003 \003(" + - "\0132\017.context.LinkId\";\n\016TopologyIdList\022)\n\014" + - "topology_ids\030\001 \003(\0132\023.context.TopologyId\"" + - "5\n\014TopologyList\022%\n\ntopologies\030\001 \003(\0132\021.co" + - "ntext.Topology\"X\n\rTopologyEvent\022\035\n\005event" + - "\030\001 \001(\0132\016.context.Event\022(\n\013topology_id\030\002 " + - "\001(\0132\023.context.TopologyId\".\n\010DeviceId\022\"\n\013" + - "device_uuid\030\001 \001(\0132\r.context.Uuid\"\232\002\n\006Dev" + - "ice\022$\n\tdevice_id\030\001 \001(\0132\021.context.DeviceI" + - "d\022\023\n\013device_type\030\002 \001(\t\022,\n\rdevice_config\030" + - "\003 \001(\0132\025.context.DeviceConfig\022G\n\031device_o" + - "perational_status\030\004 \001(\0162$.context.Device" + - "OperationalStatusEnum\0221\n\016device_drivers\030" + - "\005 \003(\0162\031.context.DeviceDriverEnum\022+\n\020devi" + - "ce_endpoints\030\006 \003(\0132\021.context.EndPoint\"9\n" + - "\014DeviceConfig\022)\n\014config_rules\030\001 \003(\0132\023.co" + - "ntext.ConfigRule\"5\n\014DeviceIdList\022%\n\ndevi" + - "ce_ids\030\001 \003(\0132\021.context.DeviceId\".\n\nDevic" + - "eList\022 \n\007devices\030\001 \003(\0132\017.context.Device\"" + - "R\n\013DeviceEvent\022\035\n\005event\030\001 \001(\0132\016.context." + - "Event\022$\n\tdevice_id\030\002 \001(\0132\021.context.Devic" + - "eId\"*\n\006LinkId\022 \n\tlink_uuid\030\001 \001(\0132\r.conte" + - "xt.Uuid\"X\n\004Link\022 \n\007link_id\030\001 \001(\0132\017.conte" + - "xt.LinkId\022.\n\021link_endpoint_ids\030\002 \003(\0132\023.c" + - "ontext.EndPointId\"/\n\nLinkIdList\022!\n\010link_" + - "ids\030\001 \003(\0132\017.context.LinkId\"(\n\010LinkList\022\034" + - "\n\005links\030\001 \003(\0132\r.context.Link\"L\n\tLinkEven" + - "t\022\035\n\005event\030\001 \001(\0132\016.context.Event\022 \n\007link" + - "_id\030\002 \001(\0132\017.context.LinkId\"X\n\tServiceId\022" + - "&\n\ncontext_id\030\001 \001(\0132\022.context.ContextId\022" + - "#\n\014service_uuid\030\002 \001(\0132\r.context.Uuid\"\246\002\n" + - "\007Service\022&\n\nservice_id\030\001 \001(\0132\022.context.S" + - "erviceId\022.\n\014service_type\030\002 \001(\0162\030.context" + - ".ServiceTypeEnum\0221\n\024service_endpoint_ids" + - "\030\003 \003(\0132\023.context.EndPointId\0220\n\023service_c" + - "onstraints\030\004 \003(\0132\023.context.Constraint\022.\n" + - "\016service_status\030\005 \001(\0132\026.context.ServiceS" + - "tatus\022.\n\016service_config\030\006 \001(\0132\026.context." + - "ServiceConfig\"C\n\rServiceStatus\0222\n\016servic" + - "e_status\030\001 \001(\0162\032.context.ServiceStatusEn" + - "um\":\n\rServiceConfig\022)\n\014config_rules\030\001 \003(" + - "\0132\023.context.ConfigRule\"8\n\rServiceIdList\022" + - "\'\n\013service_ids\030\001 \003(\0132\022.context.ServiceId" + - "\"1\n\013ServiceList\022\"\n\010services\030\001 \003(\0132\020.cont" + - "ext.Service\"U\n\014ServiceEvent\022\035\n\005event\030\001 \001" + - "(\0132\016.context.Event\022&\n\nservice_id\030\002 \001(\0132\022" + - ".context.ServiceId\"\202\001\n\nEndPointId\022(\n\013top" + - "ology_id\030\001 \001(\0132\023.context.TopologyId\022$\n\td" + - "evice_id\030\002 \001(\0132\021.context.DeviceId\022$\n\rend" + - "point_uuid\030\003 \001(\0132\r.context.Uuid\"K\n\010EndPo" + - "int\022(\n\013endpoint_id\030\001 \001(\0132\023.context.EndPo" + - "intId\022\025\n\rendpoint_type\030\002 \001(\t\"e\n\nConfigRu" + - "le\022)\n\006action\030\001 \001(\0162\031.context.ConfigActio" + - "nEnum\022\024\n\014resource_key\030\002 \001(\t\022\026\n\016resource_" + - "value\030\003 \001(\t\"?\n\nConstraint\022\027\n\017constraint_" + - "type\030\001 \001(\t\022\030\n\020constraint_value\030\002 \001(\t\"6\n\014" + - "ConnectionId\022&\n\017connection_uuid\030\001 \001(\0132\r." + - "context.Uuid\"\215\001\n\nConnection\022,\n\rconnectio" + - "n_id\030\001 \001(\0132\025.context.ConnectionId\022.\n\022rel" + - "ated_service_id\030\002 \001(\0132\022.context.ServiceI" + - "d\022!\n\004path\030\003 \003(\0132\023.context.EndPointId\"A\n\020" + - "ConnectionIdList\022-\n\016connection_ids\030\001 \003(\013" + - "2\025.context.ConnectionId\":\n\016ConnectionLis" + - "t\022(\n\013connections\030\001 \003(\0132\023.context.Connect" + - "ion\"^\n\022TeraFlowController\022&\n\ncontext_id\030" + - "\001 \001(\0132\022.context.ContextId\022\022\n\nip_address\030" + - "\002 \001(\t\022\014\n\004port\030\003 \001(\r\"U\n\024AuthenticationRes" + - "ult\022&\n\ncontext_id\030\001 \001(\0132\022.context.Contex" + - "tId\022\025\n\rauthenticated\030\002 \001(\010*j\n\rEventTypeE" + - "num\022\027\n\023EVENTTYPE_UNDEFINED\020\000\022\024\n\020EVENTTYP" + - "E_CREATE\020\001\022\024\n\020EVENTTYPE_UPDATE\020\002\022\024\n\020EVEN" + - "TTYPE_REMOVE\020\003*\305\001\n\020DeviceDriverEnum\022\032\n\026D" + - "EVICEDRIVER_UNDEFINED\020\000\022\033\n\027DEVICEDRIVER_" + - "OPENCONFIG\020\001\022\036\n\032DEVICEDRIVER_TRANSPORT_A" + - "PI\020\002\022\023\n\017DEVICEDRIVER_P4\020\003\022&\n\"DEVICEDRIVE" + - "R_IETF_NETWORK_TOPOLOGY\020\004\022\033\n\027DEVICEDRIVE" + - "R_ONF_TR_352\020\005*\217\001\n\033DeviceOperationalStat" + - "usEnum\022%\n!DEVICEOPERATIONALSTATUS_UNDEFI" + - "NED\020\000\022$\n DEVICEOPERATIONALSTATUS_DISABLE" + - "D\020\001\022#\n\037DEVICEOPERATIONALSTATUS_ENABLED\020\002" + - "*\201\001\n\017ServiceTypeEnum\022\027\n\023SERVICETYPE_UNKN" + - "OWN\020\000\022\024\n\020SERVICETYPE_L3NM\020\001\022\024\n\020SERVICETY" + - "PE_L2NM\020\002\022)\n%SERVICETYPE_TAPI_CONNECTIVI" + - "TY_SERVICE\020\003*\210\001\n\021ServiceStatusEnum\022\033\n\027SE" + - "RVICESTATUS_UNDEFINED\020\000\022\031\n\025SERVICESTATUS" + - "_PLANNED\020\001\022\030\n\024SERVICESTATUS_ACTIVE\020\002\022!\n\035" + - "SERVICESTATUS_PENDING_REMOVAL\020\003*]\n\020Confi" + - "gActionEnum\022\032\n\026CONFIGACTION_UNDEFINED\020\000\022" + - "\024\n\020CONFIGACTION_SET\020\001\022\027\n\023CONFIGACTION_DE" + - "LETE\020\0022\245\r\n\016ContextService\022:\n\016ListContext" + - "Ids\022\016.context.Empty\032\026.context.ContextIdL" + - "ist\"\000\0226\n\014ListContexts\022\016.context.Empty\032\024." + - "context.ContextList\"\000\0224\n\nGetContext\022\022.co" + - "ntext.ContextId\032\020.context.Context\"\000\0224\n\nS" + - "etContext\022\020.context.Context\032\022.context.Co" + - "ntextId\"\000\0225\n\rRemoveContext\022\022.context.Con" + - "textId\032\016.context.Empty\"\000\022=\n\020GetContextEv" + - "ents\022\016.context.Empty\032\025.context.ContextEv" + - "ent\"\0000\001\022@\n\017ListTopologyIds\022\022.context.Con" + - "textId\032\027.context.TopologyIdList\"\000\022=\n\016Lis" + - "tTopologies\022\022.context.ContextId\032\025.contex" + - "t.TopologyList\"\000\0227\n\013GetTopology\022\023.contex" + - "t.TopologyId\032\021.context.Topology\"\000\0227\n\013Set" + - "Topology\022\021.context.Topology\032\023.context.To" + - "pologyId\"\000\0227\n\016RemoveTopology\022\023.context.T" + - "opologyId\032\016.context.Empty\"\000\022?\n\021GetTopolo" + - "gyEvents\022\016.context.Empty\032\026.context.Topol" + - "ogyEvent\"\0000\001\0228\n\rListDeviceIds\022\016.context." + - "Empty\032\025.context.DeviceIdList\"\000\0224\n\013ListDe" + - "vices\022\016.context.Empty\032\023.context.DeviceLi" + - "st\"\000\0221\n\tGetDevice\022\021.context.DeviceId\032\017.c" + - "ontext.Device\"\000\0221\n\tSetDevice\022\017.context.D" + - "evice\032\021.context.DeviceId\"\000\0223\n\014RemoveDevi" + - "ce\022\021.context.DeviceId\032\016.context.Empty\"\000\022" + - ";\n\017GetDeviceEvents\022\016.context.Empty\032\024.con" + - "text.DeviceEvent\"\0000\001\0224\n\013ListLinkIds\022\016.co" + - "ntext.Empty\032\023.context.LinkIdList\"\000\0220\n\tLi" + - "stLinks\022\016.context.Empty\032\021.context.LinkLi" + - "st\"\000\022+\n\007GetLink\022\017.context.LinkId\032\r.conte" + - "xt.Link\"\000\022+\n\007SetLink\022\r.context.Link\032\017.co" + - "ntext.LinkId\"\000\022/\n\nRemoveLink\022\017.context.L" + - "inkId\032\016.context.Empty\"\000\0227\n\rGetLinkEvents" + - "\022\016.context.Empty\032\022.context.LinkEvent\"\0000\001" + - "\022>\n\016ListServiceIds\022\022.context.ContextId\032\026" + - ".context.ServiceIdList\"\000\022:\n\014ListServices" + - "\022\022.context.ContextId\032\024.context.ServiceLi" + - "st\"\000\0224\n\nGetService\022\022.context.ServiceId\032\020" + - ".context.Service\"\000\0224\n\nSetService\022\020.conte" + - "xt.Service\032\022.context.ServiceId\"\000\0225\n\rRemo" + - "veService\022\022.context.ServiceId\032\016.context." + - "Empty\"\000\022=\n\020GetServiceEvents\022\016.context.Em" + - "pty\032\025.context.ServiceEvent\"\0000\001b\006proto3" + "\n\rcontext.proto\022\007context\032\026kpi_sample_typ" + + "es.proto\"\007\n\005Empty\"\024\n\004Uuid\022\014\n\004uuid\030\001 \001(\t\"" + + "F\n\005Event\022\021\n\ttimestamp\030\001 \001(\001\022*\n\nevent_typ" + + "e\030\002 \001(\0162\026.context.EventTypeEnum\"0\n\tConte" + + "xtId\022#\n\014context_uuid\030\001 \001(\0132\r.context.Uui" + + "d\"\266\001\n\007Context\022&\n\ncontext_id\030\001 \001(\0132\022.cont" + + "ext.ContextId\022)\n\014topology_ids\030\002 \003(\0132\023.co" + + "ntext.TopologyId\022\'\n\013service_ids\030\003 \003(\0132\022." + + "context.ServiceId\022/\n\ncontroller\030\004 \001(\0132\033." + + "context.TeraFlowController\"8\n\rContextIdL" + + "ist\022\'\n\013context_ids\030\001 \003(\0132\022.context.Conte" + + "xtId\"1\n\013ContextList\022\"\n\010contexts\030\001 \003(\0132\020." + + "context.Context\"U\n\014ContextEvent\022\035\n\005event" + + "\030\001 \001(\0132\016.context.Event\022&\n\ncontext_id\030\002 \001" + + "(\0132\022.context.ContextId\"Z\n\nTopologyId\022&\n\n" + + "context_id\030\001 \001(\0132\022.context.ContextId\022$\n\r" + + "topology_uuid\030\002 \001(\0132\r.context.Uuid\"~\n\010To" + + "pology\022(\n\013topology_id\030\001 \001(\0132\023.context.To" + + "pologyId\022%\n\ndevice_ids\030\002 \003(\0132\021.context.D" + + "eviceId\022!\n\010link_ids\030\003 \003(\0132\017.context.Link" + + "Id\";\n\016TopologyIdList\022)\n\014topology_ids\030\001 \003" + + "(\0132\023.context.TopologyId\"5\n\014TopologyList\022" + + "%\n\ntopologies\030\001 \003(\0132\021.context.Topology\"X" + + "\n\rTopologyEvent\022\035\n\005event\030\001 \001(\0132\016.context" + + ".Event\022(\n\013topology_id\030\002 \001(\0132\023.context.To" + + "pologyId\".\n\010DeviceId\022\"\n\013device_uuid\030\001 \001(" + + "\0132\r.context.Uuid\"\232\002\n\006Device\022$\n\tdevice_id" + + "\030\001 \001(\0132\021.context.DeviceId\022\023\n\013device_type" + + "\030\002 \001(\t\022,\n\rdevice_config\030\003 \001(\0132\025.context." + + "DeviceConfig\022G\n\031device_operational_statu" + + "s\030\004 \001(\0162$.context.DeviceOperationalStatu" + + "sEnum\0221\n\016device_drivers\030\005 \003(\0162\031.context." + + "DeviceDriverEnum\022+\n\020device_endpoints\030\006 \003" + + "(\0132\021.context.EndPoint\"9\n\014DeviceConfig\022)\n" + + "\014config_rules\030\001 \003(\0132\023.context.ConfigRule" + + "\"5\n\014DeviceIdList\022%\n\ndevice_ids\030\001 \003(\0132\021.c" + + "ontext.DeviceId\".\n\nDeviceList\022 \n\007devices" + + "\030\001 \003(\0132\017.context.Device\"R\n\013DeviceEvent\022\035" + + "\n\005event\030\001 \001(\0132\016.context.Event\022$\n\tdevice_" + + "id\030\002 \001(\0132\021.context.DeviceId\"*\n\006LinkId\022 \n" + + "\tlink_uuid\030\001 \001(\0132\r.context.Uuid\"X\n\004Link\022" + + " \n\007link_id\030\001 \001(\0132\017.context.LinkId\022.\n\021lin" + + "k_endpoint_ids\030\002 \003(\0132\023.context.EndPointI" + + "d\"/\n\nLinkIdList\022!\n\010link_ids\030\001 \003(\0132\017.cont" + + "ext.LinkId\"(\n\010LinkList\022\034\n\005links\030\001 \003(\0132\r." + + "context.Link\"L\n\tLinkEvent\022\035\n\005event\030\001 \001(\013" + + "2\016.context.Event\022 \n\007link_id\030\002 \001(\0132\017.cont" + + "ext.LinkId\"X\n\tServiceId\022&\n\ncontext_id\030\001 " + + "\001(\0132\022.context.ContextId\022#\n\014service_uuid\030" + + "\002 \001(\0132\r.context.Uuid\"\246\002\n\007Service\022&\n\nserv" + + "ice_id\030\001 \001(\0132\022.context.ServiceId\022.\n\014serv" + + "ice_type\030\002 \001(\0162\030.context.ServiceTypeEnum" + + "\0221\n\024service_endpoint_ids\030\003 \003(\0132\023.context" + + ".EndPointId\0220\n\023service_constraints\030\004 \003(\013" + + "2\023.context.Constraint\022.\n\016service_status\030" + + "\005 \001(\0132\026.context.ServiceStatus\022.\n\016service" + + "_config\030\006 \001(\0132\026.context.ServiceConfig\"C\n" + + "\rServiceStatus\0222\n\016service_status\030\001 \001(\0162\032" + + ".context.ServiceStatusEnum\":\n\rServiceCon" + + "fig\022)\n\014config_rules\030\001 \003(\0132\023.context.Conf" + + "igRule\"8\n\rServiceIdList\022\'\n\013service_ids\030\001" + + " \003(\0132\022.context.ServiceId\"1\n\013ServiceList\022" + + "\"\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\"\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(\013" + + "2\r.context.Uuid\"\206\001\n\010EndPoint\022(\n\013endpoint" + + "_id\030\001 \001(\0132\023.context.EndPointId\022\025\n\rendpoi" + + "nt_type\030\002 \001(\t\0229\n\020kpi_sample_types\030\003 \003(\0162" + + "\037.kpi_sample_types.KpiSampleType\"e\n\nConf" + + "igRule\022)\n\006action\030\001 \001(\0162\031.context.ConfigA" + + "ctionEnum\022\024\n\014resource_key\030\002 \001(\t\022\026\n\016resou" + + "rce_value\030\003 \001(\t\"?\n\nConstraint\022\027\n\017constra" + + "int_type\030\001 \001(\t\022\030\n\020constraint_value\030\002 \001(\t" + + "\"6\n\014ConnectionId\022&\n\017connection_uuid\030\001 \001(" + + "\0132\r.context.Uuid\"\215\001\n\nConnection\022,\n\rconne" + + "ction_id\030\001 \001(\0132\025.context.ConnectionId\022.\n" + + "\022related_service_id\030\002 \001(\0132\022.context.Serv" + + "iceId\022!\n\004path\030\003 \003(\0132\023.context.EndPointId" + + "\"A\n\020ConnectionIdList\022-\n\016connection_ids\030\001" + + " \003(\0132\025.context.ConnectionId\":\n\016Connectio" + + "nList\022(\n\013connections\030\001 \003(\0132\023.context.Con" + + "nection\"^\n\022TeraFlowController\022&\n\ncontext" + + "_id\030\001 \001(\0132\022.context.ContextId\022\022\n\nip_addr" + + "ess\030\002 \001(\t\022\014\n\004port\030\003 \001(\r\"U\n\024Authenticatio" + + "nResult\022&\n\ncontext_id\030\001 \001(\0132\022.context.Co" + + "ntextId\022\025\n\rauthenticated\030\002 \001(\010*j\n\rEventT" + + "ypeEnum\022\027\n\023EVENTTYPE_UNDEFINED\020\000\022\024\n\020EVEN" + + "TTYPE_CREATE\020\001\022\024\n\020EVENTTYPE_UPDATE\020\002\022\024\n\020" + + "EVENTTYPE_REMOVE\020\003*\305\001\n\020DeviceDriverEnum\022" + + "\032\n\026DEVICEDRIVER_UNDEFINED\020\000\022\033\n\027DEVICEDRI" + + "VER_OPENCONFIG\020\001\022\036\n\032DEVICEDRIVER_TRANSPO" + + "RT_API\020\002\022\023\n\017DEVICEDRIVER_P4\020\003\022&\n\"DEVICED" + + "RIVER_IETF_NETWORK_TOPOLOGY\020\004\022\033\n\027DEVICED" + + "RIVER_ONF_TR_352\020\005*\217\001\n\033DeviceOperational" + + "StatusEnum\022%\n!DEVICEOPERATIONALSTATUS_UN" + + "DEFINED\020\000\022$\n DEVICEOPERATIONALSTATUS_DIS" + + "ABLED\020\001\022#\n\037DEVICEOPERATIONALSTATUS_ENABL" + + "ED\020\002*\201\001\n\017ServiceTypeEnum\022\027\n\023SERVICETYPE_" + + "UNKNOWN\020\000\022\024\n\020SERVICETYPE_L3NM\020\001\022\024\n\020SERVI" + + "CETYPE_L2NM\020\002\022)\n%SERVICETYPE_TAPI_CONNEC" + + "TIVITY_SERVICE\020\003*\210\001\n\021ServiceStatusEnum\022\033" + + "\n\027SERVICESTATUS_UNDEFINED\020\000\022\031\n\025SERVICEST" + + "ATUS_PLANNED\020\001\022\030\n\024SERVICESTATUS_ACTIVE\020\002" + + "\022!\n\035SERVICESTATUS_PENDING_REMOVAL\020\003*]\n\020C" + + "onfigActionEnum\022\032\n\026CONFIGACTION_UNDEFINE" + + "D\020\000\022\024\n\020CONFIGACTION_SET\020\001\022\027\n\023CONFIGACTIO" + + "N_DELETE\020\0022\245\r\n\016ContextService\022:\n\016ListCon" + + "textIds\022\016.context.Empty\032\026.context.Contex" + + "tIdList\"\000\0226\n\014ListContexts\022\016.context.Empt" + + "y\032\024.context.ContextList\"\000\0224\n\nGetContext\022" + + "\022.context.ContextId\032\020.context.Context\"\000\022" + + "4\n\nSetContext\022\020.context.Context\032\022.contex" + + "t.ContextId\"\000\0225\n\rRemoveContext\022\022.context" + + ".ContextId\032\016.context.Empty\"\000\022=\n\020GetConte" + + "xtEvents\022\016.context.Empty\032\025.context.Conte" + + "xtEvent\"\0000\001\022@\n\017ListTopologyIds\022\022.context" + + ".ContextId\032\027.context.TopologyIdList\"\000\022=\n" + + "\016ListTopologies\022\022.context.ContextId\032\025.co" + + "ntext.TopologyList\"\000\0227\n\013GetTopology\022\023.co" + + "ntext.TopologyId\032\021.context.Topology\"\000\0227\n" + + "\013SetTopology\022\021.context.Topology\032\023.contex" + + "t.TopologyId\"\000\0227\n\016RemoveTopology\022\023.conte" + + "xt.TopologyId\032\016.context.Empty\"\000\022?\n\021GetTo" + + "pologyEvents\022\016.context.Empty\032\026.context.T" + + "opologyEvent\"\0000\001\0228\n\rListDeviceIds\022\016.cont" + + "ext.Empty\032\025.context.DeviceIdList\"\000\0224\n\013Li" + + "stDevices\022\016.context.Empty\032\023.context.Devi" + + "ceList\"\000\0221\n\tGetDevice\022\021.context.DeviceId" + + "\032\017.context.Device\"\000\0221\n\tSetDevice\022\017.conte" + + "xt.Device\032\021.context.DeviceId\"\000\0223\n\014Remove" + + "Device\022\021.context.DeviceId\032\016.context.Empt" + + "y\"\000\022;\n\017GetDeviceEvents\022\016.context.Empty\032\024" + + ".context.DeviceEvent\"\0000\001\0224\n\013ListLinkIds\022" + + "\016.context.Empty\032\023.context.LinkIdList\"\000\0220" + + "\n\tListLinks\022\016.context.Empty\032\021.context.Li" + + "nkList\"\000\022+\n\007GetLink\022\017.context.LinkId\032\r.c" + + "ontext.Link\"\000\022+\n\007SetLink\022\r.context.Link\032" + + "\017.context.LinkId\"\000\022/\n\nRemoveLink\022\017.conte" + + "xt.LinkId\032\016.context.Empty\"\000\0227\n\rGetLinkEv" + + "ents\022\016.context.Empty\032\022.context.LinkEvent" + + "\"\0000\001\022>\n\016ListServiceIds\022\022.context.Context" + + "Id\032\026.context.ServiceIdList\"\000\022:\n\014ListServ" + + "ices\022\022.context.ContextId\032\024.context.Servi" + + "ceList\"\000\0224\n\nGetService\022\022.context.Service" + + "Id\032\020.context.Service\"\000\0224\n\nSetService\022\020.c" + + "ontext.Service\032\022.context.ServiceId\"\000\0225\n\r" + + "RemoveService\022\022.context.ServiceId\032\016.cont" + + "ext.Empty\"\000\022=\n\020GetServiceEvents\022\016.contex" + + "t.Empty\032\025.context.ServiceEvent\"\0000\001b\006prot" + + "o3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { + kpi_sample_types.KpiSampleTypes.getDescriptor(), }); internal_static_context_Empty_descriptor = getDescriptor().getMessageTypes().get(0); @@ -36567,7 +36834,7 @@ public final class ContextOuterClass { internal_static_context_EndPoint_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_EndPoint_descriptor, - new java.lang.String[] { "EndpointId", "EndpointType", }); + new java.lang.String[] { "EndpointId", "EndpointType", "KpiSampleTypes", }); internal_static_context_ConfigRule_descriptor = getDescriptor().getMessageTypes().get(33); internal_static_context_ConfigRule_fieldAccessorTable = new @@ -36616,6 +36883,7 @@ public final class ContextOuterClass { com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_AuthenticationResult_descriptor, new java.lang.String[] { "ContextId", "Authenticated", }); + kpi_sample_types.KpiSampleTypes.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/src/automation/target/generated-sources/grpc/device/Device.java b/src/automation/target/generated-sources/grpc/device/Device.java index 460f29a6188215daff9a55c1039ba84c5abf3ecc..bc57d19cae53bf0540a402e9771bc87c1ecf49c5 100644 --- a/src/automation/target/generated-sources/grpc/device/Device.java +++ b/src/automation/target/generated-sources/grpc/device/Device.java @@ -14,6 +14,979 @@ public final class Device { registerAllExtensions( (com.google.protobuf.ExtensionRegistryLite) registry); } + public interface MonitoringSettingsOrBuilder extends + // @@protoc_insertion_point(interface_extends:device.MonitoringSettings) + 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>.monitoring.KpiDescriptor kpi_descriptor = 2;</code> + * @return Whether the kpiDescriptor field is set. + */ + boolean hasKpiDescriptor(); + /** + * <code>.monitoring.KpiDescriptor kpi_descriptor = 2;</code> + * @return The kpiDescriptor. + */ + monitoring.Monitoring.KpiDescriptor getKpiDescriptor(); + /** + * <code>.monitoring.KpiDescriptor kpi_descriptor = 2;</code> + */ + monitoring.Monitoring.KpiDescriptorOrBuilder getKpiDescriptorOrBuilder(); + + /** + * <code>float sampling_duration_s = 3;</code> + * @return The samplingDurationS. + */ + float getSamplingDurationS(); + + /** + * <code>float sampling_interval_s = 4;</code> + * @return The samplingIntervalS. + */ + float getSamplingIntervalS(); + } + /** + * Protobuf type {@code device.MonitoringSettings} + */ + public static final class MonitoringSettings extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:device.MonitoringSettings) + MonitoringSettingsOrBuilder { + private static final long serialVersionUID = 0L; + // Use MonitoringSettings.newBuilder() to construct. + private MonitoringSettings(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private MonitoringSettings() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new MonitoringSettings(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private MonitoringSettings( + 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: { + monitoring.Monitoring.KpiDescriptor.Builder subBuilder = null; + if (kpiDescriptor_ != null) { + subBuilder = kpiDescriptor_.toBuilder(); + } + kpiDescriptor_ = input.readMessage(monitoring.Monitoring.KpiDescriptor.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(kpiDescriptor_); + kpiDescriptor_ = subBuilder.buildPartial(); + } + + break; + } + case 29: { + + samplingDurationS_ = input.readFloat(); + break; + } + case 37: { + + 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 device.Device.internal_static_device_MonitoringSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return device.Device.internal_static_device_MonitoringSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + device.Device.MonitoringSettings.class, device.Device.MonitoringSettings.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 KPI_DESCRIPTOR_FIELD_NUMBER = 2; + private monitoring.Monitoring.KpiDescriptor kpiDescriptor_; + /** + * <code>.monitoring.KpiDescriptor kpi_descriptor = 2;</code> + * @return Whether the kpiDescriptor field is set. + */ + @java.lang.Override + public boolean hasKpiDescriptor() { + return kpiDescriptor_ != null; + } + /** + * <code>.monitoring.KpiDescriptor kpi_descriptor = 2;</code> + * @return The kpiDescriptor. + */ + @java.lang.Override + public monitoring.Monitoring.KpiDescriptor getKpiDescriptor() { + return kpiDescriptor_ == null ? monitoring.Monitoring.KpiDescriptor.getDefaultInstance() : kpiDescriptor_; + } + /** + * <code>.monitoring.KpiDescriptor kpi_descriptor = 2;</code> + */ + @java.lang.Override + public monitoring.Monitoring.KpiDescriptorOrBuilder getKpiDescriptorOrBuilder() { + return getKpiDescriptor(); + } + + public static final int SAMPLING_DURATION_S_FIELD_NUMBER = 3; + private float samplingDurationS_; + /** + * <code>float sampling_duration_s = 3;</code> + * @return The samplingDurationS. + */ + @java.lang.Override + public float getSamplingDurationS() { + return samplingDurationS_; + } + + public static final int SAMPLING_INTERVAL_S_FIELD_NUMBER = 4; + private float samplingIntervalS_; + /** + * <code>float sampling_interval_s = 4;</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 (kpiDescriptor_ != null) { + output.writeMessage(2, getKpiDescriptor()); + } + if (samplingDurationS_ != 0F) { + output.writeFloat(3, samplingDurationS_); + } + if (samplingIntervalS_ != 0F) { + output.writeFloat(4, 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 (kpiDescriptor_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getKpiDescriptor()); + } + if (samplingDurationS_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(3, samplingDurationS_); + } + if (samplingIntervalS_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(4, 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 device.Device.MonitoringSettings)) { + return super.equals(obj); + } + device.Device.MonitoringSettings other = (device.Device.MonitoringSettings) obj; + + if (hasKpiId() != other.hasKpiId()) return false; + if (hasKpiId()) { + if (!getKpiId() + .equals(other.getKpiId())) return false; + } + if (hasKpiDescriptor() != other.hasKpiDescriptor()) return false; + if (hasKpiDescriptor()) { + if (!getKpiDescriptor() + .equals(other.getKpiDescriptor())) 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(); + } + if (hasKpiDescriptor()) { + hash = (37 * hash) + KPI_DESCRIPTOR_FIELD_NUMBER; + hash = (53 * hash) + getKpiDescriptor().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 device.Device.MonitoringSettings parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static device.Device.MonitoringSettings parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static device.Device.MonitoringSettings parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static device.Device.MonitoringSettings parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static device.Device.MonitoringSettings parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static device.Device.MonitoringSettings parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static device.Device.MonitoringSettings parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static device.Device.MonitoringSettings 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 device.Device.MonitoringSettings parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static device.Device.MonitoringSettings 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 device.Device.MonitoringSettings parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static device.Device.MonitoringSettings 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(device.Device.MonitoringSettings 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 device.MonitoringSettings} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:device.MonitoringSettings) + device.Device.MonitoringSettingsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return device.Device.internal_static_device_MonitoringSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return device.Device.internal_static_device_MonitoringSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + device.Device.MonitoringSettings.class, device.Device.MonitoringSettings.Builder.class); + } + + // Construct using device.Device.MonitoringSettings.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; + } + if (kpiDescriptorBuilder_ == null) { + kpiDescriptor_ = null; + } else { + kpiDescriptor_ = null; + kpiDescriptorBuilder_ = null; + } + samplingDurationS_ = 0F; + + samplingIntervalS_ = 0F; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return device.Device.internal_static_device_MonitoringSettings_descriptor; + } + + @java.lang.Override + public device.Device.MonitoringSettings getDefaultInstanceForType() { + return device.Device.MonitoringSettings.getDefaultInstance(); + } + + @java.lang.Override + public device.Device.MonitoringSettings build() { + device.Device.MonitoringSettings result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public device.Device.MonitoringSettings buildPartial() { + device.Device.MonitoringSettings result = new device.Device.MonitoringSettings(this); + if (kpiIdBuilder_ == null) { + result.kpiId_ = kpiId_; + } else { + result.kpiId_ = kpiIdBuilder_.build(); + } + if (kpiDescriptorBuilder_ == null) { + result.kpiDescriptor_ = kpiDescriptor_; + } else { + result.kpiDescriptor_ = kpiDescriptorBuilder_.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 device.Device.MonitoringSettings) { + return mergeFrom((device.Device.MonitoringSettings)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(device.Device.MonitoringSettings other) { + if (other == device.Device.MonitoringSettings.getDefaultInstance()) return this; + if (other.hasKpiId()) { + mergeKpiId(other.getKpiId()); + } + if (other.hasKpiDescriptor()) { + mergeKpiDescriptor(other.getKpiDescriptor()); + } + 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 { + device.Device.MonitoringSettings parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (device.Device.MonitoringSettings) 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 monitoring.Monitoring.KpiDescriptor kpiDescriptor_; + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiDescriptor, monitoring.Monitoring.KpiDescriptor.Builder, monitoring.Monitoring.KpiDescriptorOrBuilder> kpiDescriptorBuilder_; + /** + * <code>.monitoring.KpiDescriptor kpi_descriptor = 2;</code> + * @return Whether the kpiDescriptor field is set. + */ + public boolean hasKpiDescriptor() { + return kpiDescriptorBuilder_ != null || kpiDescriptor_ != null; + } + /** + * <code>.monitoring.KpiDescriptor kpi_descriptor = 2;</code> + * @return The kpiDescriptor. + */ + public monitoring.Monitoring.KpiDescriptor getKpiDescriptor() { + if (kpiDescriptorBuilder_ == null) { + return kpiDescriptor_ == null ? monitoring.Monitoring.KpiDescriptor.getDefaultInstance() : kpiDescriptor_; + } else { + return kpiDescriptorBuilder_.getMessage(); + } + } + /** + * <code>.monitoring.KpiDescriptor kpi_descriptor = 2;</code> + */ + public Builder setKpiDescriptor(monitoring.Monitoring.KpiDescriptor value) { + if (kpiDescriptorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kpiDescriptor_ = value; + onChanged(); + } else { + kpiDescriptorBuilder_.setMessage(value); + } + + return this; + } + /** + * <code>.monitoring.KpiDescriptor kpi_descriptor = 2;</code> + */ + public Builder setKpiDescriptor( + monitoring.Monitoring.KpiDescriptor.Builder builderForValue) { + if (kpiDescriptorBuilder_ == null) { + kpiDescriptor_ = builderForValue.build(); + onChanged(); + } else { + kpiDescriptorBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * <code>.monitoring.KpiDescriptor kpi_descriptor = 2;</code> + */ + public Builder mergeKpiDescriptor(monitoring.Monitoring.KpiDescriptor value) { + if (kpiDescriptorBuilder_ == null) { + if (kpiDescriptor_ != null) { + kpiDescriptor_ = + monitoring.Monitoring.KpiDescriptor.newBuilder(kpiDescriptor_).mergeFrom(value).buildPartial(); + } else { + kpiDescriptor_ = value; + } + onChanged(); + } else { + kpiDescriptorBuilder_.mergeFrom(value); + } + + return this; + } + /** + * <code>.monitoring.KpiDescriptor kpi_descriptor = 2;</code> + */ + public Builder clearKpiDescriptor() { + if (kpiDescriptorBuilder_ == null) { + kpiDescriptor_ = null; + onChanged(); + } else { + kpiDescriptor_ = null; + kpiDescriptorBuilder_ = null; + } + + return this; + } + /** + * <code>.monitoring.KpiDescriptor kpi_descriptor = 2;</code> + */ + public monitoring.Monitoring.KpiDescriptor.Builder getKpiDescriptorBuilder() { + + onChanged(); + return getKpiDescriptorFieldBuilder().getBuilder(); + } + /** + * <code>.monitoring.KpiDescriptor kpi_descriptor = 2;</code> + */ + public monitoring.Monitoring.KpiDescriptorOrBuilder getKpiDescriptorOrBuilder() { + if (kpiDescriptorBuilder_ != null) { + return kpiDescriptorBuilder_.getMessageOrBuilder(); + } else { + return kpiDescriptor_ == null ? + monitoring.Monitoring.KpiDescriptor.getDefaultInstance() : kpiDescriptor_; + } + } + /** + * <code>.monitoring.KpiDescriptor kpi_descriptor = 2;</code> + */ + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiDescriptor, monitoring.Monitoring.KpiDescriptor.Builder, monitoring.Monitoring.KpiDescriptorOrBuilder> + getKpiDescriptorFieldBuilder() { + if (kpiDescriptorBuilder_ == null) { + kpiDescriptorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiDescriptor, monitoring.Monitoring.KpiDescriptor.Builder, monitoring.Monitoring.KpiDescriptorOrBuilder>( + getKpiDescriptor(), + getParentForChildren(), + isClean()); + kpiDescriptor_ = null; + } + return kpiDescriptorBuilder_; + } + + private float samplingDurationS_ ; + /** + * <code>float sampling_duration_s = 3;</code> + * @return The samplingDurationS. + */ + @java.lang.Override + public float getSamplingDurationS() { + return samplingDurationS_; + } + /** + * <code>float sampling_duration_s = 3;</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 = 3;</code> + * @return This builder for chaining. + */ + public Builder clearSamplingDurationS() { + + samplingDurationS_ = 0F; + onChanged(); + return this; + } + + private float samplingIntervalS_ ; + /** + * <code>float sampling_interval_s = 4;</code> + * @return The samplingIntervalS. + */ + @java.lang.Override + public float getSamplingIntervalS() { + return samplingIntervalS_; + } + /** + * <code>float sampling_interval_s = 4;</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 = 4;</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:device.MonitoringSettings) + } + + // @@protoc_insertion_point(class_scope:device.MonitoringSettings) + private static final device.Device.MonitoringSettings DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new device.Device.MonitoringSettings(); + } + + public static device.Device.MonitoringSettings getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<MonitoringSettings> + PARSER = new com.google.protobuf.AbstractParser<MonitoringSettings>() { + @java.lang.Override + public MonitoringSettings parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new MonitoringSettings(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<MonitoringSettings> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<MonitoringSettings> getParserForType() { + return PARSER; + } + + @java.lang.Override + public device.Device.MonitoringSettings getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_device_MonitoringSettings_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_device_MonitoringSettings_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -23,21 +996,35 @@ public final class Device { descriptor; static { java.lang.String[] descriptorData = { - "\n\014device.proto\022\006device\032\rcontext.proto2\360\001" + - "\n\rDeviceService\0221\n\tAddDevice\022\017.context.D" + - "evice\032\021.context.DeviceId\"\000\0227\n\017ConfigureD" + - "evice\022\017.context.Device\032\021.context.DeviceI" + - "d\"\000\0223\n\014DeleteDevice\022\021.context.DeviceId\032\016" + - ".context.Empty\"\000\022>\n\020GetInitialConfig\022\021.c" + - "ontext.DeviceId\032\025.context.DeviceConfig\"\000" + - "b\006proto3" + "\n\014device.proto\022\006device\032\rcontext.proto\032\020m" + + "onitoring.proto\"\244\001\n\022MonitoringSettings\022!" + + "\n\006kpi_id\030\001 \001(\0132\021.monitoring.KpiId\0221\n\016kpi" + + "_descriptor\030\002 \001(\0132\031.monitoring.KpiDescri" + + "ptor\022\033\n\023sampling_duration_s\030\003 \001(\002\022\033\n\023sam" + + "pling_interval_s\030\004 \001(\0022\262\002\n\rDeviceService" + + "\0221\n\tAddDevice\022\017.context.Device\032\021.context" + + ".DeviceId\"\000\0227\n\017ConfigureDevice\022\017.context" + + ".Device\032\021.context.DeviceId\"\000\0223\n\014DeleteDe" + + "vice\022\021.context.DeviceId\032\016.context.Empty\"" + + "\000\022>\n\020GetInitialConfig\022\021.context.DeviceId" + + "\032\025.context.DeviceConfig\"\000\022@\n\020MonitorDevi" + + "ceKpi\022\032.device.MonitoringSettings\032\016.cont" + + "ext.Empty\"\000b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { context.ContextOuterClass.getDescriptor(), + monitoring.Monitoring.getDescriptor(), }); + internal_static_device_MonitoringSettings_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_device_MonitoringSettings_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_device_MonitoringSettings_descriptor, + new java.lang.String[] { "KpiId", "KpiDescriptor", "SamplingDurationS", "SamplingIntervalS", }); context.ContextOuterClass.getDescriptor(); + monitoring.Monitoring.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/src/automation/target/generated-sources/grpc/device/DeviceService.java b/src/automation/target/generated-sources/grpc/device/DeviceService.java index c2d9be46eb44a8e05efab74866f7ff8337934ed3..1768f9911b9d05a7c61e70d8f75e397f9a3341a4 100644 --- a/src/automation/target/generated-sources/grpc/device/DeviceService.java +++ b/src/automation/target/generated-sources/grpc/device/DeviceService.java @@ -16,6 +16,8 @@ public interface DeviceService extends MutinyService { io.smallrye.mutiny.Uni<context.ContextOuterClass.DeviceConfig> getInitialConfig(context.ContextOuterClass.DeviceId request); + io.smallrye.mutiny.Uni<context.ContextOuterClass.Empty> monitorDeviceKpi(device.Device.MonitoringSettings request); + diff --git a/src/automation/target/generated-sources/grpc/device/DeviceServiceBean.java b/src/automation/target/generated-sources/grpc/device/DeviceServiceBean.java index 203e2f2b3e1d42e7a848cdcc19f251e484def93f..c7e767237abc22ff273cc454f1433e5f811382fc 100644 --- a/src/automation/target/generated-sources/grpc/device/DeviceServiceBean.java +++ b/src/automation/target/generated-sources/grpc/device/DeviceServiceBean.java @@ -47,5 +47,13 @@ public class DeviceServiceBean extends MutinyDeviceServiceGrpc.DeviceServiceImpl throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } } + @Override + public io.smallrye.mutiny.Uni<context.ContextOuterClass.Empty> monitorDeviceKpi(device.Device.MonitoringSettings request) { + try { + return delegate.monitorDeviceKpi(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } } \ No newline at end of file diff --git a/src/automation/target/generated-sources/grpc/device/DeviceServiceClient.java b/src/automation/target/generated-sources/grpc/device/DeviceServiceClient.java index e987e6333549200193cf9b6a77f8589b15086718..2445752a6392c3f6f9df0b0ef439d789e6a8d925 100644 --- a/src/automation/target/generated-sources/grpc/device/DeviceServiceClient.java +++ b/src/automation/target/generated-sources/grpc/device/DeviceServiceClient.java @@ -36,5 +36,9 @@ public class DeviceServiceClient implements DeviceService, MutinyClient<MutinyDe public io.smallrye.mutiny.Uni<context.ContextOuterClass.DeviceConfig> getInitialConfig(context.ContextOuterClass.DeviceId request) { return stub.getInitialConfig(request); } + @Override + public io.smallrye.mutiny.Uni<context.ContextOuterClass.Empty> monitorDeviceKpi(device.Device.MonitoringSettings request) { + return stub.monitorDeviceKpi(request); + } } \ No newline at end of file diff --git a/src/automation/target/generated-sources/grpc/device/DeviceServiceGrpc.java b/src/automation/target/generated-sources/grpc/device/DeviceServiceGrpc.java index c19e45888168c69c1454dfde99af59cf64195851..9c2e379d311a58ca51c9208feba359120c086c0e 100644 --- a/src/automation/target/generated-sources/grpc/device/DeviceServiceGrpc.java +++ b/src/automation/target/generated-sources/grpc/device/DeviceServiceGrpc.java @@ -138,6 +138,37 @@ public final class DeviceServiceGrpc { return getGetInitialConfigMethod; } + private static volatile io.grpc.MethodDescriptor<device.Device.MonitoringSettings, + context.ContextOuterClass.Empty> getMonitorDeviceKpiMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "MonitorDeviceKpi", + requestType = device.Device.MonitoringSettings.class, + responseType = context.ContextOuterClass.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor<device.Device.MonitoringSettings, + context.ContextOuterClass.Empty> getMonitorDeviceKpiMethod() { + io.grpc.MethodDescriptor<device.Device.MonitoringSettings, context.ContextOuterClass.Empty> getMonitorDeviceKpiMethod; + if ((getMonitorDeviceKpiMethod = DeviceServiceGrpc.getMonitorDeviceKpiMethod) == null) { + synchronized (DeviceServiceGrpc.class) { + if ((getMonitorDeviceKpiMethod = DeviceServiceGrpc.getMonitorDeviceKpiMethod) == null) { + DeviceServiceGrpc.getMonitorDeviceKpiMethod = getMonitorDeviceKpiMethod = + io.grpc.MethodDescriptor.<device.Device.MonitoringSettings, context.ContextOuterClass.Empty>newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "MonitorDeviceKpi")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + device.Device.MonitoringSettings.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Empty.getDefaultInstance())) + .setSchemaDescriptor(new DeviceServiceMethodDescriptorSupplier("MonitorDeviceKpi")) + .build(); + } + } + } + return getMonitorDeviceKpiMethod; + } + /** * Creates a new async stub that supports all call types for the service */ @@ -214,6 +245,13 @@ public final class DeviceServiceGrpc { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetInitialConfigMethod(), responseObserver); } + /** + */ + public void monitorDeviceKpi(device.Device.MonitoringSettings request, + io.grpc.stub.StreamObserver<context.ContextOuterClass.Empty> responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getMonitorDeviceKpiMethod(), responseObserver); + } + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) .addMethod( @@ -244,6 +282,13 @@ public final class DeviceServiceGrpc { context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceConfig>( this, METHODID_GET_INITIAL_CONFIG))) + .addMethod( + getMonitorDeviceKpiMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + device.Device.MonitoringSettings, + context.ContextOuterClass.Empty>( + this, METHODID_MONITOR_DEVICE_KPI))) .build(); } } @@ -293,6 +338,14 @@ public final class DeviceServiceGrpc { io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getGetInitialConfigMethod(), getCallOptions()), request, responseObserver); } + + /** + */ + public void monitorDeviceKpi(device.Device.MonitoringSettings request, + io.grpc.stub.StreamObserver<context.ContextOuterClass.Empty> responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getMonitorDeviceKpiMethod(), getCallOptions()), request, responseObserver); + } } /** @@ -336,6 +389,13 @@ public final class DeviceServiceGrpc { return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getGetInitialConfigMethod(), getCallOptions(), request); } + + /** + */ + public context.ContextOuterClass.Empty monitorDeviceKpi(device.Device.MonitoringSettings request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getMonitorDeviceKpiMethod(), getCallOptions(), request); + } } /** @@ -383,12 +443,21 @@ public final class DeviceServiceGrpc { return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getGetInitialConfigMethod(), getCallOptions()), request); } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture<context.ContextOuterClass.Empty> monitorDeviceKpi( + device.Device.MonitoringSettings request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getMonitorDeviceKpiMethod(), getCallOptions()), request); + } } private static final int METHODID_ADD_DEVICE = 0; private static final int METHODID_CONFIGURE_DEVICE = 1; private static final int METHODID_DELETE_DEVICE = 2; private static final int METHODID_GET_INITIAL_CONFIG = 3; + private static final int METHODID_MONITOR_DEVICE_KPI = 4; private static final class MethodHandlers<Req, Resp> implements io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>, @@ -423,6 +492,10 @@ public final class DeviceServiceGrpc { serviceImpl.getInitialConfig((context.ContextOuterClass.DeviceId) request, (io.grpc.stub.StreamObserver<context.ContextOuterClass.DeviceConfig>) responseObserver); break; + case METHODID_MONITOR_DEVICE_KPI: + serviceImpl.monitorDeviceKpi((device.Device.MonitoringSettings) request, + (io.grpc.stub.StreamObserver<context.ContextOuterClass.Empty>) responseObserver); + break; default: throw new AssertionError(); } @@ -488,6 +561,7 @@ public final class DeviceServiceGrpc { .addMethod(getConfigureDeviceMethod()) .addMethod(getDeleteDeviceMethod()) .addMethod(getGetInitialConfigMethod()) + .addMethod(getMonitorDeviceKpiMethod()) .build(); } } diff --git a/src/automation/target/generated-sources/grpc/device/MutinyDeviceServiceGrpc.java b/src/automation/target/generated-sources/grpc/device/MutinyDeviceServiceGrpc.java index ee52d131578ede0769997d3f76a02a302568c21f..096784b5a39fa66afbe2ff5402b8beec6c294730 100644 --- a/src/automation/target/generated-sources/grpc/device/MutinyDeviceServiceGrpc.java +++ b/src/automation/target/generated-sources/grpc/device/MutinyDeviceServiceGrpc.java @@ -55,6 +55,11 @@ public final class MutinyDeviceServiceGrpc implements io.quarkus.grpc.runtime.Mu return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::getInitialConfig); } + + public io.smallrye.mutiny.Uni<context.ContextOuterClass.Empty> monitorDeviceKpi(device.Device.MonitoringSettings request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::monitorDeviceKpi); + } + } @@ -92,6 +97,11 @@ public final class MutinyDeviceServiceGrpc implements io.quarkus.grpc.runtime.Mu throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } + + public io.smallrye.mutiny.Uni<context.ContextOuterClass.Empty> monitorDeviceKpi(device.Device.MonitoringSettings 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( @@ -122,6 +132,13 @@ public final class MutinyDeviceServiceGrpc implements io.quarkus.grpc.runtime.Mu context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceConfig>( this, METHODID_GET_INITIAL_CONFIG, compression))) + .addMethod( + device.DeviceServiceGrpc.getMonitorDeviceKpiMethod(), + asyncUnaryCall( + new MethodHandlers< + device.Device.MonitoringSettings, + context.ContextOuterClass.Empty>( + this, METHODID_MONITOR_DEVICE_KPI, compression))) .build(); } } @@ -130,6 +147,7 @@ public final class MutinyDeviceServiceGrpc implements io.quarkus.grpc.runtime.Mu private static final int METHODID_CONFIGURE_DEVICE = 1; private static final int METHODID_DELETE_DEVICE = 2; private static final int METHODID_GET_INITIAL_CONFIG = 3; + private static final int METHODID_MONITOR_DEVICE_KPI = 4; private static final class MethodHandlers<Req, Resp> implements io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>, @@ -174,6 +192,12 @@ public final class MutinyDeviceServiceGrpc implements io.quarkus.grpc.runtime.Mu compression, serviceImpl::getInitialConfig); break; + case METHODID_MONITOR_DEVICE_KPI: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((device.Device.MonitoringSettings) request, + (io.grpc.stub.StreamObserver<context.ContextOuterClass.Empty>) responseObserver, + compression, + serviceImpl::monitorDeviceKpi); + break; default: throw new java.lang.AssertionError(); } diff --git a/src/automation/target/generated-sources/grpc/kpi_sample_types/KpiSampleTypes.java b/src/automation/target/generated-sources/grpc/kpi_sample_types/KpiSampleTypes.java new file mode 100644 index 0000000000000000000000000000000000000000..67e1ec736f9d83cbf95b419e9e61e92e82e73b88 --- /dev/null +++ b/src/automation/target/generated-sources/grpc/kpi_sample_types/KpiSampleTypes.java @@ -0,0 +1,176 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: kpi_sample_types.proto + +package kpi_sample_types; + +public final class KpiSampleTypes { + private KpiSampleTypes() {} + 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 kpi_sample_types.KpiSampleType} + */ + public enum KpiSampleType + implements com.google.protobuf.ProtocolMessageEnum { + /** + * <code>KPISAMPLETYPE_UNKNOWN = 0;</code> + */ + KPISAMPLETYPE_UNKNOWN(0), + /** + * <code>KPISAMPLETYPE_PACKETS_TRANSMITTED = 101;</code> + */ + KPISAMPLETYPE_PACKETS_TRANSMITTED(101), + /** + * <code>KPISAMPLETYPE_PACKETS_RECEIVED = 102;</code> + */ + KPISAMPLETYPE_PACKETS_RECEIVED(102), + /** + * <code>KPISAMPLETYPE_BYTES_TRANSMITTED = 201;</code> + */ + KPISAMPLETYPE_BYTES_TRANSMITTED(201), + /** + * <code>KPISAMPLETYPE_BYTES_RECEIVED = 202;</code> + */ + KPISAMPLETYPE_BYTES_RECEIVED(202), + UNRECOGNIZED(-1), + ; + + /** + * <code>KPISAMPLETYPE_UNKNOWN = 0;</code> + */ + public static final int KPISAMPLETYPE_UNKNOWN_VALUE = 0; + /** + * <code>KPISAMPLETYPE_PACKETS_TRANSMITTED = 101;</code> + */ + public static final int KPISAMPLETYPE_PACKETS_TRANSMITTED_VALUE = 101; + /** + * <code>KPISAMPLETYPE_PACKETS_RECEIVED = 102;</code> + */ + public static final int KPISAMPLETYPE_PACKETS_RECEIVED_VALUE = 102; + /** + * <code>KPISAMPLETYPE_BYTES_TRANSMITTED = 201;</code> + */ + public static final int KPISAMPLETYPE_BYTES_TRANSMITTED_VALUE = 201; + /** + * <code>KPISAMPLETYPE_BYTES_RECEIVED = 202;</code> + */ + public static final int KPISAMPLETYPE_BYTES_RECEIVED_VALUE = 202; + + + 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 KpiSampleType 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 KpiSampleType forNumber(int value) { + switch (value) { + case 0: return KPISAMPLETYPE_UNKNOWN; + case 101: return KPISAMPLETYPE_PACKETS_TRANSMITTED; + case 102: return KPISAMPLETYPE_PACKETS_RECEIVED; + case 201: return KPISAMPLETYPE_BYTES_TRANSMITTED; + case 202: return KPISAMPLETYPE_BYTES_RECEIVED; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap<KpiSampleType> + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + KpiSampleType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap<KpiSampleType>() { + public KpiSampleType findValueByNumber(int number) { + return KpiSampleType.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 kpi_sample_types.KpiSampleTypes.getDescriptor().getEnumTypes().get(0); + } + + private static final KpiSampleType[] VALUES = values(); + + public static KpiSampleType 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 KpiSampleType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:kpi_sample_types.KpiSampleType) + } + + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\026kpi_sample_types.proto\022\020kpi_sample_typ" + + "es*\276\001\n\rKpiSampleType\022\031\n\025KPISAMPLETYPE_UN" + + "KNOWN\020\000\022%\n!KPISAMPLETYPE_PACKETS_TRANSMI" + + "TTED\020e\022\"\n\036KPISAMPLETYPE_PACKETS_RECEIVED" + + "\020f\022$\n\037KPISAMPLETYPE_BYTES_TRANSMITTED\020\311\001" + + "\022!\n\034KPISAMPLETYPE_BYTES_RECEIVED\020\312\001b\006pro" + + "to3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/src/automation/target/generated-sources/grpc/monitoring/Monitoring.java b/src/automation/target/generated-sources/grpc/monitoring/Monitoring.java new file mode 100644 index 0000000000000000000000000000000000000000..1ef1f0c029d1d5916eaf5ffc4f185c048a40b5a3 --- /dev/null +++ b/src/automation/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/automation/target/generated-sources/grpc/monitoring/MonitoringService.java b/src/automation/target/generated-sources/grpc/monitoring/MonitoringService.java new file mode 100644 index 0000000000000000000000000000000000000000..480e193125e51851a72e18473c139d71190bab11 --- /dev/null +++ b/src/automation/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/automation/target/generated-sources/grpc/monitoring/MonitoringServiceBean.java b/src/automation/target/generated-sources/grpc/monitoring/MonitoringServiceBean.java new file mode 100644 index 0000000000000000000000000000000000000000..b0b2f5abd4144d8f6e41c2613a36c5b78051dd57 --- /dev/null +++ b/src/automation/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/automation/target/generated-sources/grpc/monitoring/MonitoringServiceClient.java b/src/automation/target/generated-sources/grpc/monitoring/MonitoringServiceClient.java new file mode 100644 index 0000000000000000000000000000000000000000..293a7c418e6e027792e8007234e34225b8c1848a --- /dev/null +++ b/src/automation/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/automation/target/generated-sources/grpc/monitoring/MonitoringServiceGrpc.java b/src/automation/target/generated-sources/grpc/monitoring/MonitoringServiceGrpc.java new file mode 100644 index 0000000000000000000000000000000000000000..7749c322a714ed96bc523a6bb77da9d43e54dbca --- /dev/null +++ b/src/automation/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/automation/target/generated-sources/grpc/monitoring/MutinyMonitoringServiceGrpc.java b/src/automation/target/generated-sources/grpc/monitoring/MutinyMonitoringServiceGrpc.java new file mode 100644 index 0000000000000000000000000000000000000000..e5157378c1d8d4608d5da2ec0e429fbb2412c175 --- /dev/null +++ b/src/automation/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/automation/target/kubernetes/kubernetes.yml b/src/automation/target/kubernetes/kubernetes.yml index 73d19dc1f9e0c6f12b7d660dde71927dda7c07cc..47b852adf6beb80c60488a298e9039cd2011469d 100644 --- a/src/automation/target/kubernetes/kubernetes.yml +++ b/src/automation/target/kubernetes/kubernetes.yml @@ -3,8 +3,8 @@ apiVersion: v1 kind: Service metadata: annotations: - app.quarkus.io/commit-id: 6b96f471f66e6bb59357856c635f8d7e1ce98a5c - app.quarkus.io/build-timestamp: 2021-11-19 - 15:03:07 +0000 + app.quarkus.io/commit-id: cb66db4bc415be2e94c17f4152e9805301b202b5 + app.quarkus.io/build-timestamp: 2022-01-05 - 10:42:14 +0000 labels: app.kubernetes.io/name: automationservice app.kubernetes.io/version: 0.0.1 @@ -12,12 +12,12 @@ metadata: name: automationservice spec: ports: - - name: http - port: 8080 - targetPort: 8080 - name: grpc-server port: 9999 targetPort: 9999 + - name: http + port: 8080 + targetPort: 8080 selector: app.kubernetes.io/name: automationservice app.kubernetes.io/version: 0.0.1 @@ -27,28 +27,28 @@ apiVersion: apps/v1 kind: Deployment metadata: annotations: - app.quarkus.io/commit-id: 6b96f471f66e6bb59357856c635f8d7e1ce98a5c - app.quarkus.io/build-timestamp: 2021-11-19 - 15:03:07 +0000 + app.quarkus.io/commit-id: cb66db4bc415be2e94c17f4152e9805301b202b5 + app.quarkus.io/build-timestamp: 2022-01-05 - 10:42:14 +0000 labels: app: automationservice - app.kubernetes.io/name: automationservice app.kubernetes.io/version: 0.0.1 + app.kubernetes.io/name: automationservice name: automationservice spec: replicas: 1 selector: matchLabels: - app.kubernetes.io/name: automationservice app.kubernetes.io/version: 0.0.1 + app.kubernetes.io/name: automationservice template: metadata: annotations: - app.quarkus.io/commit-id: 6b96f471f66e6bb59357856c635f8d7e1ce98a5c - app.quarkus.io/build-timestamp: 2021-11-19 - 15:03:07 +0000 + app.quarkus.io/commit-id: cb66db4bc415be2e94c17f4152e9805301b202b5 + app.quarkus.io/build-timestamp: 2022-01-05 - 10:42:14 +0000 labels: app: automationservice - app.kubernetes.io/name: automationservice app.kubernetes.io/version: 0.0.1 + app.kubernetes.io/name: automationservice spec: containers: - env: @@ -74,12 +74,12 @@ spec: timeoutSeconds: 10 name: automationservice ports: - - containerPort: 8080 - name: http - protocol: TCP - containerPort: 9999 name: grpc-server protocol: TCP + - containerPort: 8080 + name: http + protocol: TCP readinessProbe: failureThreshold: 3 httpGet: diff --git a/src/centralizedattackdetector/.gitlab-ci.yml b/src/centralizedattackdetector/.gitlab-ci.yml deleted file mode 100644 index c2e4d7a4d360b90fc7e8cedef83aae69c1d07d5d..0000000000000000000000000000000000000000 --- a/src/centralizedattackdetector/.gitlab-ci.yml +++ /dev/null @@ -1,60 +0,0 @@ -# Build, tag, and push the Docker images to the GitLab Docker registry -build centralizedattackdetector: - variables: - IMAGE_NAME: 'centralizedattackdetector' # name of the microservice - IMAGE_NAME_TEST: 'centralizedattackdetector-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 centralizedattackdetector: - variables: - IMAGE_NAME: 'centralizedattackdetector' # name of the microservice - IMAGE_NAME_TEST: 'centralizedattackdetector-test' # name of the microservice - IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) - stage: unit_test - needs: - - build centralizedattackdetector - 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 10000:10000 --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 centralizedattackdetector: - stage: deploy - needs: - - build centralizedattackdetector - - unit_test centralizedattackdetector - - dependencies all - - integ_test execute - script: - - kubectl version - - kubectl get all - - kubectl apply -f "manifests/centralizedattackdetectorservice.yaml" - - kubectl delete pods --selector app=centralizedattackdetectorservice - - kubectl get all diff --git a/src/centralizedattackdetector/Config.py b/src/centralizedattackdetector/Config.py deleted file mode 100644 index 3a122c7590bdda97f7be1cc4ec331cb86b5f8dd4..0000000000000000000000000000000000000000 --- a/src/centralizedattackdetector/Config.py +++ /dev/null @@ -1,12 +0,0 @@ -import logging - -# General settings -LOG_LEVEL = logging.WARNING - -# gRPC settings -GRPC_SERVICE_PORT = 10000 -GRPC_MAX_WORKERS = 10 -GRPC_GRACE_PERIOD = 60 - -# Prometheus settings -METRICS_PORT = 9192 diff --git a/src/centralizedattackdetector/Dockerfile b/src/centralizedattackdetector/Dockerfile deleted file mode 100644 index f683a8c853f1741ee3dbb1031a6df4aa00419d42..0000000000000000000000000000000000000000 --- a/src/centralizedattackdetector/Dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -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/centralizedcybersecurity - -# Get Python packages per module -COPY centralizedattackdetector/requirements.in centralizedattackdetector/requirements.in -RUN pip-compile --output-file=centralizedattackdetector/requirements.txt centralizedattackdetector/requirements.in -RUN python3 -m pip install -r centralizedattackdetector/requirements.txt - -# Add files into working directory -COPY common/. common -COPY centralizedattackdetector/. centralizedattackdetector - -# Start centralizedattackdetector service -ENTRYPOINT ["python", "-m", "centralizedattackdetector.service"] diff --git a/src/centralizedattackdetector/__init__.py b/src/centralizedattackdetector/__init__.py deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/centralizedattackdetector/client/CentralizedAttackDetectorClient.py b/src/centralizedattackdetector/client/CentralizedAttackDetectorClient.py deleted file mode 100644 index da367972af24601500bf9844e26891cbd7bcc35b..0000000000000000000000000000000000000000 --- a/src/centralizedattackdetector/client/CentralizedAttackDetectorClient.py +++ /dev/null @@ -1,55 +0,0 @@ -import grpc, logging -from common.tools.client.RetryDecorator import retry, delay_exponential -from centralizedattackdetector.proto.context_pb2 import Empty, Service -from centralizedattackdetector.proto.monitoring_pb2 import KpiList -from centralizedattackdetector.proto.centralized_attack_detector_pb2_grpc import CentralizedAttackDetectorServiceStub - -LOGGER = logging.getLogger(__name__) -MAX_RETRIES = 15 -DELAY_FUNCTION = delay_exponential(initial=0.01, increment=2.0, maximum=5.0) - -class CentralizedAttackDetectorClient: - def __init__(self, address, port): - self.endpoint = '{:s}:{:s}'.format(str(address), 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 = CentralizedAttackDetectorServiceStub(self.channel) - - def close(self): - if(self.channel is not None): self.channel.close() - self.channel = None - self.stub = None - - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') - def NotifyServiceUpdate(self, request : Service) -> Empty: - LOGGER.debug('NotifyServiceUpdate request: {:s}'.format(str(request))) - response = self.stub.NotifyServiceUpdate(request) - LOGGER.debug('NotifyServiceUpdate result: {:s}'.format(str(response))) - return response - - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') - def DetectAttack(self, request : Empty) -> Empty: - LOGGER.debug('DetectAttack request: {:s}'.format(str(request))) - response = self.stub.DetectAttack(request) - LOGGER.debug('DetectAttack result: {:s}'.format(str(response))) - return response - - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') - def ReportSummarizedKpi(self, request : KpiList) -> Empty: - LOGGER.debug('ReportSummarizedKpi request: {:s}'.format(str(request))) - response = self.stub.ReportSummarizedKpi(request) - LOGGER.debug('ReportSummarizedKpi result: {:s}'.format(str(response))) - return response - - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') - def ReportKpi(self, request : KpiList) -> Empty: - LOGGER.debug('ReportKpi request: {:s}'.format(str(request))) - response = self.stub.ReportKpi(request) - LOGGER.debug('ReportKpi result: {:s}'.format(str(response))) - return response diff --git a/src/centralizedattackdetector/client/__init__.py b/src/centralizedattackdetector/client/__init__.py deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/centralizedattackdetector/genproto.sh b/src/centralizedattackdetector/genproto.sh deleted file mode 100755 index 548428f37721abde24d35780207343208aa8f4b9..0000000000000000000000000000000000000000 --- a/src/centralizedattackdetector/genproto.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -eu -# -# Copyright 2018 Google LLC -# -# 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. - -#!/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 - -# building protos of services used -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 -python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto monitoring.proto - -rm proto/context_pb2_grpc.py -rm proto/service_pb2_grpc.py -rm proto/monitoring_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/monitoring_pb2.py - -# building current service protos -python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto centralized_attack_detector.proto - -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/centralized_attack_detector_pb2.py -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/centralized_attack_detector_pb2_grpc.py diff --git a/src/centralizedattackdetector/proto/__init__.py b/src/centralizedattackdetector/proto/__init__.py deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/centralizedattackdetector/proto/centralized_attack_detector_pb2.py b/src/centralizedattackdetector/proto/centralized_attack_detector_pb2.py deleted file mode 100644 index a8a6d000f7627238b39986f0f7e9911f0d4cf1e7..0000000000000000000000000000000000000000 --- a/src/centralizedattackdetector/proto/centralized_attack_detector_pb2.py +++ /dev/null @@ -1,89 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: centralized_attack_detector.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 -from . import monitoring_pb2 as monitoring__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='centralized_attack_detector.proto', - package='centralized_attack_detector', - syntax='proto3', - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n!centralized_attack_detector.proto\x12\x1b\x63\x65ntralized_attack_detector\x1a\rcontext.proto\x1a\x10monitoring.proto2\x81\x02\n CentralizedAttackDetectorService\x12\x39\n\x13NotifyServiceUpdate\x12\x10.context.Service\x1a\x0e.context.Empty\"\x00\x12\x30\n\x0c\x44\x65tectAttack\x12\x0e.context.Empty\x1a\x0e.context.Empty\"\x00\x12<\n\x13ReportSummarizedKpi\x12\x13.monitoring.KpiList\x1a\x0e.context.Empty\"\x00\x12\x32\n\tReportKpi\x12\x13.monitoring.KpiList\x1a\x0e.context.Empty\"\x00\x62\x06proto3' - , - dependencies=[context__pb2.DESCRIPTOR,monitoring__pb2.DESCRIPTOR,]) - - - -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - - - -_CENTRALIZEDATTACKDETECTORSERVICE = _descriptor.ServiceDescriptor( - name='CentralizedAttackDetectorService', - full_name='centralized_attack_detector.CentralizedAttackDetectorService', - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=100, - serialized_end=357, - methods=[ - _descriptor.MethodDescriptor( - name='NotifyServiceUpdate', - full_name='centralized_attack_detector.CentralizedAttackDetectorService.NotifyServiceUpdate', - index=0, - containing_service=None, - input_type=context__pb2._SERVICE, - output_type=context__pb2._EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='DetectAttack', - full_name='centralized_attack_detector.CentralizedAttackDetectorService.DetectAttack', - index=1, - containing_service=None, - input_type=context__pb2._EMPTY, - output_type=context__pb2._EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ReportSummarizedKpi', - full_name='centralized_attack_detector.CentralizedAttackDetectorService.ReportSummarizedKpi', - index=2, - containing_service=None, - input_type=monitoring__pb2._KPILIST, - output_type=context__pb2._EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ReportKpi', - full_name='centralized_attack_detector.CentralizedAttackDetectorService.ReportKpi', - index=3, - containing_service=None, - input_type=monitoring__pb2._KPILIST, - output_type=context__pb2._EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), -]) -_sym_db.RegisterServiceDescriptor(_CENTRALIZEDATTACKDETECTORSERVICE) - -DESCRIPTOR.services_by_name['CentralizedAttackDetectorService'] = _CENTRALIZEDATTACKDETECTORSERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/src/centralizedattackdetector/proto/centralized_attack_detector_pb2_grpc.py b/src/centralizedattackdetector/proto/centralized_attack_detector_pb2_grpc.py deleted file mode 100644 index 418acbf19eb1a2a43889234626adb20d5dce1186..0000000000000000000000000000000000000000 --- a/src/centralizedattackdetector/proto/centralized_attack_detector_pb2_grpc.py +++ /dev/null @@ -1,168 +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 context_pb2 as context__pb2 -from . import monitoring_pb2 as monitoring__pb2 - - -class CentralizedAttackDetectorServiceStub(object): - """Missing associated documentation comment in .proto file.""" - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.NotifyServiceUpdate = channel.unary_unary( - '/centralized_attack_detector.CentralizedAttackDetectorService/NotifyServiceUpdate', - request_serializer=context__pb2.Service.SerializeToString, - response_deserializer=context__pb2.Empty.FromString, - ) - self.DetectAttack = channel.unary_unary( - '/centralized_attack_detector.CentralizedAttackDetectorService/DetectAttack', - request_serializer=context__pb2.Empty.SerializeToString, - response_deserializer=context__pb2.Empty.FromString, - ) - self.ReportSummarizedKpi = channel.unary_unary( - '/centralized_attack_detector.CentralizedAttackDetectorService/ReportSummarizedKpi', - request_serializer=monitoring__pb2.KpiList.SerializeToString, - response_deserializer=context__pb2.Empty.FromString, - ) - self.ReportKpi = channel.unary_unary( - '/centralized_attack_detector.CentralizedAttackDetectorService/ReportKpi', - request_serializer=monitoring__pb2.KpiList.SerializeToString, - response_deserializer=context__pb2.Empty.FromString, - ) - - -class CentralizedAttackDetectorServiceServicer(object): - """Missing associated documentation comment in .proto file.""" - - def NotifyServiceUpdate(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 DetectAttack(self, request, context): - """rpc that triggers the attack detection loop - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ReportSummarizedKpi(self, request, context): - """rpc called by the distributed component to report KPIs - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ReportKpi(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_CentralizedAttackDetectorServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - 'NotifyServiceUpdate': grpc.unary_unary_rpc_method_handler( - servicer.NotifyServiceUpdate, - request_deserializer=context__pb2.Service.FromString, - response_serializer=context__pb2.Empty.SerializeToString, - ), - 'DetectAttack': grpc.unary_unary_rpc_method_handler( - servicer.DetectAttack, - request_deserializer=context__pb2.Empty.FromString, - response_serializer=context__pb2.Empty.SerializeToString, - ), - 'ReportSummarizedKpi': grpc.unary_unary_rpc_method_handler( - servicer.ReportSummarizedKpi, - request_deserializer=monitoring__pb2.KpiList.FromString, - response_serializer=context__pb2.Empty.SerializeToString, - ), - 'ReportKpi': grpc.unary_unary_rpc_method_handler( - servicer.ReportKpi, - request_deserializer=monitoring__pb2.KpiList.FromString, - response_serializer=context__pb2.Empty.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'centralized_attack_detector.CentralizedAttackDetectorService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class CentralizedAttackDetectorService(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def NotifyServiceUpdate(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, '/centralized_attack_detector.CentralizedAttackDetectorService/NotifyServiceUpdate', - context__pb2.Service.SerializeToString, - context__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def DetectAttack(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, '/centralized_attack_detector.CentralizedAttackDetectorService/DetectAttack', - context__pb2.Empty.SerializeToString, - context__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ReportSummarizedKpi(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, '/centralized_attack_detector.CentralizedAttackDetectorService/ReportSummarizedKpi', - monitoring__pb2.KpiList.SerializeToString, - context__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ReportKpi(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, '/centralized_attack_detector.CentralizedAttackDetectorService/ReportKpi', - monitoring__pb2.KpiList.SerializeToString, - context__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/src/centralizedattackdetector/proto/context_pb2.py b/src/centralizedattackdetector/proto/context_pb2.py deleted file mode 100644 index 8b4848bc33bfb0eba76590c8a3a627b2db84ca9f..0000000000000000000000000000000000000000 --- a/src/centralizedattackdetector/proto/context_pb2.py +++ /dev/null @@ -1,2535 +0,0 @@ -# -*- 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() - - - - -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\"\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\"\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\"K\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\"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\"6\n\x0c\x43onnectionId\x12&\n\x0f\x63onnection_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x8d\x01\n\nConnection\x12,\n\rconnection_id\x18\x01 \x01(\x0b\x32\x15.context.ConnectionId\x12.\n\x12related_service_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\x12!\n\x04path\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\"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\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\xa5\r\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\x62\x06proto3' -) - -_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=3468, - serialized_end=3574, -) -_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=3577, - serialized_end=3774, -) -_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=3777, - serialized_end=3920, -) -_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=3923, - serialized_end=4052, -) -_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=4055, - serialized_end=4191, -) -_sym_db.RegisterEnumDescriptor(_SERVICESTATUSENUM) - -ServiceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICESTATUSENUM) -_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=4193, - serialized_end=4286, -) -_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 -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=26, - serialized_end=33, -) - - -_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=35, - serialized_end=55, -) - - -_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=57, - serialized_end=127, -) - - -_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=129, - serialized_end=177, -) - - -_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=180, - serialized_end=362, -) - - -_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=364, - serialized_end=420, -) - - -_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=422, - serialized_end=471, -) - - -_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=473, - serialized_end=558, -) - - -_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=560, - serialized_end=650, -) - - -_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=652, - serialized_end=778, -) - - -_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=780, - serialized_end=839, -) - - -_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=841, - serialized_end=894, -) - - -_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=896, - serialized_end=984, -) - - -_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=986, - serialized_end=1032, -) - - -_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=1035, - serialized_end=1317, -) - - -_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=1319, - serialized_end=1376, -) - - -_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=1378, - serialized_end=1431, -) - - -_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=1433, - serialized_end=1479, -) - - -_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=1481, - serialized_end=1563, -) - - -_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=1565, - serialized_end=1607, -) - - -_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=1609, - serialized_end=1697, -) - - -_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=1699, - serialized_end=1746, -) - - -_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=1748, - serialized_end=1788, -) - - -_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=1790, - serialized_end=1866, -) - - -_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=1868, - serialized_end=1956, -) - - -_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=1959, - serialized_end=2253, -) - - -_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=2255, - serialized_end=2322, -) - - -_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=2324, - serialized_end=2382, -) - - -_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=2384, - serialized_end=2440, -) - - -_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=2442, - serialized_end=2491, -) - - -_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=2493, - serialized_end=2578, -) - - -_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=2581, - serialized_end=2711, -) - - -_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), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2713, - serialized_end=2788, -) - - -_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=2790, - serialized_end=2891, -) - - -_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=2893, - serialized_end=2956, -) - - -_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=2958, - serialized_end=3012, -) - - -_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='related_service_id', full_name='context.Connection.related_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', full_name='context.Connection.path', 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=3015, - serialized_end=3156, -) - - -_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=3158, - serialized_end=3223, -) - - -_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=3225, - serialized_end=3283, -) - - -_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=3285, - serialized_end=3379, -) - - -_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=3381, - serialized_end=3466, -) - -_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 -_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 -_CONFIGRULE.fields_by_name['action'].enum_type = _CONFIGACTIONENUM -_CONNECTIONID.fields_by_name['connection_uuid'].message_type = _UUID -_CONNECTION.fields_by_name['connection_id'].message_type = _CONNECTIONID -_CONNECTION.fields_by_name['related_service_id'].message_type = _SERVICEID -_CONNECTION.fields_by_name['path'].message_type = _ENDPOINTID -_CONNECTIONIDLIST.fields_by_name['connection_ids'].message_type = _CONNECTIONID -_CONNECTIONLIST.fields_by_name['connections'].message_type = _CONNECTION -_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['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['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['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['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) - -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) - -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) - -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=4289, - serialized_end=5990, - 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, - ), -]) -_sym_db.RegisterServiceDescriptor(_CONTEXTSERVICE) - -DESCRIPTOR.services_by_name['ContextService'] = _CONTEXTSERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/src/centralizedattackdetector/proto/monitoring_pb2.py b/src/centralizedattackdetector/proto/monitoring_pb2.py deleted file mode 100644 index 0a5e4d990fb3ea82734080e4fde8086977bdedbb..0000000000000000000000000000000000000000 --- a/src/centralizedattackdetector/proto/monitoring_pb2.py +++ /dev/null @@ -1,656 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: monitoring.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='monitoring.proto', - package='monitoring', - syntax='proto3', - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x10monitoring.proto\x12\nmonitoring\x1a\rcontext.proto\"\x84\x01\n\x10\x43reateKpiRequest\x12\x16\n\x0ekpiDescription\x18\x01 \x01(\t\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\x12\x32\n\x0fkpi_sample_type\x18\x03 \x01(\x0e\x32\x19.monitoring.KpiSampleType\"h\n\x11MonitorKpiRequest\x12!\n\x06kpi_id\x18\x01 \x01(\x0b\x32\x11.monitoring.KpiId\x12\x18\n\x10\x63onnexion_time_s\x18\x02 \x01(\r\x12\x16\n\x0esample_rate_ms\x18\x03 \x01(\r\"i\n\x17MonitorDeviceKpiRequest\x12\x1c\n\x03kpi\x18\x01 \x01(\x0b\x32\x0f.monitoring.Kpi\x12\x18\n\x10\x63onnexion_time_s\x18\x02 \x01(\r\x12\x16\n\x0esample_rate_ms\x18\x03 \x01(\r\"s\n\x11IncludeKpiRequest\x12!\n\x06kpi_id\x18\x01 \x01(\x0b\x32\x11.monitoring.KpiId\x12\x12\n\ntime_stamp\x18\x02 \x01(\t\x12\'\n\tkpi_value\x18\x03 \x01(\x0b\x32\x14.monitoring.KpiValue\"\xd6\x01\n\x03Kpi\x12!\n\x06kpi_id\x18\x01 \x01(\x0b\x32\x11.monitoring.KpiId\x12\x11\n\ttimestamp\x18\x02 \x01(\t\x12\x16\n\x0ekpiDescription\x18\x03 \x01(\t\x12\'\n\tkpi_value\x18\x04 \x01(\x0b\x32\x14.monitoring.KpiValue\x12\x32\n\x0fkpi_sample_type\x18\x05 \x01(\x0e\x32\x19.monitoring.KpiSampleType\x12$\n\tdevice_id\x18\x06 \x01(\x0b\x32\x11.context.DeviceId\"&\n\x05KpiId\x12\x1d\n\x06kpi_id\x18\x01 \x01(\x0b\x32\r.context.Uuid\"T\n\tKpiDevice\x12!\n\x06kpi_id\x18\x01 \x01(\x0b\x32\x11.monitoring.KpiId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"+\n\x07KpiList\x12 \n\x07kpiList\x18\x01 \x03(\x0b\x32\x0f.monitoring.Kpi\"M\n\x08KpiValue\x12\x10\n\x06intVal\x18\x01 \x01(\rH\x00\x12\x13\n\tstringVal\x18\x02 \x01(\tH\x00\x12\x11\n\x07\x62oolVal\x18\x03 \x01(\x08H\x00\x42\x07\n\x05value*x\n\rKpiSampleType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x17\n\x13PACKETS_TRANSMITTED\x10\x65\x12\x14\n\x10PACKETS_RECEIVED\x10\x66\x12\x16\n\x11\x42YTES_TRANSMITTED\x10\xc9\x01\x12\x13\n\x0e\x42YTES_RECEIVED\x10\xca\x01\x32\x8b\x03\n\x11MonitoringService\x12>\n\tCreateKpi\x12\x1c.monitoring.CreateKpiRequest\x1a\x11.monitoring.KpiId\"\x00\x12=\n\nIncludeKpi\x12\x1d.monitoring.IncludeKpiRequest\x1a\x0e.context.Empty\"\x00\x12=\n\nMonitorKpi\x12\x1d.monitoring.MonitorKpiRequest\x1a\x0e.context.Empty\"\x00\x12I\n\x10MonitorDeviceKpi\x12#.monitoring.MonitorDeviceKpiRequest\x1a\x0e.context.Empty\"\x00\x12\x36\n\x0cGetStreamKpi\x12\x11.monitoring.KpiId\x1a\x0f.monitoring.Kpi\"\x00\x30\x01\x12\x35\n\rGetInstantKpi\x12\x11.monitoring.KpiId\x1a\x0f.monitoring.Kpi\"\x00\x62\x06proto3' - , - dependencies=[context__pb2.DESCRIPTOR,]) - -_KPISAMPLETYPE = _descriptor.EnumDescriptor( - name='KpiSampleType', - full_name='monitoring.KpiSampleType', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='UNKNOWN', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='PACKETS_TRANSMITTED', index=1, number=101, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='PACKETS_RECEIVED', index=2, number=102, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='BYTES_TRANSMITTED', index=3, number=201, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='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=979, - serialized_end=1099, -) -_sym_db.RegisterEnumDescriptor(_KPISAMPLETYPE) - -KpiSampleType = enum_type_wrapper.EnumTypeWrapper(_KPISAMPLETYPE) -UNKNOWN = 0 -PACKETS_TRANSMITTED = 101 -PACKETS_RECEIVED = 102 -BYTES_TRANSMITTED = 201 -BYTES_RECEIVED = 202 - - - -_CREATEKPIREQUEST = _descriptor.Descriptor( - name='CreateKpiRequest', - full_name='monitoring.CreateKpiRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='kpiDescription', full_name='monitoring.CreateKpiRequest.kpiDescription', 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='device_id', full_name='monitoring.CreateKpiRequest.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='kpi_sample_type', full_name='monitoring.CreateKpiRequest.kpi_sample_type', index=2, - number=3, 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=48, - serialized_end=180, -) - - -_MONITORKPIREQUEST = _descriptor.Descriptor( - name='MonitorKpiRequest', - full_name='monitoring.MonitorKpiRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='kpi_id', full_name='monitoring.MonitorKpiRequest.kpi_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='connexion_time_s', full_name='monitoring.MonitorKpiRequest.connexion_time_s', index=1, - number=2, 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), - _descriptor.FieldDescriptor( - name='sample_rate_ms', full_name='monitoring.MonitorKpiRequest.sample_rate_ms', 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=182, - serialized_end=286, -) - - -_MONITORDEVICEKPIREQUEST = _descriptor.Descriptor( - name='MonitorDeviceKpiRequest', - full_name='monitoring.MonitorDeviceKpiRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='kpi', full_name='monitoring.MonitorDeviceKpiRequest.kpi', 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='connexion_time_s', full_name='monitoring.MonitorDeviceKpiRequest.connexion_time_s', index=1, - number=2, 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), - _descriptor.FieldDescriptor( - name='sample_rate_ms', full_name='monitoring.MonitorDeviceKpiRequest.sample_rate_ms', 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=288, - serialized_end=393, -) - - -_INCLUDEKPIREQUEST = _descriptor.Descriptor( - name='IncludeKpiRequest', - full_name='monitoring.IncludeKpiRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='kpi_id', full_name='monitoring.IncludeKpiRequest.kpi_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='time_stamp', full_name='monitoring.IncludeKpiRequest.time_stamp', 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_value', full_name='monitoring.IncludeKpiRequest.kpi_value', 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=395, - serialized_end=510, -) - - -_KPI = _descriptor.Descriptor( - name='Kpi', - full_name='monitoring.Kpi', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='kpi_id', full_name='monitoring.Kpi.kpi_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='timestamp', full_name='monitoring.Kpi.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='kpiDescription', full_name='monitoring.Kpi.kpiDescription', 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='kpi_value', full_name='monitoring.Kpi.kpi_value', 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), - _descriptor.FieldDescriptor( - name='kpi_sample_type', full_name='monitoring.Kpi.kpi_sample_type', index=4, - number=5, 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_id', full_name='monitoring.Kpi.device_id', 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=513, - serialized_end=727, -) - - -_KPIID = _descriptor.Descriptor( - name='KpiId', - full_name='monitoring.KpiId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='kpi_id', full_name='monitoring.KpiId.kpi_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), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=729, - serialized_end=767, -) - - -_KPIDEVICE = _descriptor.Descriptor( - name='KpiDevice', - full_name='monitoring.KpiDevice', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='kpi_id', full_name='monitoring.KpiDevice.kpi_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='monitoring.KpiDevice.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=769, - serialized_end=853, -) - - -_KPILIST = _descriptor.Descriptor( - name='KpiList', - full_name='monitoring.KpiList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='kpiList', full_name='monitoring.KpiList.kpiList', 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=855, - serialized_end=898, -) - - -_KPIVALUE = _descriptor.Descriptor( - name='KpiValue', - full_name='monitoring.KpiValue', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='intVal', full_name='monitoring.KpiValue.intVal', index=0, - number=1, 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), - _descriptor.FieldDescriptor( - name='stringVal', full_name='monitoring.KpiValue.stringVal', 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='boolVal', full_name='monitoring.KpiValue.boolVal', index=2, - number=3, 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=[ - _descriptor.OneofDescriptor( - name='value', full_name='monitoring.KpiValue.value', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=900, - serialized_end=977, -) - -_CREATEKPIREQUEST.fields_by_name['device_id'].message_type = context__pb2._DEVICEID -_CREATEKPIREQUEST.fields_by_name['kpi_sample_type'].enum_type = _KPISAMPLETYPE -_MONITORKPIREQUEST.fields_by_name['kpi_id'].message_type = _KPIID -_MONITORDEVICEKPIREQUEST.fields_by_name['kpi'].message_type = _KPI -_INCLUDEKPIREQUEST.fields_by_name['kpi_id'].message_type = _KPIID -_INCLUDEKPIREQUEST.fields_by_name['kpi_value'].message_type = _KPIVALUE -_KPI.fields_by_name['kpi_id'].message_type = _KPIID -_KPI.fields_by_name['kpi_value'].message_type = _KPIVALUE -_KPI.fields_by_name['kpi_sample_type'].enum_type = _KPISAMPLETYPE -_KPI.fields_by_name['device_id'].message_type = context__pb2._DEVICEID -_KPIID.fields_by_name['kpi_id'].message_type = context__pb2._UUID -_KPIDEVICE.fields_by_name['kpi_id'].message_type = _KPIID -_KPIDEVICE.fields_by_name['device_id'].message_type = context__pb2._DEVICEID -_KPILIST.fields_by_name['kpiList'].message_type = _KPI -_KPIVALUE.oneofs_by_name['value'].fields.append( - _KPIVALUE.fields_by_name['intVal']) -_KPIVALUE.fields_by_name['intVal'].containing_oneof = _KPIVALUE.oneofs_by_name['value'] -_KPIVALUE.oneofs_by_name['value'].fields.append( - _KPIVALUE.fields_by_name['stringVal']) -_KPIVALUE.fields_by_name['stringVal'].containing_oneof = _KPIVALUE.oneofs_by_name['value'] -_KPIVALUE.oneofs_by_name['value'].fields.append( - _KPIVALUE.fields_by_name['boolVal']) -_KPIVALUE.fields_by_name['boolVal'].containing_oneof = _KPIVALUE.oneofs_by_name['value'] -DESCRIPTOR.message_types_by_name['CreateKpiRequest'] = _CREATEKPIREQUEST -DESCRIPTOR.message_types_by_name['MonitorKpiRequest'] = _MONITORKPIREQUEST -DESCRIPTOR.message_types_by_name['MonitorDeviceKpiRequest'] = _MONITORDEVICEKPIREQUEST -DESCRIPTOR.message_types_by_name['IncludeKpiRequest'] = _INCLUDEKPIREQUEST -DESCRIPTOR.message_types_by_name['Kpi'] = _KPI -DESCRIPTOR.message_types_by_name['KpiId'] = _KPIID -DESCRIPTOR.message_types_by_name['KpiDevice'] = _KPIDEVICE -DESCRIPTOR.message_types_by_name['KpiList'] = _KPILIST -DESCRIPTOR.message_types_by_name['KpiValue'] = _KPIVALUE -DESCRIPTOR.enum_types_by_name['KpiSampleType'] = _KPISAMPLETYPE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -CreateKpiRequest = _reflection.GeneratedProtocolMessageType('CreateKpiRequest', (_message.Message,), { - 'DESCRIPTOR' : _CREATEKPIREQUEST, - '__module__' : 'monitoring_pb2' - # @@protoc_insertion_point(class_scope:monitoring.CreateKpiRequest) - }) -_sym_db.RegisterMessage(CreateKpiRequest) - -MonitorKpiRequest = _reflection.GeneratedProtocolMessageType('MonitorKpiRequest', (_message.Message,), { - 'DESCRIPTOR' : _MONITORKPIREQUEST, - '__module__' : 'monitoring_pb2' - # @@protoc_insertion_point(class_scope:monitoring.MonitorKpiRequest) - }) -_sym_db.RegisterMessage(MonitorKpiRequest) - -MonitorDeviceKpiRequest = _reflection.GeneratedProtocolMessageType('MonitorDeviceKpiRequest', (_message.Message,), { - 'DESCRIPTOR' : _MONITORDEVICEKPIREQUEST, - '__module__' : 'monitoring_pb2' - # @@protoc_insertion_point(class_scope:monitoring.MonitorDeviceKpiRequest) - }) -_sym_db.RegisterMessage(MonitorDeviceKpiRequest) - -IncludeKpiRequest = _reflection.GeneratedProtocolMessageType('IncludeKpiRequest', (_message.Message,), { - 'DESCRIPTOR' : _INCLUDEKPIREQUEST, - '__module__' : 'monitoring_pb2' - # @@protoc_insertion_point(class_scope:monitoring.IncludeKpiRequest) - }) -_sym_db.RegisterMessage(IncludeKpiRequest) - -Kpi = _reflection.GeneratedProtocolMessageType('Kpi', (_message.Message,), { - 'DESCRIPTOR' : _KPI, - '__module__' : 'monitoring_pb2' - # @@protoc_insertion_point(class_scope:monitoring.Kpi) - }) -_sym_db.RegisterMessage(Kpi) - -KpiId = _reflection.GeneratedProtocolMessageType('KpiId', (_message.Message,), { - 'DESCRIPTOR' : _KPIID, - '__module__' : 'monitoring_pb2' - # @@protoc_insertion_point(class_scope:monitoring.KpiId) - }) -_sym_db.RegisterMessage(KpiId) - -KpiDevice = _reflection.GeneratedProtocolMessageType('KpiDevice', (_message.Message,), { - 'DESCRIPTOR' : _KPIDEVICE, - '__module__' : 'monitoring_pb2' - # @@protoc_insertion_point(class_scope:monitoring.KpiDevice) - }) -_sym_db.RegisterMessage(KpiDevice) - -KpiList = _reflection.GeneratedProtocolMessageType('KpiList', (_message.Message,), { - 'DESCRIPTOR' : _KPILIST, - '__module__' : 'monitoring_pb2' - # @@protoc_insertion_point(class_scope:monitoring.KpiList) - }) -_sym_db.RegisterMessage(KpiList) - -KpiValue = _reflection.GeneratedProtocolMessageType('KpiValue', (_message.Message,), { - 'DESCRIPTOR' : _KPIVALUE, - '__module__' : 'monitoring_pb2' - # @@protoc_insertion_point(class_scope:monitoring.KpiValue) - }) -_sym_db.RegisterMessage(KpiValue) - - - -_MONITORINGSERVICE = _descriptor.ServiceDescriptor( - name='MonitoringService', - full_name='monitoring.MonitoringService', - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=1102, - serialized_end=1497, - methods=[ - _descriptor.MethodDescriptor( - name='CreateKpi', - full_name='monitoring.MonitoringService.CreateKpi', - index=0, - containing_service=None, - input_type=_CREATEKPIREQUEST, - output_type=_KPIID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='IncludeKpi', - full_name='monitoring.MonitoringService.IncludeKpi', - index=1, - containing_service=None, - input_type=_INCLUDEKPIREQUEST, - output_type=context__pb2._EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='MonitorKpi', - full_name='monitoring.MonitoringService.MonitorKpi', - index=2, - containing_service=None, - input_type=_MONITORKPIREQUEST, - output_type=context__pb2._EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='MonitorDeviceKpi', - full_name='monitoring.MonitoringService.MonitorDeviceKpi', - index=3, - containing_service=None, - input_type=_MONITORDEVICEKPIREQUEST, - output_type=context__pb2._EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetStreamKpi', - full_name='monitoring.MonitoringService.GetStreamKpi', - index=4, - containing_service=None, - input_type=_KPIID, - output_type=_KPI, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetInstantKpi', - full_name='monitoring.MonitoringService.GetInstantKpi', - index=5, - containing_service=None, - input_type=_KPIID, - output_type=_KPI, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), -]) -_sym_db.RegisterServiceDescriptor(_MONITORINGSERVICE) - -DESCRIPTOR.services_by_name['MonitoringService'] = _MONITORINGSERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/src/centralizedattackdetector/proto/service_pb2.py b/src/centralizedattackdetector/proto/service_pb2.py deleted file mode 100644 index 7a006915b8be39710a17faab075e382e322d918f..0000000000000000000000000000000000000000 --- a/src/centralizedattackdetector/proto/service_pb2.py +++ /dev/null @@ -1,88 +0,0 @@ -# -*- 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\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' - , - 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=295, - 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, - ), - _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) - -DESCRIPTOR.services_by_name['ServiceService'] = _SERVICESERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/src/centralizedattackdetector/requirements.in b/src/centralizedattackdetector/requirements.in deleted file mode 100644 index 25abdad1b5767117956a88b816399635348884c7..0000000000000000000000000000000000000000 --- a/src/centralizedattackdetector/requirements.in +++ /dev/null @@ -1,6 +0,0 @@ -grpcio-health-checking -grpcio -prometheus-client -pytest -pytest-benchmark -redis diff --git a/src/centralizedattackdetector/requirements.txt b/src/centralizedattackdetector/requirements.txt deleted file mode 100644 index f15fc23535b22452219448d5a4f3525996b58a75..0000000000000000000000000000000000000000 --- a/src/centralizedattackdetector/requirements.txt +++ /dev/null @@ -1,42 +0,0 @@ -# -# This file is autogenerated by pip-compile with python 3.9 -# To update, run: -# -# pip-compile -# -attrs==21.2.0 - # via pytest -grpcio==1.41.0 - # via - # -r requirements.in - # grpcio-health-checking -grpcio-health-checking==1.41.0 - # via -r requirements.in -iniconfig==1.1.1 - # via pytest -packaging==21.0 - # via pytest -pluggy==1.0.0 - # via pytest -prometheus-client==0.11.0 - # via -r requirements.in -protobuf==3.18.0 - # via grpcio-health-checking -py==1.10.0 - # via pytest -py-cpuinfo==8.0.0 - # via pytest-benchmark -pyparsing==2.4.7 - # via packaging -pytest==6.2.5 - # via - # -r requirements.in - # pytest-benchmark -pytest-benchmark==3.4.1 - # via -r requirements.in -redis==3.5.3 - # via -r requirements.in -six==1.16.0 - # via grpcio -toml==0.10.2 - # via pytest diff --git a/src/centralizedattackdetector/service/CentralizedAttackDetectorService.py b/src/centralizedattackdetector/service/CentralizedAttackDetectorService.py deleted file mode 100644 index 16c8841c9e09325e21f092ccece5aad84e7f53d6..0000000000000000000000000000000000000000 --- a/src/centralizedattackdetector/service/CentralizedAttackDetectorService.py +++ /dev/null @@ -1,58 +0,0 @@ -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 centralizedattackdetector.proto.centralized_attack_detector_pb2_grpc import ( - add_CentralizedAttackDetectorServiceServicer_to_server) -from centralizedattackdetector.service.CentralizedAttackDetectorServiceServicerImpl import ( - CentralizedAttackDetectorServiceServicerImpl) -from centralizedattackdetector.Config import GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD - -BIND_ADDRESS = '0.0.0.0' -LOGGER = logging.getLogger(__name__) - -class CentralizedAttackDetectorService: - 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.centralized_attack_detector_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,)) - - self.centralized_attack_detector_servicer = CentralizedAttackDetectorServiceServicerImpl() - add_CentralizedAttackDetectorServiceServicer_to_server(self.centralized_attack_detector_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(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/centralizedattackdetector/service/CentralizedAttackDetectorServiceServicerImpl.py b/src/centralizedattackdetector/service/CentralizedAttackDetectorServiceServicerImpl.py deleted file mode 100644 index 1f5fbdcb9655cda3351580b50c19eddf2c0d192a..0000000000000000000000000000000000000000 --- a/src/centralizedattackdetector/service/CentralizedAttackDetectorServiceServicerImpl.py +++ /dev/null @@ -1,34 +0,0 @@ -import grpc, logging -from common.rpc_method_wrapper.Decorator import create_metrics, safe_and_metered_rpc_method -from centralizedattackdetector.proto.context_pb2 import Empty, Service -from centralizedattackdetector.proto.monitoring_pb2 import KpiList -from centralizedattackdetector.proto.centralized_attack_detector_pb2_grpc import ( - CentralizedAttackDetectorServiceServicer) - -LOGGER = logging.getLogger(__name__) - -SERVICE_NAME = 'CentralizedAttackDetector' -METHOD_NAMES = ['NotifyServiceUpdate', 'DetectAttack', 'ReportSummarizedKpi', 'ReportKpi'] -METRICS = create_metrics(SERVICE_NAME, METHOD_NAMES) - -class CentralizedAttackDetectorServiceServicerImpl(CentralizedAttackDetectorServiceServicer): - - def __init__(self): - LOGGER.debug('Creating Servicer...') - LOGGER.debug('Servicer Created') - - @safe_and_metered_rpc_method(METRICS, LOGGER) - def NotifyServiceUpdate(self, request : Service, context : grpc.ServicerContext) -> Empty: - return Empty() - - @safe_and_metered_rpc_method(METRICS, LOGGER) - def DetectAttack(self, request : Empty, context : grpc.ServicerContext) -> Empty: - return Empty() - - @safe_and_metered_rpc_method(METRICS, LOGGER) - def ReportSummarizedKpi(self, request : KpiList, context : grpc.ServicerContext) -> Empty: - return Empty() - - @safe_and_metered_rpc_method(METRICS, LOGGER) - def ReportKpi(self, request : KpiList, context : grpc.ServicerContext) -> Empty: - return Empty() diff --git a/src/centralizedattackdetector/service/__init__.py b/src/centralizedattackdetector/service/__init__.py deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/centralizedattackdetector/service/__main__.py b/src/centralizedattackdetector/service/__main__.py deleted file mode 100644 index 5737402c0318fa58123c5fdf00296c237f09aeb8..0000000000000000000000000000000000000000 --- a/src/centralizedattackdetector/service/__main__.py +++ /dev/null @@ -1,50 +0,0 @@ -import logging, signal, sys, threading -from prometheus_client import start_http_server -from common.Settings import get_setting -from centralizedattackdetector.Config import ( - GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD, LOG_LEVEL, METRICS_PORT) -from centralizedattackdetector.service.CentralizedAttackDetectorService import CentralizedAttackDetectorService - -terminate = threading.Event() -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 - - service_port = get_setting('CENTRALIZEDATTACKDETECTORSERVICE_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 ) - - logging.basicConfig(level=log_level) - LOGGER = logging.getLogger(__name__) - - signal.signal(signal.SIGINT, signal_handler) - signal.signal(signal.SIGTERM, signal_handler) - - LOGGER.info('Starting...') - - # Start metrics server - start_http_server(metrics_port) - - # Starting CentralizedCybersecurity service - grpc_service = CentralizedAttackDetectorService( - port=service_port, max_workers=max_workers, grace_period=grace_period) - 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/centralizedattackdetector/tests/__init__.py b/src/centralizedattackdetector/tests/__init__.py deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/centralizedattackdetector/tests/test_unitary.py b/src/centralizedattackdetector/tests/test_unitary.py deleted file mode 100644 index 177e03080157dc59bdd0f71caa0430ec83fdd5c9..0000000000000000000000000000000000000000 --- a/src/centralizedattackdetector/tests/test_unitary.py +++ /dev/null @@ -1,41 +0,0 @@ -import logging, pytest -from centralizedattackdetector.Config import GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD -from centralizedattackdetector.client.CentralizedAttackDetectorClient import CentralizedAttackDetectorClient -from centralizedattackdetector.proto.context_pb2 import Empty, Service -from centralizedattackdetector.proto.monitoring_pb2 import Kpi, KpiList -from centralizedattackdetector.service.CentralizedAttackDetectorService import CentralizedAttackDetectorService - -port = 10000 + GRPC_SERVICE_PORT # avoid privileged ports - -LOGGER = logging.getLogger(__name__) -LOGGER.setLevel(logging.DEBUG) - -@pytest.fixture(scope='session') -def centralized_attack_detector_service(): - _service = CentralizedAttackDetectorService( - port=port, max_workers=GRPC_MAX_WORKERS, grace_period=GRPC_GRACE_PERIOD) - _service.start() - yield _service - _service.stop() - -@pytest.fixture(scope='session') -def centralized_attack_detector_client(centralized_attack_detector_service): - _client = CentralizedAttackDetectorClient(address='127.0.0.1', port=port) - yield _client - _client.close() - -def test_notify_service_update(centralized_attack_detector_client: CentralizedAttackDetectorClient): - service = Service() - centralized_attack_detector_client.NotifyServiceUpdate(service) - -def test_detect_attack(centralized_attack_detector_client: CentralizedAttackDetectorClient): - request = Empty() - centralized_attack_detector_client.DetectAttack(request) - -def test_report_summarized_kpi(centralized_attack_detector_client: CentralizedAttackDetectorClient): - kpi_list = KpiList() - centralized_attack_detector_client.ReportSummarizedKpi(kpi_list) - -def test_report_kpi(centralized_attack_detector_client: CentralizedAttackDetectorClient): - kpi_list = KpiList() - centralized_attack_detector_client.ReportKpi(kpi_list) diff --git a/src/compute/.gitlab-ci.yml b/src/compute/.gitlab-ci.yml index d10d5acfbcafa90a3fa6c0bd2cad9164e67dc020..9bcc43664df4c0157f582d6c1a6b9cb249bca798 100644 --- a/src/compute/.gitlab-ci.yml +++ b/src/compute/.gitlab-ci.yml @@ -19,7 +19,7 @@ build compute: - src/$IMAGE_NAME/**/*.{py,in,yml} - src/$IMAGE_NAME/Dockerfile - src/$IMAGE_NAME/tests/*.py - - manifests/$IMAGE_NAMEservice.yaml + - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml # Apply unit test to the component @@ -52,7 +52,7 @@ unit test compute: - src/$IMAGE_NAME/Dockerfile - src/$IMAGE_NAME/tests/*.py - src/$IMAGE_NAME/tests/Dockerfile - - manifests/$IMAGE_NAMEservice.yaml + - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml # Deployment of the service in Kubernetes Cluster @@ -65,10 +65,10 @@ deploy compute: - unit test compute # - integ_test execute script: - - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/$IMAGE_NAMEservice.yaml' + - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/${IMAGE_NAME}service.yaml' - kubectl version - kubectl get all - - kubectl apply -f "manifests/$IMAGE_NAMEservice.yaml" + - kubectl apply -f "manifests/${IMAGE_NAME}service.yaml" - kubectl get all # environment: # name: test diff --git a/src/context/.gitlab-ci.yml b/src/context/.gitlab-ci.yml index bae78b86d55c0437a468bff03c30afa28598d5c7..a330a444947677e7bbd22ca57faf3d15bccd9754 100644 --- a/src/context/.gitlab-ci.yml +++ b/src/context/.gitlab-ci.yml @@ -19,7 +19,7 @@ build context: - src/$IMAGE_NAME/**/*.{py,in,yml} - src/$IMAGE_NAME/Dockerfile - src/$IMAGE_NAME/tests/*.py - - manifests/$IMAGE_NAMEservice.yaml + - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml # Apply unit test to the component @@ -56,7 +56,7 @@ unit test context: - src/$IMAGE_NAME/Dockerfile - src/$IMAGE_NAME/tests/*.py - src/$IMAGE_NAME/tests/Dockerfile - - manifests/$IMAGE_NAMEservice.yaml + - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml # Deployment of the service in Kubernetes Cluster @@ -69,10 +69,10 @@ deploy context: - unit test context # - integ_test execute script: - - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/$IMAGE_NAMEservice.yaml' + - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/${IMAGE_NAME}service.yaml' - kubectl version - kubectl get all - - kubectl apply -f "manifests/$IMAGE_NAMEservice.yaml" + - kubectl apply -f "manifests/${IMAGE_NAME}service.yaml" - kubectl get all # environment: # name: test diff --git a/src/context/tests/test_unitary.py b/src/context/tests/test_unitary.py index 5836511e1fe6057a55ee714d1b0e9a905f638660..092418ec4f11358686e3af509eb1e772ecaa3264 100644 --- a/src/context/tests/test_unitary.py +++ b/src/context/tests/test_unitary.py @@ -1,5 +1,5 @@ import copy, grpc, logging, os, pytest, requests, threading, time, urllib -from queue import Queue +from queue import Queue, Empty from typing import Tuple from common.Constants import DEFAULT_CONTEXT_UUID, DEFAULT_TOPOLOGY_UUID from common.orm.Database import Database @@ -128,6 +128,22 @@ class EventsCollector: def get_event(self, block : bool = True, timeout : float = 0.1): return self._events_queue.get(block=block, timeout=timeout) + def get_events(self, block : bool = True, timeout : float = 0.1, count : int = None): + events = [] + if count is None: + while True: + try: + events.append(self.get_event(block=block, timeout=timeout)) + except Empty: # pylint: disable=catching-non-exception + break + else: + for _ in range(count): + try: + events.append(self.get_event(block=block, timeout=timeout)) + except Empty: # pylint: disable=catching-non-exception + pass + return sorted(events, key=lambda e: e.event.timestamp) + def stop(self): self._context_stream.cancel() self._topology_stream.cancel() @@ -145,7 +161,7 @@ class EventsCollector: # ----- Test gRPC methods ---------------------------------------------------------------------------------------------- def test_grpc_context( - context_client_grpc : ContextClient, # pylint: disable=redefined-outer-name + context_client_grpc : ContextClient, # pylint: disable=redefined-outer-name context_db_mb : Tuple[Database, MessageBroker]): # pylint: disable=redefined-outer-name context_database = context_db_mb[0] @@ -266,7 +282,7 @@ def test_grpc_context( def test_grpc_topology( - context_client_grpc : ContextClient, # pylint: disable=redefined-outer-name + context_client_grpc : ContextClient, # pylint: disable=redefined-outer-name context_db_mb : Tuple[Database, MessageBroker]): # pylint: disable=redefined-outer-name context_database = context_db_mb[0] @@ -318,22 +334,16 @@ def test_grpc_topology( assert response.context_uuid.uuid == DEFAULT_CONTEXT_UUID # ----- Check create event ----------------------------------------------------------------------------------------- - context_event = None - topology_event = None - for _ in range(2): - event = events_collector.get_event(block=True) - assert isinstance(event, (ContextEvent, TopologyEvent)) - if isinstance(event, ContextEvent): context_event = event - if isinstance(event, TopologyEvent): topology_event = event - - assert context_event is not None - assert context_event.event.event_type == EventTypeEnum.EVENTTYPE_UPDATE - assert context_event.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID - - assert topology_event is not None - assert topology_event.event.event_type == EventTypeEnum.EVENTTYPE_CREATE - assert topology_event.topology_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID - assert topology_event.topology_id.topology_uuid.uuid == DEFAULT_TOPOLOGY_UUID + events = events_collector.get_events(block=True, count=2) + + assert isinstance(events[0], TopologyEvent) + assert events[0].event.event_type == EventTypeEnum.EVENTTYPE_CREATE + assert events[0].topology_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert events[0].topology_id.topology_uuid.uuid == DEFAULT_TOPOLOGY_UUID + + assert isinstance(events[1], ContextEvent) + assert events[1].event.event_type == EventTypeEnum.EVENTTYPE_UPDATE + assert events[1].context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID # ----- Update the object ------------------------------------------------------------------------------------------ response = context_client_grpc.SetTopology(Topology(**TOPOLOGY)) @@ -380,16 +390,16 @@ def test_grpc_topology( context_client_grpc.RemoveContext(ContextId(**CONTEXT_ID)) # ----- Check remove event ----------------------------------------------------------------------------------------- - event = events_collector.get_event(block=True) - assert isinstance(event, TopologyEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_REMOVE - assert event.topology_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID - assert event.topology_id.topology_uuid.uuid == DEFAULT_TOPOLOGY_UUID + events = events_collector.get_events(block=True, count=2) - event = events_collector.get_event(block=True) - assert isinstance(event, ContextEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_REMOVE - assert event.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert isinstance(events[0], TopologyEvent) + assert events[0].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE + assert events[0].topology_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert events[0].topology_id.topology_uuid.uuid == DEFAULT_TOPOLOGY_UUID + + assert isinstance(events[1], ContextEvent) + assert events[1].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE + assert events[1].context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID # ----- Stop the EventsCollector ----------------------------------------------------------------------------------- events_collector.stop() @@ -404,7 +414,7 @@ def test_grpc_topology( def test_grpc_device( - context_client_grpc : ContextClient, # pylint: disable=redefined-outer-name + context_client_grpc : ContextClient, # pylint: disable=redefined-outer-name context_db_mb : Tuple[Database, MessageBroker]): # pylint: disable=redefined-outer-name context_database = context_db_mb[0] @@ -423,16 +433,16 @@ def test_grpc_device( assert response.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID assert response.topology_uuid.uuid == DEFAULT_TOPOLOGY_UUID - event = events_collector.get_event(block=True) - assert isinstance(event, ContextEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_CREATE - assert event.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + events = events_collector.get_events(block=True, count=2) - event = events_collector.get_event(block=True) - assert isinstance(event, TopologyEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_CREATE - assert event.topology_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID - assert event.topology_id.topology_uuid.uuid == DEFAULT_TOPOLOGY_UUID + assert isinstance(events[0], ContextEvent) + assert events[0].event.event_type == EventTypeEnum.EVENTTYPE_CREATE + assert events[0].context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + + assert isinstance(events[1], TopologyEvent) + assert events[1].event.event_type == EventTypeEnum.EVENTTYPE_CREATE + assert events[1].topology_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert events[1].topology_id.topology_uuid.uuid == DEFAULT_TOPOLOGY_UUID # ----- Get when the object does not exist ------------------------------------------------------------------------- with pytest.raises(grpc.RpcError) as e: @@ -551,21 +561,20 @@ def test_grpc_device( context_client_grpc.RemoveContext(ContextId(**CONTEXT_ID)) # ----- Check remove event ----------------------------------------------------------------------------------------- - event = events_collector.get_event(block=True) - assert isinstance(event, DeviceEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_REMOVE - assert event.device_id.device_uuid.uuid == DEVICE1_UUID + events = events_collector.get_events(block=True, count=3) - event = events_collector.get_event(block=True) - assert isinstance(event, TopologyEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_REMOVE - assert event.topology_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID - assert event.topology_id.topology_uuid.uuid == DEFAULT_TOPOLOGY_UUID + assert isinstance(events[0], DeviceEvent) + assert events[0].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE + assert events[0].device_id.device_uuid.uuid == DEVICE1_UUID - event = events_collector.get_event(block=True) - assert isinstance(event, ContextEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_REMOVE - assert event.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert isinstance(events[1], TopologyEvent) + assert events[1].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE + assert events[1].topology_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert events[1].topology_id.topology_uuid.uuid == DEFAULT_TOPOLOGY_UUID + + assert isinstance(events[2], ContextEvent) + assert events[2].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE + assert events[2].context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID # ----- Stop the EventsCollector ----------------------------------------------------------------------------------- events_collector.stop() @@ -580,7 +589,7 @@ def test_grpc_device( def test_grpc_link( - context_client_grpc : ContextClient, # pylint: disable=redefined-outer-name + context_client_grpc : ContextClient, # pylint: disable=redefined-outer-name context_db_mb : Tuple[Database, MessageBroker]): # pylint: disable=redefined-outer-name context_database = context_db_mb[0] @@ -605,26 +614,24 @@ def test_grpc_link( response = context_client_grpc.SetDevice(Device(**DEVICE2)) assert response.device_uuid.uuid == DEVICE2_UUID - event = events_collector.get_event(block=True) - assert isinstance(event, ContextEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_CREATE - assert event.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + events = events_collector.get_events(block=True, count=4) - event = events_collector.get_event(block=True) - assert isinstance(event, TopologyEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_CREATE - assert event.topology_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID - assert event.topology_id.topology_uuid.uuid == DEFAULT_TOPOLOGY_UUID + assert isinstance(events[0], ContextEvent) + assert events[0].event.event_type == EventTypeEnum.EVENTTYPE_CREATE + assert events[0].context_id.context_uuid.uuid == DEFAULT_CONTEXT_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 == DEVICE1_UUID + assert isinstance(events[1], TopologyEvent) + assert events[1].event.event_type == EventTypeEnum.EVENTTYPE_CREATE + assert events[1].topology_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert events[1].topology_id.topology_uuid.uuid == DEFAULT_TOPOLOGY_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 == DEVICE2_UUID + assert isinstance(events[2], DeviceEvent) + assert events[2].event.event_type == EventTypeEnum.EVENTTYPE_CREATE + assert events[2].device_id.device_uuid.uuid == DEVICE1_UUID + + assert isinstance(events[3], DeviceEvent) + assert events[3].event.event_type == EventTypeEnum.EVENTTYPE_CREATE + assert events[3].device_id.device_uuid.uuid == DEVICE2_UUID # ----- Get when the object does not exist ------------------------------------------------------------------------- with pytest.raises(grpc.RpcError) as e: @@ -729,31 +736,28 @@ def test_grpc_link( context_client_grpc.RemoveContext(ContextId(**CONTEXT_ID)) # ----- Check remove event ----------------------------------------------------------------------------------------- - event = events_collector.get_event(block=True) - assert isinstance(event, LinkEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_REMOVE - assert event.link_id.link_uuid.uuid == LINK_DEV1_DEV2_UUID + events = events_collector.get_events(block=True, count=5) - event = events_collector.get_event(block=True) - assert isinstance(event, DeviceEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_REMOVE - assert event.device_id.device_uuid.uuid == DEVICE1_UUID + assert isinstance(events[0], LinkEvent) + assert events[0].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE + assert events[0].link_id.link_uuid.uuid == LINK_DEV1_DEV2_UUID - event = events_collector.get_event(block=True) - assert isinstance(event, DeviceEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_REMOVE - assert event.device_id.device_uuid.uuid == DEVICE2_UUID + assert isinstance(events[1], DeviceEvent) + assert events[1].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE + assert events[1].device_id.device_uuid.uuid == DEVICE1_UUID - event = events_collector.get_event(block=True) - assert isinstance(event, TopologyEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_REMOVE - assert event.topology_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID - assert event.topology_id.topology_uuid.uuid == DEFAULT_TOPOLOGY_UUID + assert isinstance(events[2], DeviceEvent) + assert events[2].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE + assert events[2].device_id.device_uuid.uuid == DEVICE2_UUID - event = events_collector.get_event(block=True) - assert isinstance(event, ContextEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_REMOVE - assert event.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert isinstance(events[3], TopologyEvent) + assert events[3].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE + assert events[3].topology_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert events[3].topology_id.topology_uuid.uuid == DEFAULT_TOPOLOGY_UUID + + assert isinstance(events[4], ContextEvent) + assert events[4].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE + assert events[4].context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID # ----- Stop the EventsCollector ----------------------------------------------------------------------------------- events_collector.stop() @@ -768,7 +772,7 @@ def test_grpc_link( def test_grpc_service( - context_client_grpc : ContextClient, # pylint: disable=redefined-outer-name + context_client_grpc : ContextClient, # pylint: disable=redefined-outer-name context_db_mb : Tuple[Database, MessageBroker]): # pylint: disable=redefined-outer-name context_database = context_db_mb[0] @@ -793,26 +797,24 @@ def test_grpc_service( response = context_client_grpc.SetDevice(Device(**DEVICE2)) assert response.device_uuid.uuid == DEVICE2_UUID - event = events_collector.get_event(block=True) - assert isinstance(event, ContextEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_CREATE - assert event.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + events = events_collector.get_events(block=True, count=4) - event = events_collector.get_event(block=True) - assert isinstance(event, TopologyEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_CREATE - assert event.topology_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID - assert event.topology_id.topology_uuid.uuid == DEFAULT_TOPOLOGY_UUID + assert isinstance(events[0], ContextEvent) + assert events[0].event.event_type == EventTypeEnum.EVENTTYPE_CREATE + assert events[0].context_id.context_uuid.uuid == DEFAULT_CONTEXT_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 == DEVICE1_UUID + assert isinstance(events[1], TopologyEvent) + assert events[1].event.event_type == EventTypeEnum.EVENTTYPE_CREATE + assert events[1].topology_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert events[1].topology_id.topology_uuid.uuid == DEFAULT_TOPOLOGY_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 == DEVICE2_UUID + assert isinstance(events[2], DeviceEvent) + assert events[2].event.event_type == EventTypeEnum.EVENTTYPE_CREATE + assert events[2].device_id.device_uuid.uuid == DEVICE1_UUID + + assert isinstance(events[3], DeviceEvent) + assert events[3].event.event_type == EventTypeEnum.EVENTTYPE_CREATE + assert events[3].device_id.device_uuid.uuid == DEVICE2_UUID # ----- Get when the object does not exist ------------------------------------------------------------------------- with pytest.raises(grpc.RpcError) as e: @@ -856,16 +858,16 @@ def test_grpc_service( assert response.context_uuid.uuid == DEFAULT_CONTEXT_UUID # ----- Check create event ----------------------------------------------------------------------------------------- - event = events_collector.get_event(block=True) - assert isinstance(event, ServiceEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_CREATE - assert event.service_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID - assert event.service_id.service_uuid.uuid == SERVICE_DEV1_DEV2_UUID + events = events_collector.get_events(block=True, count=2) - event = events_collector.get_event(block=True) - assert isinstance(event, ContextEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_UPDATE - assert event.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert isinstance(events[0], ServiceEvent) + assert events[0].event.event_type == EventTypeEnum.EVENTTYPE_CREATE + assert events[0].service_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert events[0].service_id.service_uuid.uuid == SERVICE_DEV1_DEV2_UUID + + assert isinstance(events[1], ContextEvent) + assert events[1].event.event_type == EventTypeEnum.EVENTTYPE_UPDATE + assert events[1].context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID # ----- Update the object ------------------------------------------------------------------------------------------ response = context_client_grpc.SetService(Service(**SERVICE_DEV1_DEV2)) @@ -921,31 +923,28 @@ def test_grpc_service( context_client_grpc.RemoveContext(ContextId(**CONTEXT_ID)) # ----- Check remove event ----------------------------------------------------------------------------------------- - event = events_collector.get_event(block=True) - assert isinstance(event, ServiceEvent) - assert event.service_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID - assert event.service_id.service_uuid.uuid == SERVICE_DEV1_DEV2_UUID + events = events_collector.get_events(block=True, count=5) - event = events_collector.get_event(block=True) - assert isinstance(event, DeviceEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_REMOVE - assert event.device_id.device_uuid.uuid == DEVICE1_UUID + assert isinstance(events[0], ServiceEvent) + assert events[0].service_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert events[0].service_id.service_uuid.uuid == SERVICE_DEV1_DEV2_UUID - event = events_collector.get_event(block=True) - assert isinstance(event, DeviceEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_REMOVE - assert event.device_id.device_uuid.uuid == DEVICE2_UUID + assert isinstance(events[1], DeviceEvent) + assert events[1].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE + assert events[1].device_id.device_uuid.uuid == DEVICE1_UUID - event = events_collector.get_event(block=True) - assert isinstance(event, TopologyEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_REMOVE - assert event.topology_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID - assert event.topology_id.topology_uuid.uuid == DEFAULT_TOPOLOGY_UUID + assert isinstance(events[2], DeviceEvent) + assert events[2].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE + assert events[2].device_id.device_uuid.uuid == DEVICE2_UUID - event = events_collector.get_event(block=True) - assert isinstance(event, ContextEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_REMOVE - assert event.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert isinstance(events[3], TopologyEvent) + assert events[3].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE + assert events[3].topology_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert events[3].topology_id.topology_uuid.uuid == DEFAULT_TOPOLOGY_UUID + + assert isinstance(events[4], ContextEvent) + assert events[4].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE + assert events[4].context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID # ----- Stop the EventsCollector ----------------------------------------------------------------------------------- events_collector.stop() diff --git a/src/device/.gitlab-ci.yml b/src/device/.gitlab-ci.yml index 2c93618afd4d6617370f0567bb33b4b4d382a1cf..1693d3687bbb567f94dc62f63eb36925c56466d7 100644 --- a/src/device/.gitlab-ci.yml +++ b/src/device/.gitlab-ci.yml @@ -19,7 +19,7 @@ build device: - src/$IMAGE_NAME/**/*.{py,in,yml} - src/$IMAGE_NAME/Dockerfile - src/$IMAGE_NAME/tests/*.py - - manifests/$IMAGE_NAMEservice.yaml + - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml # Apply unit test to the component @@ -52,7 +52,7 @@ unit test device: - src/$IMAGE_NAME/Dockerfile - src/$IMAGE_NAME/tests/*.py - src/$IMAGE_NAME/tests/Dockerfile - - manifests/$IMAGE_NAMEservice.yaml + - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml # Deployment of the service in Kubernetes Cluster @@ -65,10 +65,10 @@ deploy device: - unit test device # - integ_test execute script: - - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/$IMAGE_NAMEservice.yaml' + - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/${IMAGE_NAME}service.yaml' - kubectl version - kubectl get all - - kubectl apply -f "manifests/$IMAGE_NAMEservice.yaml" + - kubectl apply -f "manifests/${IMAGE_NAME}service.yaml" - kubectl get all # environment: # name: test diff --git a/src/device/requirements.in b/src/device/requirements.in index 5c38e92914207bf101ebc00b2cef453a3a85f82a..78abc96ad994c5d2acdb92ba9108b0527d61ecca 100644 --- a/src/device/requirements.in +++ b/src/device/requirements.in @@ -11,4 +11,5 @@ pytest-benchmark python-json-logger pytz redis +requests xmltodict diff --git a/src/device/service/drivers/transport_api/Tools.py b/src/device/service/drivers/transport_api/Tools.py new file mode 100644 index 0000000000000000000000000000000000000000..c569404bf7884501f9c8ea494f27983ca78ac3eb --- /dev/null +++ b/src/device/service/drivers/transport_api/Tools.py @@ -0,0 +1,100 @@ +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] + + +def config_getter(root_url, resource_key, timeout): + url = '{:s}/restconf/data/tapi-common:context'.format(root_url) + result = [] + try: + response = requests.get(url, timeout=timeout) + 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: + for sip in context['tapi-common:context']['service-interface-point']: + result.append( + ('/endpoints/endpoint[{:s}]'.format(sip['uuid']), {'uuid': sip['uuid'], 'type': '10Gbps'})) + + return result + +def create_connectivity_service( + root_url, timeout, uuid, input_sip, output_sip, direction, capacity_value, capacity_unit, layer_protocol_name, + layer_protocol_qualifier): + + url = '{:s}/restconf/data/tapi-common:context/tapi-connectivity:connectivity-context'.format(root_url) + headers = {'content-type': 'application/json'} + data = { + 'tapi-connectivity:connectivity-service': [ + { + 'uuid': uuid, + 'connectivity-constraint': { + 'requested-capacity': { + 'total-size': { + 'value': capacity_value, + 'unit': capacity_unit + } + }, + 'connectivity-direction': direction + }, + 'end-point': [ + { + 'service-interface-point': { + 'service-interface-point-uuid': input_sip + }, + 'layer-protocol-name': layer_protocol_name, + 'layer-protocol-qualifier': layer_protocol_qualifier, + 'local-id': input_sip + }, + { + 'service-interface-point': { + 'service-interface-point-uuid': output_sip + }, + 'layer-protocol-name': layer_protocol_name, + 'layer-protocol-qualifier': layer_protocol_qualifier, + 'local-id': output_sip + } + ] + } + ] + } + 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) + LOGGER.info('TAPI 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}/restconf/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={:s}' + url = url.format(root_url, uuid) + results = [] + try: + response = requests.delete(url=url, timeout=timeout) + 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/transport_api/TransportApiDriver.py b/src/device/service/drivers/transport_api/TransportApiDriver.py index f20173dd022a517d1e5630dc23c3455b0ed3c710..b3e5f4fa33f20836629c06968261fb1ceac8f075 100644 --- a/src/device/service/drivers/transport_api/TransportApiDriver.py +++ b/src/device/service/drivers/transport_api/TransportApiDriver.py @@ -1,9 +1,97 @@ -import logging +import logging, requests, threading +from typing import Any, Iterator, List, 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__) -# TODO: Implement TransportAPI Driver - class TransportApiDriver(_Driver): - pass + 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.__tapi_root = 'http://' + address + ':' + str(port) + self.__timeout = int(settings.get('timeout', 120)) + + def Connect(self) -> bool: + url = self.__tapi_root + '/restconf/data/tapi-common:context' + with self.__lock: + if self.__started.is_set(): return True + try: + requests.get(url, timeout=self.__timeout) + except requests.exceptions.Timeout: + LOGGER.exception('Timeout connecting {:s}'.format(str(self.__tapi_root))) + return False + except Exception: # pylint: disable=broad-except + LOGGER.exception('Exception connecting {:s}'.format(str(self.__tapi_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.__tapi_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))) + + input_sip = find_key(resource, 'input_sip') + output_sip = find_key(resource, 'output_sip') + uuid = find_key(resource, 'uuid') + capacity_value = find_key(resource, 'capacity_value') + capacity_unit = find_key(resource, 'capacity_unit') + layer_protocol_name = find_key(resource, 'layer_protocol_name') + layer_protocol_qualifier = find_key(resource, 'layer_protocol_qualifier') + direction = find_key(resource, 'direction') + + data = create_connectivity_service( + self.__tapi_root, self.__timeout, uuid, input_sip, output_sip, direction, capacity_value, + capacity_unit, layer_protocol_name, layer_protocol_qualifier) + 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.__tapi_root, self.__timeout, uuid)) + return results + + def SubscribeState(self, subscriptions : List[Tuple[str, float, float]]) -> List[Union[bool, Exception]]: + # TODO: TAPI 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: TAPI does not support monitoring by now + return [False for _ in subscriptions] + + def GetState(self, blocking=False) -> Iterator[Tuple[float, str, Any]]: + # TODO: TAPI does not support monitoring by now + return [] diff --git a/src/device/service/drivers/transport_api/__init__.py b/src/device/service/drivers/transport_api/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..d2a2d4b1a6c224c370479103553a769ce8a0956f 100644 --- a/src/device/service/drivers/transport_api/__init__.py +++ b/src/device/service/drivers/transport_api/__init__.py @@ -0,0 +1,13 @@ +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/tests/Device_Transport_Api_Template.py b/src/device/tests/Device_Transport_Api_Template.py new file mode 100644 index 0000000000000000000000000000000000000000..6032f0ff8ba683cd3a39bb6bd3c7a8c905974ce6 --- /dev/null +++ b/src/device/tests/Device_Transport_Api_Template.py @@ -0,0 +1,40 @@ +from copy import deepcopy +from device.proto.context_pb2 import DeviceDriverEnum, DeviceOperationalStatusEnum +from .Tools import config_rule_set, config_rule_delete + +# use "deepcopy" to prevent propagating forced changes during tests + +DEVICE_TAPI_UUID = 'DEVICE-TAPI' +DEVICE_TAPI_TYPE = 'optical-line-system' +DEVICE_TAPI_ADDRESS = '0.0.0.0' +DEVICE_TAPI_PORT = '4900' +DEVICE_TAPI_TIMEOUT = '120' +DEVICE_TAPI_DRIVERS = [DeviceDriverEnum.DEVICEDRIVER_TRANSPORT_API] + +DEVICE_TAPI_ID = {'device_uuid': {'uuid': DEVICE_TAPI_UUID}} +DEVICE_TAPI = { + 'device_id': deepcopy(DEVICE_TAPI_ID), + 'device_type': DEVICE_TAPI_TYPE, + 'device_config': {'config_rules': []}, + 'device_operational_status': DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_DISABLED, + 'device_drivers': DEVICE_TAPI_DRIVERS, + 'device_endpoints': [], +} + +DEVICE_TAPI_CONNECT_RULES = [ + config_rule_set('_connect/address', DEVICE_TAPI_ADDRESS), + config_rule_set('_connect/port', DEVICE_TAPI_PORT), + config_rule_set('_connect/timeout', DEVICE_TAPI_TIMEOUT), +] + +DEVICE_TAPI_CONFIG_RULES = [ + config_rule_set('network_instance[DemoOFC-NetInst]/interface[13/1/3]', { + 'name': 'DemoOFC-NetInst', 'id': '13/1/3', + }) +] + +DEVICE_TAPI_DECONFIG_RULES = [ + config_rule_delete('network_instance[DemoOFC-NetInst]/interface[13/1/3]', { + 'name': 'DemoOFC-NetInst', 'id': '13/1/3' + }) +] \ No newline at end of file diff --git a/src/device/tests/test_unitary.py b/src/device/tests/test_unitary.py index 046131810a6b00cb8e345111b017450493b6fcba..f5c43309e1682cd12925d853793d8dd0982e245b 100644 --- a/src/device/tests/test_unitary.py +++ b/src/device/tests/test_unitary.py @@ -49,6 +49,21 @@ except ImportError: # DEVICE_OC, DEVICE_OC_CONFIG_RULES, DEVICE_OC_DECONFIG_RULES, DEVICE_OC_CONNECT_RULES, DEVICE_OC_ID, # DEVICE_OC_UUID) +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 + # Create a Device_Transport_Api_??.py file with the details for your device to test it and import it as follows in + # the try block of this import statement. + # from .Device_Transport_Api_?? import( + # DEVICE_TAPI, DEVICE_TAPI_CONFIG_RULES, DEVICE_TAPI_DECONFIG_RULES, DEVICE_TAPI_CONNECT_RULES, + # DEVICE_TAPI_ID, DEVICE_TAPI_UUID) + +#ENABLE_OPENCONFIG = False +#ENABLE_TAPI = False LOGGER = logging.getLogger(__name__) LOGGER.setLevel(logging.DEBUG) @@ -586,3 +601,130 @@ def test_device_openconfig_delete( 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: return # if there is no device to test against, asusme test is silently passed. + + 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: return # if there is no device to test against, asusme test is silently passed. + + 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: return # if there is no device to test against, asusme test is silently passed. + + 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: return # if there is no device to test against, asusme test is silently passed. + + 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: return # if there is no device to test against, asusme test is silently passed. + + 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: return # if there is no device to test against, asusme test is silently passed. + + device_client.DeleteDevice(DeviceId(**DEVICE_TAPI_ID)) + driver : _Driver = device_service.driver_instance_cache.get(DEVICE_TAPI_UUID, {}) + assert driver is None diff --git a/src/l3_attackmitigator/.gitlab-ci.yml b/src/l3_attackmitigator/.gitlab-ci.yml index e20771744b43a9209c8b9a193a1fb126008bb006..1fb3d88ee50ab2f330049f737fc455ac05aa8375 100644 --- a/src/l3_attackmitigator/.gitlab-ci.yml +++ b/src/l3_attackmitigator/.gitlab-ci.yml @@ -2,7 +2,6 @@ build l3_attackmitigator: variables: IMAGE_NAME: 'l3_attackmitigator' # name of the microservice - IMAGE_NAME_TEST: 'l3_attackmitigator-test' # name of the microservice IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) stage: build before_script: @@ -11,16 +10,22 @@ build l3_attackmitigator: - 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/** + - src/$IMAGE_NAME/**/*.{py,in,yml} + - src/$IMAGE_NAME/Dockerfile + - src/$IMAGE_NAME/tests/*.py + - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml # Pull, execute, and run unitary tests for the Docker image from the GitLab registry -unit_test l3_attackmitigator: +unit test l3_attackmitigator: variables: IMAGE_NAME: 'l3_attackmitigator' # name of the microservice - IMAGE_NAME_TEST: 'l3_attackmitigator-test' # name of the microservice IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) stage: unit_test needs: @@ -28,34 +33,50 @@ unit_test l3_attackmitigator: 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 -d -p 10002:10002 --name $IMAGE_NAME --network=teraflowbridge "$IMAGE_NAME:$IMAGE_TAG" - - docker ps -a + - docker run --name $IMAGE_NAME -d -p 10002:10002 --network=teraflowbridge $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG - sleep 5 - docker ps -a - - docker port $IMAGE_NAME - docker logs $IMAGE_NAME - - docker exec -i $IMAGE_NAME bash -c "pytest --log-level=DEBUG --verbose -o log_cli=true $IMAGE_NAME/tests/test_unitary.py" + - 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 + - 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/** + - 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 # Deployment of the service in Kubernetes Cluster deploy l3_attackmitigator: + variables: + IMAGE_NAME: 'l3_attackmitigator' # name of the microservice + IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) stage: deploy needs: - - build l3_attackmitigator - - unit_test l3_attackmitigator - - dependencies all - - integ_test execute + - unit test l3_attackmitigator + # - 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/l3_attackmitigatorservice.yaml" - - kubectl delete pods --selector app=l3_attackmitigatorservice + - 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/l3_centralizedattackdetector/.gitlab-ci.yml b/src/l3_centralizedattackdetector/.gitlab-ci.yml index aaebe01e4dce047b8c84a515283231d06cd26dab..cd410cb9cdf8df5a7f41db46304192a9ba591443 100644 --- a/src/l3_centralizedattackdetector/.gitlab-ci.yml +++ b/src/l3_centralizedattackdetector/.gitlab-ci.yml @@ -2,7 +2,6 @@ build l3_centralizedattackdetector: variables: IMAGE_NAME: 'l3_centralizedattackdetector' # name of the microservice - IMAGE_NAME_TEST: 'l3_centralizedattackdetector-test' # name of the microservice IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) stage: build before_script: @@ -11,16 +10,22 @@ build l3_centralizedattackdetector: - 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/** + - src/$IMAGE_NAME/**/*.{py,in,yml} + - src/$IMAGE_NAME/Dockerfile + - src/$IMAGE_NAME/tests/*.py + - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml # Pull, execute, and run unitary tests for the Docker image from the GitLab registry -unit_test l3_centralizedattackdetector: +unit test l3_centralizedattackdetector: variables: IMAGE_NAME: 'l3_centralizedattackdetector' # name of the microservice - IMAGE_NAME_TEST: 'l3_centralizedattackdetector-test' # name of the microservice IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) stage: unit_test needs: @@ -28,34 +33,50 @@ unit_test l3_centralizedattackdetector: 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 -d -p 10001:10001 --name $IMAGE_NAME --network=teraflowbridge "$IMAGE_NAME:$IMAGE_TAG" - - docker ps -a + - docker run --name $IMAGE_NAME -d -p 10001:10001 --network=teraflowbridge $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG - sleep 5 - docker ps -a - - docker port $IMAGE_NAME - docker logs $IMAGE_NAME - - docker exec -i $IMAGE_NAME bash -c "pytest --log-level=DEBUG --verbose -o log_cli=true $IMAGE_NAME/tests/test_unitary.py" + - 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 + - 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/** + - 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 # Deployment of the service in Kubernetes Cluster deploy l3_centralizedattackdetector: + variables: + IMAGE_NAME: 'l3_centralizedattackdetector' # name of the microservice + IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) stage: deploy needs: - - build l3_centralizedattackdetector - - unit_test l3_centralizedattackdetector - - dependencies all - - integ_test execute + - unit test l3_centralizedattackdetector + # - 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/l3_centralizedattackdetectorservice.yaml" - - kubectl delete pods --selector app=l3_centralizedattackdetectorservice + - 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/l3_distributedattackdetector/.gitlab-ci.yml b/src/l3_distributedattackdetector/.gitlab-ci.yml index c2579c70ac78c7ec8ca21fc48110b4656b644f08..435e6ee833ca29fdfd204d9e30990a3c655f2284 100644 --- a/src/l3_distributedattackdetector/.gitlab-ci.yml +++ b/src/l3_distributedattackdetector/.gitlab-ci.yml @@ -2,7 +2,6 @@ build l3_distributedattackdetector: variables: IMAGE_NAME: 'l3_distributedattackdetector' # name of the microservice - IMAGE_NAME_TEST: 'l3_distributedattackdetector-test' # name of the microservice IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) stage: build before_script: @@ -11,16 +10,22 @@ build l3_distributedattackdetector: - 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/** + - src/$IMAGE_NAME/**/*.{py,in,yml} + - src/$IMAGE_NAME/Dockerfile + - src/$IMAGE_NAME/tests/*.py + - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml # Pull, execute, and run unitary tests for the Docker image from the GitLab registry -unit_test l3_distributedattackdetector: +unit test l3_distributedattackdetector: variables: IMAGE_NAME: 'l3_distributedattackdetector' # name of the microservice - IMAGE_NAME_TEST: 'l3_distributedattackdetector-test' # name of the microservice IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) stage: unit_test needs: @@ -28,33 +33,50 @@ unit_test l3_distributedattackdetector: 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 -d -p 10000:10000 --name $IMAGE_NAME --network=teraflowbridge "$IMAGE_NAME:$IMAGE_TAG" - - docker ps -a + - docker run --name $IMAGE_NAME -d -p 10000:10000 --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 "pytest --log-level=DEBUG --verbose -o log_cli=true $IMAGE_NAME/tests/test_unitary.py" + - 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 + - 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/** + - 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 # Deployment of the service in Kubernetes Cluster deploy l3_distributedattackdetector: + variables: + IMAGE_NAME: 'l3_distributedattackdetector' # name of the microservice + IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) stage: deploy needs: - - build l3_distributedattackdetector - - unit_test l3_distributedattackdetector - - dependencies all - - integ_test execute + - unit test l3_distributedattackdetector + # - 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/l3_distributedattackdetectorservice.yaml" - - kubectl delete pods --selector app=l3_distributedattackdetectorservice + - 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/monitoring/.gitlab-ci.yml b/src/monitoring/.gitlab-ci.yml index 4b475bb26f7fa462743f7586060487174f02c2da..2d0705229cd5d38f75e450111d175af749522883 100644 --- a/src/monitoring/.gitlab-ci.yml +++ b/src/monitoring/.gitlab-ci.yml @@ -10,8 +10,8 @@ build monitoring: - 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 rmi $(docker images --quiet --filter=dangling=true) + 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"' @@ -19,7 +19,7 @@ build monitoring: - src/$IMAGE_NAME/**/*.{py,in,yml} - src/$IMAGE_NAME/Dockerfile - src/$IMAGE_NAME/tests/*.py - - manifests/$IMAGE_NAMEservice.yaml + - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml # Apply unit test to the component @@ -42,6 +42,7 @@ unit test monitoring: - docker run --name $IMAGE_NAME -d -p 7070:7070 --env INFLUXDB_USER=$INFLUXDB_USER --env INFLUXDB_PASSWORD=$INFLUXDB_PASSWORD --env INFLUXDB_DATABASE=$INFLUXDB_DATABASE --env INFLUXDB_HOSTNAME=influxdb -v "$PWD/src/$IMAGE_NAME/tests:/opt/results" --network=teraflowbridge --rm $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG - sleep 30 - docker ps -a + - docker logs $IMAGE_NAME - docker exec -i $IMAGE_NAME bash -c "pytest --junitxml=/opt/results/report.xml" after_script: - docker rm -f $IMAGE_NAME @@ -55,7 +56,7 @@ unit test monitoring: - src/$IMAGE_NAME/Dockerfile - src/$IMAGE_NAME/tests/*.py - src/$IMAGE_NAME/tests/Dockerfile - - manifests/$IMAGE_NAMEservice.yaml + - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml artifacts: when: always @@ -72,10 +73,10 @@ deploy monitoring: - unit test monitoring # - integ_test execute script: - - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/$IMAGE_NAMEservice.yaml' + - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/${IMAGE_NAME}service.yaml' - kubectl version - kubectl get all - - kubectl apply -f "manifests/$IMAGE_NAMEservice.yaml" + - kubectl apply -f "manifests/${IMAGE_NAME}service.yaml" - kubectl get all # environment: # name: test diff --git a/src/service/.gitlab-ci.yml b/src/service/.gitlab-ci.yml index 3c943d5438f64dd1e6f6b12749b839539a22ca46..da5064f6ccef7b2ea91ddf6a77c35f5d4383ad65 100644 --- a/src/service/.gitlab-ci.yml +++ b/src/service/.gitlab-ci.yml @@ -19,7 +19,7 @@ build service: - src/$IMAGE_NAME/**/*.{py,in,yml} - src/$IMAGE_NAME/Dockerfile - src/$IMAGE_NAME/tests/*.py - - manifests/$IMAGE_NAMEservice.yaml + - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml # Apply unit test to the component @@ -52,7 +52,7 @@ unit test service: - src/$IMAGE_NAME/Dockerfile - src/$IMAGE_NAME/tests/*.py - src/$IMAGE_NAME/tests/Dockerfile - - manifests/$IMAGE_NAMEservice.yaml + - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml # Deployment of the service in Kubernetes Cluster @@ -65,10 +65,10 @@ deploy service: - unit test service # - integ_test execute script: - - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/$IMAGE_NAMEservice.yaml' + - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/${IMAGE_NAME}service.yaml' - kubectl version - kubectl get all - - kubectl apply -f "manifests/$IMAGE_NAMEservice.yaml" + - kubectl apply -f "manifests/${IMAGE_NAME}service.yaml" - kubectl get all # environment: # name: test diff --git a/src/service/tests/ServiceHandler_L3NM_EMU.py b/src/service/tests/ServiceHandler_L3NM_EMU.py index c01fac5e3ea10490bced5155e693817f6ddea41b..cfaf49d084448b0aee88c18823a8af91040831d0 100644 --- a/src/service/tests/ServiceHandler_L3NM_EMU.py +++ b/src/service/tests/ServiceHandler_L3NM_EMU.py @@ -29,15 +29,11 @@ DEVICE2_UUID = 'EMULATED-ROUTER-2' DEVICE_ATTRIBUTES = { # device_uuid => {device_settings} DEVICE1_UUID: { 'type' : 'emulated', - 'address' : '10.95.86.155', - 'port' : '830', 'drivers' : [DeviceDriverEnum.DEVICEDRIVER_UNDEFINED], 'endpoint': 'EP100', }, DEVICE2_UUID: { 'type' : 'emulated', - 'address' : '10.96.86.149', - 'port' : '830', 'drivers' : [DeviceDriverEnum.DEVICEDRIVER_UNDEFINED], 'endpoint': 'EP100', },