Skip to content
Messages.py 1.96 KiB
Newer Older
# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# 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.

Waleed Akbar's avatar
Waleed Akbar committed
import uuid
import random
from common.proto import telemetry_frontend_pb2
Waleed Akbar's avatar
Waleed Akbar committed
from common.proto.kpi_sample_types_pb2 import KpiSampleType
from common.proto.kpi_manager_pb2 import KpiId
# ----------------------- "2nd" Iteration --------------------------------
Waleed Akbar's avatar
Waleed Akbar committed
def create_collector_id():
    _collector_id                   = telemetry_frontend_pb2.CollectorId()
    # _collector_id.collector_id.uuid = str(uuid.uuid4())
    _collector_id.collector_id.uuid = "5d45f53f-d567-429f-9427-9196ac72ff0c"
Waleed Akbar's avatar
Waleed Akbar committed
    return _collector_id

def create_collector_request():
    _create_collector_request                                = telemetry_frontend_pb2.Collector()
Waleed Akbar's avatar
Waleed Akbar committed
    _create_collector_request.collector_id.collector_id.uuid = str(uuid.uuid4())
    _create_collector_request.kpi_id.kpi_id.uuid             = str(uuid.uuid4())
Waleed Akbar's avatar
Waleed Akbar committed
    _create_collector_request.duration_s                     = float(random.randint(8, 16))
    _create_collector_request.interval_s                     = float(random.randint(2, 4))
    return _create_collector_request
Waleed Akbar's avatar
Waleed Akbar committed
def create_collector_filter():
    _create_collector_filter = telemetry_frontend_pb2.CollectorFilter()
    kpi_id_obj               = KpiId()
    # kpi_id_obj.kpi_id.uuid   = str(uuid.uuid4())
    kpi_id_obj.kpi_id.uuid   = "a7237fa3-caf4-479d-84b6-4d9f9738fb7f"
    _create_collector_filter.kpi_id.append(kpi_id_obj)
Waleed Akbar's avatar
Waleed Akbar committed
    return _create_collector_filter